Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of code/doc/PartDestructionEvent


Ignore:
Timestamp:
May 22, 2014, 3:09:49 PM (11 years ago)
Author:
noep
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/PartDestructionEvent

    v1 v1  
     1= PartDestructionEvent =
     2
     3[[PageOutline(2-3,CONTENT,pullout)]]
     4
     5{{{
     6#!html
     7<table border="0" bgcolor="lightgray"><tr><td>
     8<b>NOTE:</b> Not all features mentioned in this article are implemented yet.
     9</td></tr></table>
     10}}}
     11
     12!PartDestructionEvents are used to modify a [BigShip ModularSpaceShip]'s behaviour when one if its !ShipParts is destroyed.
     13[[br]]
     14
     15== Implementation ==
     16
     17To add a !PartDestructionEvent to a !ShipPart, add it as seen below:
     18
     19{{{
     20<ModularSpaceShip . . . >
     21
     22    <attached>
     23        <StaticEntity name="wing"  . . .  />
     24        <StaticEntity name="tail" . . . />
     25    </attached>
     26
     27    <parts>
     28        <ShipPart name="wing" . . . >
     29            <destructionevents>
     30                <PartDestructionEvent . . . />
     31                <PartDestructionEvent . . . />
     32            </destructionevents>
     33        </ShipPart>
     34
     35        <ShipPart name="tail" . . . >
     36            <destructionevents>
     37                <PartDestructionEvent . . . />
     38            </destructionevents>
     39        </ShipPart>
     40    </parts>
     41
     42    <engines>
     43        <Engine />
     44        <Engine />
     45    </engines>
     46
     47</ModularSpaceShip>
     48}}}
     49
     50!PartDestructionEvents have the following parameters which can be used to define its behaviour:
     51||'''Parameter'''||'''Function'''||'''Valid inputs'''||'''Description'''||
     52||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||
     53||targetName||Selection of the engine/weapon/part[[br]]to be modified||[string]||-||
     54||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||
     55||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)||
     56||value||Value used to apply the operation||[float]||-||
     57||message||Message to be shown in chat upon[[br]]destruction of the !ShipPart||[string]||-||
     58
     59[[br]]
     60
     61
     62== Example ==
     63
     64Look at the [http://www.orxonox.net/browser/code/branches/presentationFS14/data/levels/templates/HeavyCruiser.oxt#L3 HeavyCruiser.oxt] template to see an implementation of this!
     65
     66[[br]]
     67
     68== Development ==
     69
     70
     71[[br]]
     72
     73=== TODO ===
     74
     75 * Expand functionality of !PartDestructionEvents
     76
     77[[br]]
     78
     79
     80=== Problems ===
     81
     82 * Not all currently implemented functions seem to work?
     83
     84[[br]]
     85
     86
     87== More Ideas ==
     88
     89 * N/A