Version 1 (modified by noep, 11 years ago) (diff) |
---|
PartDestructionEvent
NOTE: Not all features mentioned in this article are implemented yet. |
PartDestructionEvents are used to modify a [BigShip ModularSpaceShip]'s behaviour when one if its ShipParts is destroyed.
Implementation
To add a PartDestructionEvent to a ShipPart, add it as seen below:
<ModularSpaceShip . . . > <attached> <StaticEntity name="wing" . . . /> <StaticEntity name="tail" . . . /> </attached> <parts> <ShipPart name="wing" . . . > <destructionevents> <PartDestructionEvent . . . /> <PartDestructionEvent . . . /> </destructionevents> </ShipPart> <ShipPart name="tail" . . . > <destructionevents> <PartDestructionEvent . . . /> </destructionevents> </ShipPart> </parts> <engines> <Engine /> <Engine /> </engines> </ModularSpaceShip>
PartDestructionEvents have the following parameters which can be used to define its behaviour:
Parameter | Function | Valid inputs | Description |
targetType | Selection of the type of the target to be modified | ship engine weapon part | The ModularSpaceShip itself An attached engine An attached weapon An attached Part |
targetName | Selection of the engine/weapon/part to be modified | [string] | - |
targetParam | Selection of the parameter to be modified | For targetType ship: shieldhealth boostpower boostpowerrate rotationthrust For targetType engine: NULL boostfactor speedfront accelerationfront | Health of the ship's shield Maximum available boost Recharging-rate of boost Rotationthrust of ship The strength of the boost Maximum forward-speed Forward-acceleration |
operation | Selection of the operation to be executed on the parameter/target | - + * set destroy | Substracts value from parameter Adds value to parameter Multiplies parameter with value Sets parameter to value Deletes target (or sets value to 0) |
value | Value used to apply the operation | [float] | - |
message | Message to be shown in chat upon destruction of the ShipPart | [string] | - |
Example
Look at the HeavyCruiser.oxt template to see an implementation of this!
Development
TODO
- Expand functionality of PartDestructionEvents
Problems
- Not all currently implemented functions seem to work?
More Ideas
- N/A