I thought I'd make another attempt at this levelchanger script.
While I no longer get that MFC error, I still can't get the .cls file to be created for 21level1.wmb.
The physics work but still fall through the floor because of the .cls not being present.

Here's what I have so far:

//////////////////////////////////////////////////////
ifdef USE_NEWTON_GAME_DYNAMICS;
string newtonLevel0_cls = <21level0.CLS>;
endif;

ifdef USE_NEWTON_GAME_DYNAMICS;
string newtonLevel1_cls = <21level1.CLS>;
endif;


/////////////////////////////////////////////////////
string 21level0_wmb = <21level0.wmb>;

action change_21level0
{
cross_pan.visible = OFF;
while (player == null) {wait (1);}
while (vec_dist (my.x, player.x) > 100) {wait (1);}
NewtonRemoveAllBodies ();
NewtonRemoveMap();
level_load(21level0_wmb);
wait(3);
ifdef USE_NEWTON_GAME_DYNAMICS;
wait(1);
dll_handle = newtonHandle;
NewtonAddMap (newtonLevel0_cls);
endif;

}


string 21level1_wmb = <21level1.wmb>;

action change_21level1
{
while (player == null) {wait (1);}
while (vec_dist (my.x, player.x) > 100) {wait (1);}
NewtonRemoveAllBodies ();
NewtonRemoveMap();
level_load(21level1_wmb);
wait(3);
ifdef USE_NEWTON_GAME_DYNAMICS;
wait(1);
dll_handle = newtonHandle;
NewtonAddMap (newtonLevel1_cls);
endif;

}

Any other ideas?

Last edited by Daedelus; 06/20/05 02:57.

Formula Games - A place to buy and sell Indie games.