Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 1,405 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Skip Intro with a key? #320001
04/19/10 12:22
04/19/10 12:22
Joined: Jan 2004
Posts: 60
D
Deha Offline OP
Junior Member
Deha  Offline OP
Junior Member
D

Joined: Jan 2004
Posts: 60
Hi everyone!

i have a problem with skipping a intro movie-file.
i want to skip my intro with a special key like spacebar or something else, but i don't know how.Is there a skip function in 3dgs? I could not find something in the manual.

"media_stop" would only stop my media but not skip i think..so any idea?

the function have to look like something like this i think:

if ((key_space) && spacebar_clear)
{
...(?)
}

[Sorry for my english]

Greetings

Re: Skip Intro with a key? [Re: Deha] #320007
04/19/10 12:41
04/19/10 12:41
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Well, I guess while you are playing your video, you have a loop like this:

while(media_playing(yourhandle)) wait(1);

If you use media_stop, it should also cancel your loop.

Re: Skip Intro with a key? [Re: Lukas] #320043
04/19/10 14:16
04/19/10 14:16
Joined: Jan 2004
Posts: 60
D
Deha Offline OP
Junior Member
Deha  Offline OP
Junior Member
D

Joined: Jan 2004
Posts: 60
My function(short form)

var x

function start_program()
{ mouse_mode = 0;
wait(1);
freeze_mode = 1;
media_play("intro.wmv",NULL,100);
wait(999);
wait(999);
wait(999);
wait(999);
wait(999);
wait(999);
wait(999);
wait(999);
wait(39);
media_stop(x);
freeze_mode = 0;
set(loadingscreen_panel, SHOW);
...
}

I know it is not a really clean programming code, but it works! laugh
Where do i have to paste the 'if (key_space) then media_stop'?
After media_play? need help please...:(

Re: Skip Intro with a key? [Re: Deha] #320044
04/19/10 14:19
04/19/10 14:19
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
OMFG...

Replace all that wait(999) lines by the loop I posted above.

Also, note that those wait(999) are waiting a number of frames, not a given time, which means it can continue before the video is finished or continue too late.

Re: Skip Intro with a key? [Re: Lukas] #320047
04/19/10 14:41
04/19/10 14:41
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
Originally Posted By: Lukas
Well, I guess while you are playing your video, you have a loop like this:

while(media_playing(yourhandle)) wait(1);

If you use media_stop, it should also cancel your loop.
how does that exactly skip or stop anything using spacebar?

try something like
Code:
void game_start(){
   
}

void game_intro(){
  
  var hnd_intro = media_play("intro.wmv",NULL,100);
  while(media_playing(hnd_intro) && (!key_space)){
    wait(1);
  }
  game_start();
}

void main(){
  //...blah
  wait(1);
  game_intro();
}

hope this helps

*untested*

Re: Skip Intro with a key? [Re: MrGuest] #320048
04/19/10 14:45
04/19/10 14:45
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
"how does that exactly skip or stop anything using spacebar?"

If he uses an other function that calls media_stop, media_playing(yourhandle) becomes zero and the loop stops. wink


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1