1 registered members (TipmyPip),
18,619
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Almost done
#371665
05/24/11 04:36
05/24/11 04:36
|
Joined: Apr 2009
Posts: 81
JakeBilbe
OP
Junior Member
|
OP
Junior Member
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()
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
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
Liamissimo
Serious User
|
Serious User
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
JakeBilbe
OP
Junior Member
|
OP
Junior Member
Joined: Apr 2009
Posts: 81
|
Okay since then I have changed it a little bit, here is the new 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:
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
Serious User
|
Serious User
Joined: Aug 2007
Posts: 1,922
Schweiz
|
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.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|