|
Resident Evil Camera
#176793
01/06/08 21:44
01/06/08 21:44
|
Joined: Jun 2007
Posts: 63 Italy
Sonic220
OP
Junior Member
|
OP
Junior Member
Joined: Jun 2007
Posts: 63
Italy
|
Hi, I want to learn how to create cameras like resident evil game. I've found a real intresting code in the AUM 42 ( link ) I've donwloaded the file from there and copy - paste the file from the advcamera folder to gamestudio/work folder. The problem is: I don't know what script i have to include, cause the action player_prog is missing. I've also tryed to create my action Code:
action pg { my = player; while(my){ if (key_cul == on) // press and hold the "Up" arrow key to move { my.pan -= 3*time_step; ent_animate(my, "walk", 5, anm_cycle); // animate the model (use "walk")
} if (key_cur == on) // press and hold the "Down" arrow key { my.pan += 3*time_step; ent_animate(my, "walk", 5, anm_cycle); // animate the model (use "walk")
} if (key_cuu == on) // press and hold the "Down" arrow key { c_move (my, vector(5, 0, 0), nullvector, glide); ent_animate(my, "walk", 5, anm_cycle); // animate the model (use "walk") } if (key_cud == on) // press and hold the "Down" arrow key { c_move (my, vector(-5, 0, 0), nullvector, glide); ent_animate(my, "walk", 5, anm_cycle); // animate the model (use "walk") } } } But it doesnt work, the player stay there and doesn't move. Someone can help me?
~Vision Divine~
|
|
|
Re: Resident Evil Camera
[Re: Sonic220]
#176794
01/07/08 01:32
01/07/08 01:32
|
Joined: Nov 2007
Posts: 1,143 United Kingdom
DJBMASTER
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,143
United Kingdom
|
Here are your errors>>>
1) your setting my=player; >>> should be player=my; 2) To turn left >>> my.pan += 3*time_step; 3) To turn right >>> my.pan -= 3*time_step; 4) You need to place a wait(1); after the 3rd from last curly bracket.
And make sure you have attached the action to the player entity in WED.
Last edited by DJBMASTER; 01/07/08 01:44.
|
|
|
Re: Resident Evil Camera
[Re: DJBMASTER]
#176795
01/08/08 22:41
01/08/08 22:41
|
Joined: Jun 2007
Posts: 63 Italy
Sonic220
OP
Junior Member
|
OP
Junior Member
Joined: Jun 2007
Posts: 63
Italy
|
the player move (there is also some problem with the animation that i will try to fix later) But there is a problem, the camera doesn't change. the code in now this: Code:
view adv_camera{}
////////////////////////////////////////////////////////////////////////////////////////////
define cam_number skill1; // use different numbers for every model define cam_range skill2; // sets the detection area (sensitivity)
//////////////////////////////////////////////////////////////////////////////////////////// function main() { level_load ("office.wmb"); }
function set_camera(number);
//////////////////////////////////////////////////////////////////////////////////////////// action pg { player = my; while(my){ if (key_cul == on) // press and hold the "Up" arrow key to move { my.pan -= 3*time_step; ent_animate(my, "walk", 1, anm_cycle); // animate the model (use "walk")
} if (key_cur == on) // press and hold the "Down" arrow key { my.pan += 3*time_step; ent_animate(my, "walk", 1, anm_cycle); // animate the model (use "walk")
} if (key_cuu == on) // press and hold the "Down" arrow key { c_move (my, vector(1, 0, 0), nullvector, glide); ent_animate(my, "walk", 9*time_step, anm_cycle); // animate the model (use "walk") } if (key_cud == on) // press and hold the "Down" arrow key { c_move (my, vector(-1, 0, 0), nullvector, glide); ent_animate(my, "walk", 1*time, anm_cycle); // animate the model (use "walk") } wait(1); } }
starter init_cameras() { sleep (0.5); // wait until the level is loaded camera.visible = off; // disable the default "camera" view adv_camera.pos_x = 0; adv_camera.pos_y = 0; adv_camera.size_x = screen_size.x; adv_camera.size_y = screen_size.y; adv_camera.visible = on; // show the new camera adv_camera.x = 820; // set the initial camera position and angles adv_camera.y = -1150; adv_camera.z = 620; adv_camera.pan = 120; adv_camera.tilt = -25; adv_camera.roll = 0; }
// uses cam_number, cam_range action detect_player { my.invisible = on; // hide the model my.passable = on; while (player == null) {wait (1);} // wait until the player is loaded if (my.cam_number == 0) {beep; beep; beep; exit;} if (my.cam_range == 0) {beep; beep; beep; exit;} while (1) { temp.x = 360; // horizontal scanning angle temp.y = 180; // vertical scanning angle temp.z = my.cam_range; // scanning range scan_entity (my.x, temp); if (result > 0) // got something? { set_camera(my.cam_number); // then set the proper camera position and angles } wait (1); } }
function set_camera(number) { if (number == 1) { adv_camera.x = -40; adv_camera.y = 340; adv_camera.z = 1260; adv_camera.pan = 270; adv_camera.tilt = -72; adv_camera.roll = 0; } if (number == 2) { adv_camera.x = -1915; adv_camera.y = -1550; adv_camera.z = 680; adv_camera.pan = 40; adv_camera.tilt = -35; adv_camera.roll = 0; } if (number == 3) { adv_camera.x = 1790; adv_camera.y = -1430; adv_camera.z = 730; adv_camera.pan = 150; adv_camera.tilt = -38; adv_camera.roll = 0; } if (number == 4) { adv_camera.x = -1880; adv_camera.y = 1390; adv_camera.z = 905; adv_camera.pan = 325; adv_camera.tilt = -38; adv_camera.roll = 0; } if (number == 5) { adv_camera.x = 1900; adv_camera.y = 1460; adv_camera.z = 800; adv_camera.pan = 220; adv_camera.tilt = -35; adv_camera.roll = 0; } }
This is all from aum 42, the thing tha i haven't undersant is how the action detect the player, cause this doesn't work
~Vision Divine~
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|