level_load problems.......

Posted By: Neuro

level_load problems....... - 01/17/04 16:50

Heya folks. I been playing around with level_load and I notice that any code written under level_load is not executed. Where does the code execute from after the level is loaded and is there any way around this?
Posted By: JHunke

Re: level_load problems....... - 01/17/04 19:10

Neuro,

I have linked ten Levels now in my Game and all Actions work fine.

There is a Levelchange Code in AUM 28 including Weapon restore. You can include the Script into your main script and use it as a barebone.

Some Tips:

When designing your levels make sure they also have all Scripts included in their individual Script, including the Levelchange.wdl. Otherwise you are not able to assign Actions and test the Levelchange. Well at least I do it that way.

I use an invisible big sprite to attach the Levelchange action to it. When the Player collides with this Sprite Levelchange is executed.

Change the Scene map or Sky for the next Level before level_change. Otherwise you may see the map Scene flipped in the new Level right in the beginning. Doesnt look good.

Hope that helps...

JH
Posted By: qwerty823

Re: level_load problems....... - 01/18/04 01:55

I bet your code is something like this:

Code:


...
level_load(my_next_level);
wait(2); // Wait for level to load.
// Do some commands here.
...

Code:


And this code is either part of an event handler (my.event) or an entity action.
In either case, when you do a level load, all entities are destroyed and their actions stopped as soon as they hit their next wait instruction. For this it will be "right" after the level load.

What I ended up doing was making a seperate script that handled level loading, and just used a global variable to control the level to load. Im sure there are more then one way to do it, but this way worked for me.
Posted By: Neuro

Re: level_load problems....... - 01/18/04 04:14

Hey Qwerty,

Thats exactly what its doing....yah I figured out a way to work around it with globals. Thanks though!
© 2024 lite-C Forums