Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Help with fixed cams #148402
08/16/07 19:11
08/16/07 19:11

A
Anonymous
Unregistered
Anonymous
Unregistered
A



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
S
Shadow969 Offline
User
Shadow969  Offline
User
S

Joined: Oct 2006
Posts: 873
Check out early AUMs...

Re: Help with fixed cams [Re: ] #148404
08/16/07 21:47
08/16/07 21:47
Joined: Aug 2005
Posts: 390
Florida
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

Joined: Aug 2005
Posts: 390
Florida
if you could post a wdl from cscript, I could probably just convert it for you to litec, camera code is fairly easy to convert, unless its really advanced. At least for me


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] #148405
08/16/07 23:43
08/16/07 23:43

A
Anonymous
Unregistered
Anonymous
Unregistered
A



#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

A
Anonymous
Unregistered
Anonymous
Unregistered
A



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
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

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

A
Anonymous
Unregistered
Anonymous
Unregistered
A



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

A
Anonymous
Unregistered
Anonymous
Unregistered
A



Any one got any Ideas???

Re: Help with fixed cams [Re: ] #148410
08/17/07 22:31
08/17/07 22:31
Joined: Aug 2005
Posts: 390
Florida
O
oldschoolj Offline
Senior Member
oldschoolj  Offline
Senior Member
O

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
Re: Help with fixed cams [Re: oldschoolj] #148411
08/18/07 08:13
08/18/07 08:13
Joined: Aug 2000
Posts: 7,490
O
Orange Brat Offline

Senior Expert
Orange Brat  Offline

Senior Expert
O

Joined: Aug 2000
Posts: 7,490
@Malice: Check out the Ultimate RE cam in my Master List (click signature link). It should work. I can't remember if it has a playable demo included, but it might or should. It used to I think but I can't recall if I updated it recently or not (or why).


My User Contributions master list - my initial post links are down but scroll down page to find list to active links
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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