2 registered members (AndrewAMD, VoroneTZ),
1,258
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Video Cut Scene
[Re: mschoenhals]
#452056
06/01/15 13:48
06/01/15 13:48
|
Malice
Unregistered
|
Malice
Unregistered
|
here you go
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////
function main()
{
vec_set(screen_size,vector(800,400,0));
vec_set(screen_color,vector(50,1,1)); // dark blue
vec_set(sky_color,vector(50,1,1)); // dark blue
video_window(NULL,NULL,0,"My New Game");
d3d_antialias = 1;
shadow_stencil = 3;
/////////////////////////////
// Video section
var vid_handle=0; // create a local var to hold the media handle
vid_handle=media_play("this_vid.wmv",NULL, 75); //play media and set var
// loop only while var is valid
while(vid_handle)
{
if(key_any) // check if any key was pressed
media_stop(vid_handle); // stop vid
wait(1); // required wait avoids endless looping
}
///////////////////////////////////
// level_load("my_level.wmb");
// vec_set(camera.x,vector(-250,0,50));
// vec_set(camera.pan,vector(0,-15,0));
}
Note about videos, http://www.conitec.net/beta/amedia_play.htm If I recall you may need to use a VFW format. OR maybe that was just a Virtual Dub requirement
Last edited by Malice; 06/01/15 13:55.
|
|
|
Re: Video Cut Scene
[Re: mschoenhals]
#452196
06/05/15 23:19
06/05/15 23:19
|
Malice
Unregistered
|
Malice
Unregistered
|
does the camera see only sky? with this script it will be at level0,0,0 looking at level_pan 0,0,0
Btw level_load should be after the media instruction stops.. SEE Rayp above
Last edited by Malice; 06/05/15 23:21.
|
|
|
Re: Video Cut Scene
[Re: mschoenhals]
#452198
06/06/15 01:04
06/06/15 01:04
|
Malice
Unregistered
|
Malice
Unregistered
|
post you code using the code tag please(found under full reply button)
also the engine isn't throwing a error so the level is loaded, check the camera focus target
vec_set(camera.x,vector(0,0,50)); vec_set(camera.pan, vector(0,-25,0));
Last edited by Malice; 06/06/15 01:07.
|
|
|
Re: Video Cut Scene
[Re: ]
#452207
06/06/15 15:29
06/06/15 15:29
|
Joined: Aug 2013
Posts: 101
mschoenhals
OP
Member
|
OP
Member
Joined: Aug 2013
Posts: 101
|
I do believe the level is loading and it does indeed have something to do with my camera. I thought I was defining the proper camera at the bottom of the function. Is that incorrect?
function main()
{
vec_set(screen_size,vector(800,400,0));
vec_set(screen_color,vector(50,1,1)); // dark blue
vec_set(sky_color,vector(50,1,1)); // dark blue
video_window(NULL,NULL,0,"My New Game");
d3d_antialias = 1;
shadow_stencil = 3;
/////////////////////////////
// Video section
var vid_handle=0; // create a local var to hold the media handle
vid_handle=media_play("testvid.wmv",NULL, 75); //play media and set var
// loop only while var is valid
while(vid_handle)
{
if(key_any) // check if any key was pressed
media_stop(vid_handle); // stop vid
wait(1); // required wait avoids endless looping
}
///////////////////////////////////
camera.ambient = 100;
camera.arc = 90; // set camera.arc to a proper value for shooter games
fps_max = 75; // limit the frame rate to 75 fps (not really needed)
video_screen = 1; // start the game in full screen mode
video_mode = 8; // run at a 1024x768 pixels resolution on monitors with a 4/3 aspect ratio
level_load ("shooter.wmb");
wait (3);
media_loop("action.mp3", NULL, 70); // start the soundtrack
}
|
|
|
Re: Video Cut Scene
[Re: mschoenhals]
#452232
06/07/15 11:16
06/07/15 11:16
|
Malice
Unregistered
|
Malice
Unregistered
|
unction main()
{
vec_set(screen_size,vector(800,400,0));
vec_set(screen_color,vector(50,1,1)); // dark blue
vec_set(sky_color,vector(50,1,1)); // dark blue
video_window(NULL,NULL,0,"My New Game");
d3d_antialias = 1;
shadow_stencil = 3;
/////////////////////////////
// Video section
var vid_handle=0; // create a local var to hold the media handle
vid_handle=media_play("testvid.wmv",NULL, 75); //play media and set var
// loop only while var is valid
while(vid_handle)
{
if(key_any) // check if any key was pressed
media_stop(vid_handle); // stop vid
wait(1); // required wait avoids endless looping
}
///////////////////////////////////
//camera.ambient = 100;
camera.arc = 90; // set camera.arc to a proper value for shooter games
fps_max = 75; // limit the frame rate to 75 fps (not really needed)
video_screen = 1; // start the game in full screen mode
video_mode = 8; // run at a 1024x768 pixels resolution on monitors with a 4/3 aspect ratio
level_load ("shooter.wmb");
vec_set(camera.x,vector(-250,0,50)); //back X250 up z50
vec_set(camera.pan,vector(0,-15,0)); // TILTed down 15*
wait (3);
media_loop("action.mp3", NULL, 70); // start the soundtrack
}
try that and see if you can see the level. Normally if you have a game the camera is attached to the player. So if you like you can move to creating a simple walking player then attaching a camera becomes a integrated part of player code and player creation. function cam_era() { // for fps game while(1) { vec_set(camera.x,my.x);// MY is the player ent vec_set(camera.pan,my.pan) // Look where the player looks wait(1); } }
action ent_player() { cam_era(); while(1) { my.skill1 = ((key_w-key_s)*10)*time_step; // give a movement value my.pan-=((key_a-key_d)*10)*time_step; // give turning c_move(my,my.skill1,nullvector,GLIDE); // move using skill1-skill3 as a vector of speed. wait(1); } }
Last edited by Malice; 06/07/15 11:34.
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|