Loadmapstate: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
Helixhorned (talk | contribs) loadmapstate: Mention that startlevel+loadmapstate won't work. |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
'''loadmapstate''' restores the current map to the state it was in when the [[savemapstate]] command was last used in that map. | '''loadmapstate''' restores the current map to the state it was in when the [[savemapstate]] command was last used in that map. | ||
Thus, all the sprites will be in the positions they were in at that time, any sectors that were activated will still be activated. Per-player and per-actor variables will be restored to the values they had at that time unless they were declared with [[Gamevar|GAMEVAR_FLAG_NORESET]], etc. | |||
If there is no cached copy of the map (either because [[savemapstate]] was not used in the map or the state was cleared using [[clearmapstate]]) then '''loadmapstate''' does nothing. | |||
It is sensible to run '''loadmapstate''' from [[EVENT_ENTERLEVEL]] because running it after a [[startlevel]] command won't work as expected. |
Latest revision as of 11:22, 18 May 2013
loadmapstate restores the current map to the state it was in when the savemapstate command was last used in that map.
Thus, all the sprites will be in the positions they were in at that time, any sectors that were activated will still be activated. Per-player and per-actor variables will be restored to the values they had at that time unless they were declared with GAMEVAR_FLAG_NORESET, etc.
If there is no cached copy of the map (either because savemapstate was not used in the map or the state was cleared using clearmapstate) then loadmapstate does nothing.
It is sensible to run loadmapstate from EVENT_ENTERLEVEL because running it after a startlevel command won't work as expected.