UpdateMapEngine
From Spheriki
Updates the state of the map engine.
Contents |
Usage
Examples
var done = false;
var fps = GetMapEngineFrameRate();
var updates_performed = 0;
var start_time = GetTime();
while (!done)
{
while (updates_performed < (GetTime() - start_time) * 0.001 * fps)
{
UpdateMapEngine();
// Your processing here
// ...
updates_performed++;
}
RenderMap();
FlipScreen();
}
If your script logic inextricably binds itself to blocking logic (i.e. continuously loops until it returns to the map engine), you can still simulate the running of the map engine using the logic above.
Notes
- This function updates things such as entities, person queues, color masks, tile animations, delayed scripts, and so on. It will only work while the map engine is running.
- Triggers and zones will still activate and be processed. In older versions of Sphere, calling this function inside a person script would cause the Sphere engine crash due to recursive event triggering. Be sure to run the latest version of Sphere.
- To draw the current state of the map engine to the screen, use RenderMap().