Spawning several stations using the same JS script but differing state machines would I be right in assuming that each station will have its unique copy of the ship Jscript with persistent and seperate properties?
For example: defining the global property on a ship script with something like:
this.property = someValue;
will each station in the system have it's own copy and does the AI script persist or is it reloaded according to game mechanics, resetting everything?
Code: Select all
this.sendComm = function ()
{
if(this.logging1 && this.updateSent == false)
{
log(this.name, "In sendComm... \nplayerDetected = " + this.playerDetectedFlag+"\nupdateSent = " + this.updateSent);
}
if(this.playerDetectedFlag == false && this.updateSent == false)
{
if(this.logging1 && this.updateSent == false)
{
log(this.name, "sending message...");
}
player.consoleMessage("Update....");
this.updateSent = true;
}
}
Even though I have several stations in the system, I seem to get only one message. Is this a built in redundancy remover because they are atm identical? Or is it because each station is sharing the script with the same properties?
EDIT: If it is the latter would transferring the flags to the world script work and then access them through:
Code: Select all
worldScripts["scriptName"].propertyName