Missions and Events
Naev missions and events are written in the Lua Programming Language. In particular, they use version 5.1 of the Lua programming language. While both missions and events share most of the same API, they differ in the following ways:
- Missions: Always visible to the player in the info window.
The player can also abort them at any time.
Missions are saved by default.
Have exclusive access to the
misnlibrary and are found indat/missions/. - Events: Not visible or shown to the player in any way, however, their consequences can be seen by the player.
By default, they are not saved to the player savefile.
If you want the event to be saved you have to explicitly do it with
evt.save(). Have exclusive access to theevtlibrary and are found indat/events/.
The general rule of thumb when choosing which to make is that if you want the player to have control, use a mission, otherwise use an event.
Example missions include cargo deliveries, system patrols, etc.
On the other hand, most events are related to game internals and cutscenes such as the save game updater event (dat/events/updater.lua) or news generator event (dat/events/news.lua).
A full overview of the Naev Lua API can be found at naev.org/api and is out of the scope of this document.
Mission Guidelines
This following section deals with guidelines for getting missions included into the official Naev repository. These are rough guidelines and do not necessarily have to be followed exactly. Exceptions can be made depending on the context.
- Avoid stating what the player is feeling or making choices for them. The player should be in control of themselves.
- There should be no penalties for aborting missions. Let the player abort/fail and try again.