So someone pointed out to me before legacy scripts can take about 10 seconds to kick in and don't occur immediately. Leave it a few seconds the rating should change.
*EDIT* lol just seen your mistake myself anyway above comment still stands. I hate it when mistakes in code are that stupid you can't see them, i had trouble when doing blackjacks over a missing capital letter lol. *EDIT*
Altering of player legal status via XML script
Moderators: winston, another_commander
- Rustybolts
- ---- E L I T E ----
- Posts: 293
- Joined: Sun Jun 07, 2009 6:22 pm
- Location: UK
STE.+ Firefly/Dragonfly + BlackJacksbullion v.1.23 link below.
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
http://www.mediafire.com/?sharekey=ca16 ... f6e8ebb871
-
- ---- E L I T E ----
- Posts: 389
- Joined: Sat Sep 26, 2009 2:14 pm
- Location: Christchurch, New Zealand
I'm in the middle of converting the plist to javascript.Rustybolts wrote:Tested my solution and works here's my codeCode: Select all
{ test = ( { conditions = ("galaxy_number equal 0"); do = ( { conditions = ( "planet_number equal 129" ); do = ( "set :local_legal [legalStatus_number]", "add: local_legal 64", "setLegalStatus: [local_legal]" ); } ); } ); }
If the above were recoded to more standard javascript, how would we do this with 1.73.4? Something like this?
Oh, and how would we work with things like mission_playerstation_AAAif (galaxyNumber === 0 && planetNumber === 129) {
player.bounty = 0;
}
The wiki reference is rather quiet on this, so I hope that we are able to do so and it's just currently undocumented.
I'm helping Lestradae recode his plist and 90% of it relates to the player stations, being over 13000 lines of plist code just in itself.
A trumble a day keeps the doctor away, and the tax man;
even the Grim Reaper keeps his distance.
-- Paul Wilkins
even the Grim Reaper keeps his distance.
-- Paul Wilkins
- Cmd. Cheyd
- ---- E L I T E ----
- Posts: 934
- Joined: Tue Dec 16, 2008 2:52 pm
- Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...
Code: Select all
this.whatever = function();
if(galaxyNumber == 0 && system.ID == 129) {
do.whatever;
}
}
Find my OXP's at:
Deep Horizon Industries - Your Planet Our Design
Deep Horizon Industries - Your Planet Our Design
I would use system.ID in place of planetNumber (it's the js equivalent) and == is enough, === isn't needed). But other than that yes you can identify systems that way. Trigger it with an event such as this.shipExitedWitchspace and it will happen as soon as you enter each system.
Depends quite what you want to do though exactly.
Depends quite what you want to do though exactly.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
The full translation of the xml above:
The legacy scripting system has no events and such, all legacy scripts are executed approximately once every 10 seconds, so - unless there are other conditions stopping that code from running again and again - the legacy code would keep increasing the player bounty throughout their stay in Zaonce.
This js code is executed only once per system, at the end of the tunnel effect.
Code: Select all
this.shipExitedWitchspace = function ()
{
if(galaxyNumber == 0 && system.ID == 129)
{
player.bounty += 64;
}
}
This js code is executed only once per system, at the end of the tunnel effect.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)