Re: Scripters cove
Posted: Sat Mar 17, 2012 4:44 am
Thanks Svengali.
For information and discussion about Oolite.
https://bb.oolite.space/
I don't think so, we had to use an AI State triggered by JS at XephatlsSword to achieve that effect.Thargoid wrote:Can flashers be turned on and off by script (the equivalent of the AI commands switchLightsOn and switchLightsOff)? I had a memory that it got introduced at one point, but I can't find it anywhere. Or have we still got to bounce off an AI to do it?
this.ship.lightsActive = true
or this.ship.lightsActive = false
An update to XS is requiredCapt. Murphy wrote:http://wiki.alioth.net/index.php/Oolite ... ghtsActive
is read/write - you don't need to go via the AI.
this.ship.lightsActive = true
orthis.ship.lightsActive = false
Thanks too - I thought I could recall such a command but couldn't find it for looking...Capt. Murphy wrote:http://wiki.alioth.net/index.php/Oolite ... ghtsActive
is read/write - you don't need to go via the AI.
this.ship.lightsActive = true
orthis.ship.lightsActive = false
Code: Select all
conditions = (
"systemGovernment_number morethan 3"
Yes, and yes. You can test against all variables that were part of the legacy scripting system. They're listed on the [wiki]Methods[/wiki]-page (Querying states). The one you're looking for isGimbal Locke wrote:Is it possible to have an item for sale at a specific planet?
I looked at http://wiki.alioth.net/index.php/Equipment.plist, where I found:
Is there a list somewhere on which variables (such as systemGovernment_number) I can test against (I suppose there is a variable such as systemName or systemID)?Code: Select all
conditions = ( "systemGovernment_number morethan 3"
planet_number
, probably together with galaxy_number
.Is there also a non-legacy way to achieve the same?Commander McLane wrote:You can test against all variables that were part of the legacy scripting system.
Nope, not within a plist. And the markets are not exposed to JS.Gimbal Locke wrote:Thanks, Commander McLane!
Is there also a non-legacy way to achieve the same?Commander McLane wrote:You can test against all variables that were part of the legacy scripting system.
I think you can do the same in JS...with a bit of trickery.Gimbal Locke wrote:Thanks, Commander McLane!
Is there also a non-legacy way to achieve the same?Commander McLane wrote:You can test against all variables that were part of the legacy scripting system.
"requires_equipment" = "EQ_GIMBAL_DUMMY"
; or similar."visible" = no;
in it's equipment info.You can also do the same with a mission variable, which is probably a little simpler:Capt. Murphy wrote:I think you can do the same in JS...with a bit of trickery.
Code: Select all
"conditions" = ("mission_thisequipmentisavailable equal 1");
It's also possible to turn lights on/off via AI.plist scripts...which could also be triggered by .js scripts.Thargoid wrote:Thanks too - I thought I could recall such a command but couldn't find it for looking...Capt. Murphy wrote:http://wiki.alioth.net/index.php/Oolite ... ghtsActive
is read/write - you don't need to go via the AI.
this.ship.lightsActive = true
orthis.ship.lightsActive = false
Sounds a bit complex to me. The easier variant would be to give the equipment itself a lvl of 99 and only set it to the current lvl on docking at a station where needed. Than set it back to 99 on launching.Capt. Murphy wrote:I think you can do the same in JS...with a bit of trickery.
You need the equipment item to"requires_equipment" = "EQ_GIMBAL_DUMMY"
; or similar.
"EQ_GIMBAL_DUMMY" has a required tech lvl of 99 and is"visible" = no;
in it's equipment info.
Code: Select all
this.otherShipDocked = function (ship)
{
if (ship.isPlayer) missionVariables.EQ_MY_EQUIPMENT = 3;
}
this.stationLaunchedShip = function (ship)
{
if (ship.isPlayer) delete missionVariables.EQ_MY_EQUIPMENT;
}