Skip to content

Field manual / Level editor

level — Level

Level: loading, the level counter (progress), the walk map, floors, global strings.

Summary

level::GetNameThe current level's name ("05_laboratory"), for hooks.
level::LoadQueues a transition to the given level.
level::LoadAfterBattleSame as level::Load, but the new level then receives AfterBattle(name of the previous level), as after a battle.
level::IncAdvVarAdds 1 to the level's progress counter (progress of the level object, saved with it).
level::DecAdvVarSubtracts 1 from the level's progress counter (progress).
level::GetAdvVarReturns the level's progress counter (progress), 0 if there is no level object.
level::SetAdvVarSets the level's progress counter (progress).
level::SetGlobalStringDoes nothing in the port: the game's scenes read only #HERO_SELECTED and #LAST_ACTION_HERO, and these come from the world state.
level::ForbidWalkCloses walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2).
level::AllowWalkOpens walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2).
level::TestFloorChangeHeroes standing in the zone move to floor 0 (.wm) or 1 (.wm2).

Functions

level::GetName() → string

OpenGorky onlyClassic: GetLevel

The current level's name ("05_laboratory"), for hooks.

level::Load(level) → int

Classic: LEVEL_Load

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

Classic: LEVEL_LoadAB

Same as level::Load, but the new level then receives AfterBattle(name of the previous level), as after a battle.

level::IncAdvVar() → int

Classic: LEVEL_IncAdvVar

Adds 1 to the level's progress counter (progress of the level object, saved with it).

level::DecAdvVar() → int

Classic: LEVEL_DecAdvVar

Subtracts 1 from the level's progress counter (progress).

level::GetAdvVar() → int

Classic: LEVEL_GetAdvVar

Returns the level's progress counter (progress), 0 if there is no level object.

level::SetAdvVar(int) → int

Classic: LEVEL_SetAdvVar

Sets the level's progress counter (progress).

level::SetGlobalString(string, string) → int

Classic: SetGlobalStringVariable

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

Classic: ForbidWalkInArea

Closes walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2).

level::AllowWalk(string, ?int) → int

Classic: AllowWalkInArea

Opens walk map cells inside the zone's polygon on floor 0 (.wm) or 1 (.wm2).

level::TestFloorChange(string, int) → int

Classic: TestActorMapChange

Heroes standing in the zone move to floor 0 (.wm) or 1 (.wm2). Called from the level's update() every tick.