EVENT VALIDATESTART: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Added documentation
 
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{EventTable|1=EVENT_VALIDATESTART|2=[[myconnectindex]]|3=[[i|player->i]]|4=2 values}}
EVENT_VALIDATESTART is a [[EDuke32 event list|Misc Event]].
EVENT_VALIDATESTART is a [[EDuke32 event list|Misc Event]].


This [[event]] is executed on loading a savegame in ''Ion Fury'' that is incompatible with the currently running version.  
This [[event]] defines the originating ''Point of No Return'' (PONR) for a given [[definelevelname|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.


When running ''Ion Fury'', eduke32 allows the player to load outdated savegames (e.g. running different CON scripts) on the condition that the corresponding map is available. If this is the case, it will indicate that a "sequence point" is available, and when selecting the outdated save, the game starts the player at the beginning of the map, resetting all progress for that level. Player inventory is however preserved.  
[[EDuke32]] allows the player to load outdated savegames running a different version of the CON scripts if a ''sequence point'' (the <code>.esv.ext</code> 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 [[loadmapstate|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.
Usually, the player simply restarts on the map on which the outdated save was made, however, since certain maps allow seamless back-and-forth transitions, it becomes possible for the player to start inbetween. Not only does this lead to all monsters on both maps respawning, but it can also lead to softlocks if backtracking is required.  


To prevent these situations, '''EVENT_VALIDATESTART''' allows the savegame volume and level number to be changed when an outdated save is loaded.
To prevent these situations, '''EVENT_VALIDATESTART''' allows the savegame volume and level number to be changed when an outdated save is loaded.
[[RETURN|'userdef.return 0']] stores the savegame volume, and [[RETURN|'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.
[[RETURN|'userdef.return 0']] stores the savegame volume, and [[RETURN|'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 the other GRPs, this event is thus mainly useful for custom Ion Fury maps that include seamless map transitions.
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 ==
== Example ==
Line 20: Line 29:
     {
     {
         switch userdef .return 1
         switch userdef .return 1
             case 1 // 2
             case 1
                 setu .return 1 0 // 1
                 setu .return 1 0
                 break
                 break
             case 3 // 4
             case 3
             case 4 // 5
             case 4
                 setu .return 1 2 // 3
                 setu .return 1 2
                 break
                 break
         endswitch
         endswitch

Latest revision as of 19:28, 29 July 2025

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