Skip to content

Equipment condition scripting #2

@JensAyton

Description

@JensAyton

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions