EVENT VALIDATESTART
Event ID | player# | THISACTOR | RETURN | |
---|---|---|---|---|
EVENT_VALIDATESTART | myconnectindex | player->i | 2 values |
EVENT_VALIDATESTART is a Misc Event.
This event defines the originating Point of No Return (PONR) for a given map slot when loading a savegame that is incompatible with the currently running version. By default this is the beginning of the current map, but this event can be used to return the player to an earlier slot.
EDuke32 allows the player to load outdated savegames running a different version of the CON scripts if a sequence point (the .esv.ext
file) is available for that save, such as when playing Ion Fury. The game will reset all progress for that level and start the player at the beginning of the map, while maintaining their inventory. However, Ion Fury uses individual map files as pieces of a larger zone that allow seamless back-and-forth transitions. If the game world was reinitialized in this way starting from a section in the middle, any previous maps in the zone will also default to their unplayed state should the player choose to backtrack. This will lead to resurrected enemies, locked doors, and potentially softlocks.
To prevent these situations, EVENT_VALIDATESTART allows the savegame volume and level number to be changed when an outdated save is loaded. 'userdef.return 0' stores the savegame volume, and 'userdef.return 1' stores the savegame level. You can set these values to the desired restart map for sequence point loads, see the example below.
Since the sequence point system is currently not used for other games supported by EDuke32, this event is thus mainly useful for custom Ion Fury maps that include seamless map transitions.
Return Values
- userdef.return 0 (RETURN)
- Stores the episode number of the savegame.
- userdef.return 1
- Stores the level number of the savegame.
Example
This example is taken from Ion Fury's preview episode. Level 1 is reached from a seamless transition over a vent, hence the level is set back to 0 for invalidated save loads, to prevent the player from starting inbetween transitions.
// Code by Jonathan Strander, Fox Martins, Richard Gobeille, and Evan Ramos // All code as written belongs to Voidpoint and the respective authors. // (c) 2019 Voidpoint, LLC appendevent EVENT_VALIDATESTART ife userdef .return 0 EP_PREVIEW { switch userdef .return 1 case 1 setu .return 1 0 break case 3 case 4 setu .return 1 2 break endswitch } endevent