|
0 registered members (),
631
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Help with fixed cams
#148402
08/16/07 19:11
08/16/07 19:11
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
Would anyone like to help me understand how to script resident evil style fixed cams. I've tryed 3 ways and found only 3 ways to crash the engine at runtime. The work I've done is based of the gnometech cam tutorial. If anyone knows how to do this in the Lite-c A7 extra environment please help me...
if you can Please help...
MoF
|
|
|
Re: Help with fixed cams
[Re: ]
#148403
08/16/07 19:32
08/16/07 19:32
|
Joined: Oct 2006
Posts: 873
Shadow969
User
|
User
Joined: Oct 2006
Posts: 873
|
|
|
|
Re: Help with fixed cams
[Re: oldschoolj]
#148405
08/16/07 23:43
08/16/07 23:43
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
#include <acknex.h> #include <default.c> var camera_position[50]; var winner; var temp_vec[3]; VIEW* re_camera; VIEW re_camera = { layer = 10; pos_x = 0; pos_y = 0; flags = VISIBLE; }
action recam() { set(my,INVISIBLE); set(my,PASSABLE); //re_camera.tilt = my.tilt; re_camera.roll = my.roll; if(my.skill1 == 0){ ent_remove(me); beep(); beep(); return;} while (player !=NULL) { camera_position[my.skill1] = vec_dist(my.x, player.x); if (winner > camera_position[my.skill1] - 50) { re_camera.x = my.x; re_camera.y = my.y; re_camera.z = my.z;
vec_set(temp_vec[0], player.x); // re_camera's pan vec_sub(temp_vec[0], my.x); vec_to_angle(re_camera.pan, temp_vec[0]); } wait (1); } }
var temp_counter; var found_camera; function fixed_cameras() { reset(camera,VISIBLE); set(re_camera,VISIBLE);
while (player != NULL) { temp_counter += 1; if (temp_counter == 50) { temp_counter -= 49; } if (camera_position[temp_counter] < winner && camera_position[temp_counter] > 0) { winner = camera_position[temp_counter]; found_camera = temp_counter; } else { winner = camera_position[found_camera]; } wait (1); } }
|
|
|
Re: Help with fixed cams
[Re: ]
#148406
08/16/07 23:52
08/16/07 23:52
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
E1513 in main and recam This is my conversion of the AUM4 code
Last edited by Malice; 08/16/07 23:58.
|
|
|
Re: Help with fixed cams
[Re: ]
#148407
08/17/07 01:18
08/17/07 01:18
|
Joined: Aug 2005
Posts: 390 Florida
oldschoolj
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 390
Florida
|
I noticed two things that are incorrect, though this is a more advanced code I'm sure a better coder could either verify or invalidate these changes. Your temp_vector is improperly defined, and the use of skill1 is not defined. Let's start with the Vector, the manual states this: Quote:
Always initialize variables In C-Script, uninitialized local variables (like var myvar;) were automatically initialized to zero. Not anymore. You now should to either initialize variables in the definition (like var myvar = 0;), or leave them uninitalized only when their inital value does not matter. Because structs can not be initialized in their definition, use the zero() macro (defined in acknex.h) for initalizing local or global structs to zero, and vec_zero() for initializing vectors consisting of 3 vars:
VECTOR speed;
vec_zero(speed); // initializes the VECTOR "speed" to x=0,y=0,z=0
I always initialize them in that fashion, unless it's an array, which is how your defining your vector, as an array.
Change it to this:
VECTOR temp_vec; vec_zero (temp_vec);
Then your code will change this way:
vec_set(temp_vec.x, player.x); // re_camera's pan vec_sub(temp_vec.x, my.x); vec_to_angle(re_camera.pan, temp_vec.pan);
Now for the skill:
The manual says that skills are defined in the following way:
skill[0] //// for arrays instead of skill1...99
and:
#define SKILL1 0 // old way was define skill1, 0;
so change your code to reflect the way you choose to define your skill
I may be completely wrong on this because I am very new to programming, but I hope I was of some help.
BTW I copied and pasted your code and did not get the same error, which version are you using?
you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe.
__________________________________
yours truly
|
|
|
Re: Help with fixed cams
[Re: oldschoolj]
#148408
08/17/07 05:25
08/17/07 05:25
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
OldShooli I change the code like you said and add the call to FIXED_CAMERAS in the function main after the wait and still get the same errors. I added the recam action to 2 objects and them different skill1 settings.
e1513 in recam(x2). e1513 in main.
I am using the A7 extra latest as far as I know buought it a week ago download the latest trail version and used the key file.
Is there some other reason this is happening? the code is from AUM 4.
|
|
|
Re: Help with fixed cams
[Re: ]
#148409
08/17/07 19:44
08/17/07 19:44
|
Anonymous
Unregistered
|
Anonymous
Unregistered
|
|
|
|
Re: Help with fixed cams
[Re: ]
#148410
08/17/07 22:31
08/17/07 22:31
|
Joined: Aug 2005
Posts: 390 Florida
oldschoolj
Senior Member
|
Senior Member
Joined: Aug 2005
Posts: 390
Florida
|
If you like the Resident Evil Style you can download the Ultimate Resident Evil camera from the forums, other than that I really cna't see the issue if you did what I mentioned. It's possible that because you have extra your not getting the features needed.
you can find me with my face in the keyboard, unshaven, listening to some nameless techno tragedy, and hashing through code over a cold cup a stale joe.
__________________________________
yours truly
|
|
|
|