Gamestudio Links
Zorro Links
Newest Posts
FXCM demo test failed
by qin. 01/13/26 02:32
Camera always moves upwards?
by NeoDumont. 01/12/26 09:39
Alpaca Plugin v1.5.2 Release
by kzhao. 01/11/26 13:42
Alpaca Plugin v1.4.0
by kzhao. 01/11/26 13:38
separating groups of 3 digits by a comma
by joe_kane. 01/11/26 00:01
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (qin), 3,155 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
promfast, joe_kane, Namitha_NN, Syndrela, agasior
19190 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 | 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