level_load (STRING* filename);
creates an empty level or
loads a new level based on a level map (WMB), terrain (HMP)
or model (MDL).
STRING* or char*; name of the map, model, or
or NULL for an empty level.
- The current level is closed, the cache holding level
entity files is purged. All current entities in the old level are
thus all entity pointers referring
be used anymore.
For preventing an entity file from being purged at level change - which could make sense for speeding up level loading - define it as a
Functions assigned to
or called by
entities - that means all functions in which
the my pointer
is not zero - are automatically terminated at their next wait call.
All other functions in which my is zero, such as the main() function,
will keep running and won't change,
even if a different script was assigned in WED to the new level.
- A7 During the load process, the on_level event can be used to display
a progress bar or animation on a panel.
One frame after level loading the last_error variable indicates
The preload_mode variable determines whether level entities, meshes and textures are already created at load time. Level loading is slower in this case, but delays when entities become visible are avoided.
If the level requires no physics and collision detection, setting enable_polycollision to 0 before level_load will speed up loading and entity creation.
level_load("newlevel.wmb"); // load level newlevel.wmb
level_mark, level_loadendless, level_ent,