level change crashed with video

Posted By: WINBERRY

level change crashed with video - 02/15/14 23:56

I have 3 levels which I can go back and forth pretty cleanly.
However, when I had a media_loop to show an *.avi" as a "drive in movie" screen, the level plays fine, I can even delete the video, but when I got to change levels, I crash. removing the video remove the crash. I am quite sure I am missing something about clearing memory, but I can't figure out what it is...and help would be greatly appreciated

thanks
Posted By: Superku

Re: level change crashed with video - 02/16/14 00:51

Quote:
I can even delete the video

What do you mean exactly?
What kind of crash do you get (precisely)?
Have you tried to use sys_marker() to locate the crash?
Posted By: WINBERRY

Re: level change crashed with video - 02/16/14 18:49

Thanks for responding!

I have 3 levels that I can go back and forth to via PUSH against an object with a "load_level" .

Each level initiates with an ENTITY*

action triggerLevel1()
{
while (!player) {wait (1);}

set (my, POLYGON); // use accurate collision detection
my.emask = ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_PUSH |ENABLE_SHOOT;
my.event = setupLevel1;
my.push = 1;
set(my,ENABLE_PUSH);

}

....and the ENTITY* goes to a SETUP function:

function setupLevel1()
{

if (you != player) {return;}

wait(1);
level_load("2014BO1.wmb");
wait(1);

}


I want to display a different video on each level
I am using a global:
ENTITY* myVIDEO1

function setupLevel1()
{

if (you != player) {return;}

wait(1);
level_load("2014BO1.wmb");
wait(1);
myVIDEO1 = media_loop(VID,bmap_for_entity(my,0),100);

}

...however, when I add the video (I can add and remove IMAGES& AUDIO with no problem)
It will crash when I PUSH THE ENTITY of the NEXT LEVEL

Also, I have never uses sys_Marker() as I hven't been able to figure it out

NOTE: my entie educaiton on level changing has come from 1 tutrial of the GameStudio Magazine, back in #28

thanks for any help you might have.
Posted By: Uhrwerk

Re: level change crashed with video - 02/16/14 20:50

You're attempting to play a video on the surface of an entity that no longer exists. When you call level_load the entity execution setupLevel1 gets removed. Hence executing bmap_for_entity(my,0) one frame later will crash.

Please use code tags when posting code.
Posted By: WINBERRY

Re: level change crashed with video - 02/17/14 16:09

Got it working...thanks for the help!
© 2024 lite-C Forums