Hi digdug,
Thanks in advance for the topic move. When will we know when the list is finished ? I suggest to grep the source for all "<On" sequences and take away every event that appears in Timer triggers.
For the difference between Jump and Gate, I should have thought about that. Thanks for the precision !
List of builtin events
- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
DIrectly from 0.99 New modding features page (this is what I'm looking for for all the hardcoded events):
<OnAIUpdate> Event
gSource = object that carries the item
gItem = the item
The OnAIUpdate event for an item is called once every 30 ticks on every non-player ship that carries the item. Use this event to implement special behaviors. For example, an <OnAIUpdate> event on an armor patch item allows a non-player ship to use the armor patch when it is damaged.
Use this event sparingly because it will impact performance.
<OnUpdate> Event
gSource = object that carries the item
gItem = the item
The OnUpdate event for an item is called once every 30 ticks on every object that carries the item. Use this event sparingly because it will impact performance.
<OnDestroy> Event
gSource = ship object
aDestroyer = object that caused destruction
aWreckObj = ship wreck left behind
The <OnDestroy> event now includes the aWreckObj parameter that allows you to access the wreck left behind by a ship. This parameter is sometimes Nil if the ship left no wreck.
<OnObjDestroyed> Event
gSource = object called
aObjDestroyed = object destroyed
aDestroyer = object that caused destruction
aWreckObj = ship wreck left behind
The <OnObjDestroyed> event now includes the aWreckObj parameter that allows you to access the wreck left behind by a ship. This parameter is sometimes Nil if the ship left no wreck.
<OnDamage> Event
gSource = station object
aAttacker = object that attacked
aHitPos = vector position of hit
aHitDir = angle direction from which hit came
aDamageHP = hit points of damage
aDamageType = type of damage
This event is called when a station is hit by a weapon. The event must return the number of hit points of damage to do to the station. For example, imagine a station that takes half damage from the player (but full damage from all others). The event could check aAttacker and return half of aDamageHP if it is the player and full aDamageHP otherwise.
The event should avoid affecting other objects and should not destroy the station (e.g., by calling objDestroy). If necessary, the event could return a very large number to insure that the station is destroyed.
<OnEnteredGate>
gSource = station object
aGateObj = gate object
Version 0.99 uses aGateObj instead of aGate (as in previous versions) to be consistent with <OnObjEnteredGate>.
<OnGlobalSystemCreated>
(no parameters)
This event is called after a system is created (right after <OnCreate> for the system). You may use this event to create new objects in the system or to otherwise alter the system. Remember that there is no guarantee that other systems have been created at this point.
Look at Huari.xml for an example of how this event is used.
<OnGlobalTopologyCreated>
(no parameters)
This event is called at the beginning of the game right after the complete system topology has been generated. You may use this event to explore the topology and add data to topology nodes that may later be used inside systems. Remember that no systems have been created yet. You can only call functions that work on topology nodes.
For an example of how this event is used, look at Huari.xml.
<OnAIUpdate> Event
gSource = object that carries the item
gItem = the item
The OnAIUpdate event for an item is called once every 30 ticks on every non-player ship that carries the item. Use this event to implement special behaviors. For example, an <OnAIUpdate> event on an armor patch item allows a non-player ship to use the armor patch when it is damaged.
Use this event sparingly because it will impact performance.
<OnUpdate> Event
gSource = object that carries the item
gItem = the item
The OnUpdate event for an item is called once every 30 ticks on every object that carries the item. Use this event sparingly because it will impact performance.
<OnDestroy> Event
gSource = ship object
aDestroyer = object that caused destruction
aWreckObj = ship wreck left behind
The <OnDestroy> event now includes the aWreckObj parameter that allows you to access the wreck left behind by a ship. This parameter is sometimes Nil if the ship left no wreck.
<OnObjDestroyed> Event
gSource = object called
aObjDestroyed = object destroyed
aDestroyer = object that caused destruction
aWreckObj = ship wreck left behind
The <OnObjDestroyed> event now includes the aWreckObj parameter that allows you to access the wreck left behind by a ship. This parameter is sometimes Nil if the ship left no wreck.
<OnDamage> Event
gSource = station object
aAttacker = object that attacked
aHitPos = vector position of hit
aHitDir = angle direction from which hit came
aDamageHP = hit points of damage
aDamageType = type of damage
This event is called when a station is hit by a weapon. The event must return the number of hit points of damage to do to the station. For example, imagine a station that takes half damage from the player (but full damage from all others). The event could check aAttacker and return half of aDamageHP if it is the player and full aDamageHP otherwise.
The event should avoid affecting other objects and should not destroy the station (e.g., by calling objDestroy). If necessary, the event could return a very large number to insure that the station is destroyed.
<OnEnteredGate>
gSource = station object
aGateObj = gate object
Version 0.99 uses aGateObj instead of aGate (as in previous versions) to be consistent with <OnObjEnteredGate>.
<OnGlobalSystemCreated>
(no parameters)
This event is called after a system is created (right after <OnCreate> for the system). You may use this event to create new objects in the system or to otherwise alter the system. Remember that there is no guarantee that other systems have been created at this point.
Look at Huari.xml for an example of how this event is used.
<OnGlobalTopologyCreated>
(no parameters)
This event is called at the beginning of the game right after the complete system topology has been generated. You may use this event to explore the topology and add data to topology nodes that may later be used inside systems. Remember that no systems have been created yet. You can only call functions that work on topology nodes.
For an example of how this event is used, look at Huari.xml.