ResetMap: Difference between revisions

155 bytes added ,  3 July 2022
no edit summary
(Created page with "{{Template:ACSWarning}} int '''ResetMap ''' (void) ==Usage== Resets the map like in Survival after a mission start or fail. Everything will be restored as it was when the ma...")
 
No edit summary
Tag: Source edit
Line 1: Line 1:
{{Template:ACSWarning}}
{{Template:ACSWarning}}
int '''ResetMap ''' (void)
bool '''ResetMap ''' (void)


==Usage==
== Usage ==
Resets the map, akin to [[Game Modes#Survival|Survival]] after a mission start or fail. Everything will be restored as it was when the map first started. The map will be reset after the tic ends, any commands stated immediately after ResetMap will be executed before the map actually is reset.


Resets the map like in Survival after a mission start or fail. Everything will be restored as it was when the map first started. The map will be reset after the tic ends, any commands stated immediately after ResetMap will be executed before the map actually is reset.
In order to use this function, the MapResets flag must be set for the gamemode in question. It is set by default in Survival, (T)LMS, Invasion and Duel. For other modes, including possession which actually does not do map resets, the flag must be set via the [[GAMEMODE]] lump. This is because storing the original state for actors uses additional memory on the server.
 
'''Note:''' In order to use this function, the MapResets flag must be set for the gamemode in question. It is set by default in Survival, (T)LMS, Invasion and Duel. For other modes, including possession which actually does not do map resets, the flag must be set via the GAMEMODE lump. This is because storing original stats for actors requires extra memory and CPU cycles from the server.


Example GAMEMODE lump:
Example GAMEMODE lump:
Line 16: Line 15:
</syntaxhighlight>
</syntaxhighlight>


==Examples==
=== Return value ===
Returns true if the map reset was requested successfully; otherwise returns false and prints a message to the server console.


== Examples ==
<syntaxhighlight lang="c" line="1">
<syntaxhighlight lang="c" line="1">
Script 5 DEATH
Script 5 DEATH
Line 27: Line 28:
</syntaxhighlight>
</syntaxhighlight>


 
[[category:ACS functions]]
[[category:ACS Functions]]