Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |
modding:xml:missiontype [2017/01/31 22:51] – [Options] added forceUndockAfterDebrief and noDecline xephyr | modding:xml:missiontype [2017/02/07 01:26] (current) – [Mission Lifecycle] 0xabcdef |
---|
| |
==== Mission Lifecycle ==== | ==== Mission Lifecycle ==== |
To create a mission, the developer should call [[modding:function:msncreate|msnCreate]] with the UNID of the MissionType to create and the owner object. Missions are generally associated with an //owner// object (such as a station) which gives the mission and the reward on completion. When created, the OnCreate event is called on the MissionType. The event should gather all the information necessary to describe the mission (for example, it may pick a target for the mission) and store information as data in the mission object. If for some reason, the mission cannot be created (e.g., imagine that a proper target could not be found), the code should call msnDestroy inside of OnCreate. You may also register notification events with functions such as [[modding:function:msnRegisterForEvents]] and [[modding:function:msnAddRecurringTimerEvent]]. | To create a mission, the developer should call [[modding:function:msncreate|msnCreate]] with the UNID of the MissionType to create and the owner object. Missions are generally associated with an //owner// object (such as a station) which gives the mission and the reward on completion. When created, the OnCreate event is called on the MissionType. The event should gather all the information necessary to describe the mission (for example, it may pick a target for the mission) and store information as data in the mission object. If for some reason, the mission cannot be created (e.g., imagine that a proper target could not be found), the code should call msnDestroy inside of OnCreate. You may also register notification events with functions such as [[modding:function:msnRegisterForEvents]], [[modding:function:msnAddTimerEvent]], and [[modding:function:msnAddRecurringTimerEvent]]. These functions work on any mission, even on those that are already completed. |
| |
When first created, a mission is //open//. An open mission is a mission that has been defined (e.g., a target has been chosen) and is available for the player to accept. You may obtain a list of open mission with the [[modding:function:msnFind]] function. For example: | When first created, a mission is //open//. An open mission is a mission that has been defined (e.g., a target has been chosen) and is available for the player to accept. You may obtain a list of open mission with the [[modding:function:msnFind]] function. For example: |