modding:xml:events
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
modding:xml:events [2012/05/24 07:58] – star_weaver | modding:xml:events [2014/12/27 04:40] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====Pages that List Events===== | ||
+ | * [[SpaceObject# | ||
+ | * [[DesignType# | ||
+ | |||
+ | =====Unclassified===== | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | Found inside //< | ||
+ | |||
+ | ====< | ||
+ | Found inside //< | ||
+ | |||
+ | |||
+ | ====< | ||
+ | When a communication menu messages is shown. | ||
+ | |||
+ | |||
+ | =====Item Events===== | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * 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 //< | ||
+ | Use this event sparingly because it will impact performance. | ||
+ | |||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * 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. | ||
+ | |||
+ | ====< | ||
+ | |||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * gSource: object that we're installing on | ||
+ | * gItem: item being installed | ||
+ | |||
+ | You can return '' | ||
+ | Or you can return a string, which is the message that will be shown to the user to tell them why the item cannot be installed. | ||
+ | |||
+ | < | ||
+ | |||
+ | ====< | ||
+ | **Populated variables: | ||
+ | * gSource: object that we're uninstalling from | ||
+ | * gItem: item being uninstalled | ||
+ | |||
+ | You can return '' | ||
+ | Or you can return a string, which is the message that will be shown to the user to tell them why the item cannot be uninstalled. | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====< | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====< | ||
+ | |||
+ | |||
+ | ====< | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | For ships, when all queued orders are completed | ||
+ | |||
+ | ====< | ||
+ | In 1.07: \\ | ||
+ | aGateObj: The gate that was entered \\ | ||
+ | aDestNodeID: | ||
+ | aDestEntryPoint: | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | |||
+ | ====< | ||
+ | |||
+ | |||
+ | =====Events and script===== | ||
+ | Some events are very particular about where they can be called from and what kind of functions can be run in them. | ||
+ | The < | ||
+ | |||
+ | There are a number of functions that are used in cunjuction with events such as: | ||
+ | |||
+ | <code lisp> | ||
+ | (sysAddObjRecurringTimerEvent) | ||
+ | ;; will fire a specific event every n ticks until (sysCancelTimerEvent) is called | ||
+ | |||
+ | (sysAddObjTimerEvent) | ||
+ | ;; will fire a specific event after a delay only once | ||
+ | |||
+ | (sysCancelTimerEvent) | ||
+ | ;; will cancel a timer event (obviously!) | ||
+ | |||
+ | (objFireEvent) | ||
+ | ;; will fire a specific event immediately | ||
+ | |||
+ | (objFireItemEvent) | ||
+ | ;; will fire a specific event that is contained in an item immediately | ||
+ | |||
+ | (objRegisterForEvents) | ||
+ | ;; creates a relationship between two objects so they can use eachother in events | ||
+ | ;; Some events can only be called once they have been registered such as < | ||
+ | |||
+ | (objUnregisterForEvents) | ||
+ | ;; cancels the relationship between objects | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | You are not limited to these events, you can create any event you wish but it must be called from a function that you define. | ||
+ | |||
+ | |||
+ | <code lisp> | ||
+ | < | ||
+ | < | ||
+ | (block Nil | ||
+ | (itmEnumTypes " | ||
+ | (block | ||
+ | (itmSetKnown itemType) | ||
+ | (itmSetReference itemType) | ||
+ | ) | ||
+ | ) | ||
+ | ) | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | This little fella here is a great event to add to a ship that you use for debugging your mods. It will fire the even < | ||
+ | |||
+ | |||
+ | <code lisp> | ||
+ | < | ||
+ | < | ||
+ | (block Nil | ||
+ | (plyMessage gPlayer "You haven' | ||
+ | (sysAddObjTimerEvent 100 gSource " | ||
+ | ) | ||
+ | </ | ||
+ | < | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | The < | ||
+ | |||
+ | ====Old Lede===== | ||
+ | Events are a powerful way to create behaviour in ships and stations. | ||
+ | |||
+ | ===Events=== | ||
+ | |||
+ | The following info is taken from the OTF, here -> http:// | ||
+ | |||
+ | Check also what George wrote on events on the Tags section of the wiki: http:// | ||
+ | ===== Notes ===== | ||
+ | < | ||
+ | Found in BattleArena.xml, |