Page 2 of 2

Posted: Tue Jul 28, 2009 3:54 pm
by Rustybolts
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*

Posted: Fri Oct 02, 2009 5:26 am
by pmw57
Rustybolts wrote:
Tested my solution and works here's my code

Code: 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]"
							);
						}
				);
		}
	);
}	
I'm in the middle of converting the plist to javascript.

If the above were recoded to more standard javascript, how would we do this with 1.73.4? Something like this?
if (galaxyNumber === 0 && planetNumber === 129) {
player.bounty = 0;
}
Oh, and how would we work with things like mission_playerstation_AAA
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.

Posted: Fri Oct 02, 2009 5:40 am
by Cmd. Cheyd

Code: Select all

this.whatever = function();
     if(galaxyNumber == 0 && system.ID == 129) {
          do.whatever;
     }
}
Should work....

Posted: Fri Oct 02, 2009 5:41 am
by Thargoid
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.

Posted: Fri Oct 02, 2009 8:38 am
by Kaks
The full translation of the xml above:

Code: Select all

this.shipExitedWitchspace = function ()
{
    if(galaxyNumber == 0 && system.ID == 129)
    {
        player.bounty += 64;
    }
}
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.