You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oolite 1.x supports legacy conditions for equipment. A JavaScript replacement is needed.
1.75 added equipment scripts in order to implement the primable equipment system. These equipment scripts have a ship property set before being run, so applying them directly to the problem would be inconvenient. I can see several options:
Change the semantics of equipment scripts so that they’re associated with an equipment type and the ship is passed as a parameter to activated().
Add a separate “equipment type script”.
Instantiate the equipment script once, with no ship property, and make that the “equipment type” script. When an equipment item is activated, create a new script object with the type script as its prototype and the ship property set. (I’m actually considering doing this for ship scripts as well; the downside is that scripts that do stuff on first run will need to be rewritten to use shipSpawned(), and the closure pattern won’t work.)
The text was updated successfully, but these errors were encountered:
Related idea: remove the various equipment type conditions (available_to_all, requires_non_full_fuel and all that jazz), and use scripts instead. For upgrading, code can be generated. (I should find my “new” JS code generator and check it in.)
For a while, I considered handling as many equipment effects as possible using scripts, but I’ve decided that’s a bad idea. Instead, the built-in effects (like adding ECM ability) should be flags on equipment, with internal counters of how many equipment items are applying each effect. That way, you can create one equipment item that’s just an ECM, and one that combines ECM with Advanced Nav Array or something, and adding/removing both will work properly.
Oolite 1.x supports legacy
conditions
for equipment. A JavaScript replacement is needed.1.75 added equipment scripts in order to implement the primable equipment system. These equipment scripts have a
ship
property set before being run, so applying them directly to the problem would be inconvenient. I can see several options:activated()
.ship
property, and make that the “equipment type” script. When an equipment item is activated, create a new script object with the type script as its prototype and theship
property set. (I’m actually considering doing this for ship scripts as well; the downside is that scripts that do stuff on first run will need to be rewritten to useshipSpawned()
, and the closure pattern won’t work.)The text was updated successfully, but these errors were encountered: