Field manual / Level editor
level — Level
Level: loading, the level counter (progress), the walk map, floors, global strings.
Summary
level::GetName | The current level's name ("05_laboratory"), for hooks. |
level::Load | Queues a transition to the given level. |
level::LoadAfterBattle | Same as level::Load, but the new level then receives AfterBattle(name of the previous level), as after a battle. |
level::IncAdvVar | Adds 1 to the level's progress counter (progress of the level object, saved with it). |
level::DecAdvVar | Subtracts 1 from the level's progress counter (progress). |
level::GetAdvVar | Returns the level's progress counter (progress), 0 if there is no level object. |
level::SetAdvVar | Sets the level's progress counter (progress). |
level::SetGlobalString | Does nothing in the port: the game's scenes read only #HERO_SELECTED and #LAST_ACTION_HERO, and these come from the world state. |
level::ForbidWalk | Closes walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2). |
level::AllowWalk | Opens walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2). |
level::TestFloorChange | Heroes standing in the zone move to floor 0 (.wm) or 1 (.wm2). |
Functions
level::GetName() → string
The current level's name ("05_laboratory"), for hooks.
level::Load(level) → int
Queues a transition to the given level. Some subsequent calls within the same script invocation (scene::FadeIn, hero::PlaceAll, hero::DisableOthers) are deferred and take effect on the new level.
level::LoadAfterBattle(level) → int
Same as level::Load, but the new level then receives AfterBattle(name of the previous level), as after a battle.
level::IncAdvVar() → int
Adds 1 to the level's progress counter (progress of the level object, saved with it).
level::DecAdvVar() → int
Subtracts 1 from the level's progress counter (progress).
level::GetAdvVar() → int
Returns the level's progress counter (progress), 0 if there is no level object.
level::SetAdvVar(int) → int
Sets the level's progress counter (progress).
level::SetGlobalString(string, string) → int
Does nothing in the port: the game's scenes read only #HERO_SELECTED and #LAST_ACTION_HERO, and these come from the world state.
level::ForbidWalk(string, ?int) → int
Closes walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2).
level::AllowWalk(string, ?int) → int
Opens walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2).
level::TestFloorChange(string, int) → int
Heroes standing in the zone move to floor 0 (.wm) or 1 (.wm2). Called from the level's update() every tick.