Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 16,232 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Almost done #371665
05/24/11 04:36
05/24/11 04:36
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Well I stayed up last night reading through the Online Manual and I have sorted a lot of stuff out, the pragma_path still wont work but oh well.

I have improved the control system a lot! its much smoother than it was the only thing I have to do now is animate the model but it doesn't have a bone structure and I tried to use the manual but mine never turns out like that so could someone be kind and create a skeleton structure for the model if I upload it?

Also I have a .wmv file I want to play on startup, it plays but I would also like it so when you press enter it stops the movie and returns to the game I have in function main()
Code:
var mhandle = media_play("intro.avi",NULL,100);


I have a seperate script for my player controls so what would I have to do in order to make ENTER stop the video? I tried

Code:
function movie_control()
{
if (key_i)
{
media_stop(mhandle);
}
}



but that didnt work.

Last edited by JakeBilbe; 05/24/11 07:04.
Re: Almost done [Re: JakeBilbe] #371672
05/24/11 07:40
05/24/11 07:40
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Well, I thnik you forgot to loop movie_control. It only checks 1 frame if i is pressed and then stops. Put a while(!key_i) around it.


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: Almost done [Re: Liamissimo] #371675
05/24/11 08:16
05/24/11 08:16
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Okay since then I have changed it a little bit, here is the new code:

Code:
function main()
{
	//video_screen = 1; //fullscreen
   
   video_mode = 7; //activate 800x600 screen resolution
	sound_vol = 100; //set the sound at full volume
	level_load("level.hmp"); //before we can create level entities, a level must be loaded
	set (pIntro, VISIBLE); //black canvas
	wait(-1); //wait a second
	ent_create("character.mdl",vector(25,55,45),main_player); //create the player
	var mhandle = media_play("intro.avi",NULL,100);
	wait(-11.3);
	var mvertical = media_loop("vertical_leap.avi",NULL,100);
	pan_remove(pIntro);
}



so basically a movie plays that says like created by and such then a movie of clouds and the game name loops with a flashing "press enter" so I am guessing in the main.c above function main I write:

Code:
function movie_control()
{
while (key_i)
{
media_stop(mhandle);
}
}


sorry for the stupid questions I am just starting to pick things up.

Re: Almost done [Re: JakeBilbe] #371679
05/24/11 09:27
05/24/11 09:27
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
Code:
function movie_control()
{
   while (1)
   {
      if (key_i) media_stop(mhandle);
   }
}


or as TheLiam says:
while (!key_i)
Read the code exactly, don`t forget the "!", it means it doing the loop while i is NOT pressed (key_i = 0).
But with this code the function stops if you press i once, my example works all the time....

Your code:
while (key_i)
checks the first frame if you call this function if key i is pressed and if not the function is finishing...

Last edited by Widi; 05/24/11 09:37.
Re: Almost done [Re: Widi] #371680
05/24/11 09:32
05/24/11 09:32
Joined: Apr 2009
Posts: 81
J
JakeBilbe Offline OP
Junior Member
JakeBilbe  Offline OP
Junior Member
J

Joined: Apr 2009
Posts: 81
Hmm I put it above function main() and I get error undeclared identifier?

Re: Almost done [Re: JakeBilbe] #371944
05/26/11 18:41
05/26/11 18:41
Joined: May 2009
Posts: 439
T
TerraSame Offline
Senior Member
TerraSame  Offline
Senior Member
T

Joined: May 2009
Posts: 439
Maybe try this...
It's a little messy but it works and it allows the user to skip the intro movie if they want...
And, after playing the game a few times the user will want to skip the intro...
Good luck...

Put this function above the main...

var avihandle;
function play_movie()
{
avihandle = media_play ("Movies/Your_Movie.wmv", NULL, 80);
while (media_playing (avihandle) != 0)
{
if (key_any != 0) // enable interrupting the intro by any key (recommend!)
{
media_stop (avihandle);
}
wait(1);
}

}

then put this in the main...

wait(1);
avihandle = media_play ("Your_Movie.wmv", NULL, 80);
wait(1);

while(mouse_left) { wait(1); } // check to see if mouse was not being held (so you cant skip the intro movie on accident)

enable_key = OFF;
enable_mouse = OFF;
enable_joystick = OFF;
while (media_playing (avihandle) != 0)
{
if (key_any != 0) // enable interrupting the intro by any key (recommend!)
{
media_stop (avihandle);
}
wait(1);
}
enable_key = ON;
enable_mouse = ON;
enable_joystick = ON;


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