Hi Daedelus, you dont understand my germlish, so I try to explain it
with code...
//===============================================
string level_str = <testlevel.wmb>;
string level_str_2 = <testlevel_2.wmb>;
string newtonLevel_cls = <testlevel.cls>;
string newtonLevel_cls_2 = <testlevel_2.cls>;
var impact_active = 0; // youīll need this variable to check the event - call
// Hereīs my main():
function main()
{
freeze_mode = 1;
warn_level = 2;
wait(3);
level_load(level_str);
wait(1);
dll_handle = newtonHandle;
NewtonAddMap (level_str, splashscreen);
wait(3);
freeze_mode = 0;
mouse_mode = 1;
mouse_pointer = 1;
mouse_range = 1000;
levelchange(); // The levelchange must be called in main()
while(1)
{
mouse_pos.x = POINTER.x;
mouse_pos.y = POINTER.y;
wait(1);
}
}
//=========================
//Here is the action of my levelchange entity:
action impact_test
{
while(player == null){wait(1);}
my.enable_impact = on;
my.event = impact_event;
}
//=========================
//On impact, this event is called:
function impact_event
{
if(impact_active == 1){return;} // is the value of the variable "one" ? Then return.
impact_active = 1; // if not, then now the value is "one".
}
//============================
//The levelchange function checks the value
//of the variable:
function levelchange
{
while(impact_active == 0){wait(1);} // Here itīs checking, after that begins the level load
sleep(3);
freeze_mode = 1;
warn_level = 2;
wait(5);
level_load(level_str_2);
wait(3);
dll_handle = newtonHandle;
NewtonAddMap (level_str_2, splashscreen);
wait(5);
freeze_mode = 0;
mouse_mode = 1;
mouse_pointer = 1;
mouse_range = 1000;
}
//===================================
So you donīt call the function directly with the event.
You use a variable as "switch" to turn the levelchange
function "on".
Youīve to call your levelchange function at gamestart
and itīll wait until the variable is set to 1.
greets, fogman