= PartDestructionEvent =
[[PageOutline(2-3,CONTENT,pullout)]]
{{{
#!html
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.
[[br]]
{{{
#!html
NOTE: A part's destructionevents are not executed, if said part was destroyed by another part's destructionevent. E.g: If destroying part A triggers an event destroying part B, the destructionevents of part B are ignored!
|
}}}
== Implementation ==
To add a !PartDestructionEvent to a !ShipPart, add it as seen below:
{{{
}}}
!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[[br]]to be modified||ship[[br]]engine[[br]]weapon[[br]]part||The !ModularSpaceShip itself[[br]]An attached engine[[br]]An attached weapon[[br]]An attached Part||
||targetName||Selection of the engine/weapon/part[[br]]to be modified||[string]||-||
||targetParam||Selection of the parameter[[br]]to be modified||''For targetType ship:''[[br]]shieldhealth[[br]]boostpower[[br]]boostpowerrate[[br]]rotationthrust[[br]]''For targetType engine:''[[br]]NULL[[br]]boostfactor[[br]]speedfront[[br]]accelerationfront||[[br]]Health of the ship's shield[[br]]Maximum available boost[[br]]Recharging-rate of boost[[br]]Rotationthrust of ship[[br]] [[br]] [[br]]The strength of the boost[[br]]Maximum forward-speed[[br]]Forward-acceleration||
||operation||Selection of the operation to be executed[[br]]on the parameter/target||-[[br]]+[[br]]*[[br]]set[[br]]destroy||Substracts value from parameter[[br]]Adds value to parameter[[br]]Multiplies parameter with value[[br]]Sets parameter to value[[br]]Deletes target (or sets value to 0)||
||value||Value used to apply the operation||[float]||-||
||message||Message to be shown in chat upon[[br]]destruction of the !ShipPart||[string]||-||
[[br]]
== Example ==
Here's a few examples of !PartDestructionEvents.
[[br]]
{{{
}}}
''Description:'' Reduces the ship's boost-recharging-rate by 0.5 and shows a message in chat.
[[br]]
{{{
}}}
''Description:'' Sets the booststrength of the engine named "bodyengine" to 1 (= no boost).
[[br]]
{{{
}}}
''Description:'' Destroys the ShipPart named "sidearmLfront".
[[br]]
Look at the [source:code/trunk/data/levels/templates/HeavyCruiser.oxt#L3 HeavyCruiser.oxt] template to see a working implementation of this!
[[br]]
== Development ==
[[br]]
=== TODO ===
* Expand functionality of !PartDestructionEvents
[[br]]
=== Problems ===
* Not all currently implemented functions seem to work?
[[br]]
== More Ideas ==
* N/A