RPG Movement script non clipping 3rd person camera

Posted By: DavidLancaster

RPG Movement script non clipping 3rd person camera - 04/07/05 22:59

Attached is some code which was an experiment of mine. I wanted to create the effect that the camera was separate from the player and smoothly moved to its position. I also experimented with a different type of collision system for the camera. It can clip walls but is difficult, most times you need to force it, the camera will clip if you set the speed of the player too fast. If you fall off the edge of a cliff the camera will move upwards as well as dodge the wall to get a better view of the player. I haven't tested it in every situation but it does great in turning sharp corners. This code would suit an RPG like The Lord of The Rings The Third Age. Use guard model for testing. Use WSAD keys to move the player and the mouse for moving the camera. The animations are blended and the code is the neatest I have ever done. Let me know what you think. I hope you enjoy!

----------------------------------------------------------------
string current_player_frame = " ";

DEFINE animate,skill20;
DEFINE animate2,skill21;
DEFINE move_x,skill22;
DEFINE move_y,skill23;
DEFINE move_z,skill24;
DEFINE force_x,skill25;
DEFINE force_y,skill26;
DEFINE force_z,skill27;
DEFINE velocity_x,skill28;
DEFINE velocity_y,skill29;
DEFINE velocity_z,skill30;
DEFINE pan_to,skill31;
DEFINE pan_force,skill32;
DEFINE pan_velocity,skill33;
DEFINE stand_blend,skill34;
DEFINE walk_blend,skill35;
DEFINE run_blend,skill36;
DEFINE jump_blend,skill37;
DEFINE jumping_mode,skill38;
DEFINE begin_fall,skill39;

//camera variables
var camera_force[3];
var camera_velocity[3];
var camera_move_to[3];
var camera_pan_direction = 0;
var camera_pan_to;
var camera_pan_force;
var camera_pan_velocity;
var camera_tilt_offset = 0;
var camera_tilt_to;
var camera_tilt_force;
var camera_tilt_velocity;
var camera_height = 70; //current height
var camera_height_main = 70; //set height to move to
var camera_distance = 180; //current distance camera is from player
var camera_radius = 180; //maximum distance camera will move to from player
var camera_radius_force;
var camera_radius_velocity;
var camera_radius_move_to;
var dist_traced; //similar to result, used to store trace instructions

ACTION player_action {
my.shadow = on;
my.fat = off;
my.narrow = on;
WHILE (1) {
IF (my.jumping_mode == 0) && (my.begin_fall == 0) { player_walk(); }
player_gravity();
camera_move();
move_mode = glide;
ent_move(nullvector,my.move_x);
wait(1);
}
}

FUNCTION player_walk() {
my.force_x = 0;
my.force_y = 0;
IF (key_w == 1 || key_s == 1 || key_a == 1 || key_d == 1) {
IF (key_shift == 1) {
IF (my.stand_blend == 1) { str_cpy(current_player_frame,"stand"); }
IF (my.run_blend == 1) { str_cpy(current_player_frame,"run"); }
IF (my.walk_blend == 0) {
my.stand_blend = 0;
my.run_blend = 0;
my.walk_blend = 1;
my.animate2 = my.animate;
my.animate = 0;
}
IF (my.walk_blend == 2) {
ent_cycle("walk",my.animate);
my.animate += 9 * time;
str_cpy(current_player_frame,"walk");
} ELSE {
ent_cycle(current_player_frame,my.animate2);
ent_blend("walk",0,my.animate);
my.animate += 40 * time;
IF (my.animate > 100) {
my.animate -= 100;
my.walk_blend = 2;
}
}
} ELSE {
IF (my.stand_blend == 1) { str_cpy(current_player_frame,"stand"); }
IF (my.walk_blend == 1) { str_cpy(current_player_frame,"walk"); }
IF (my.run_blend == 0) {
my.stand_blend = 0;
my.walk_blend = 0;
my.run_blend = 1;
my.animate2 = my.animate;
my.animate = 0;
}
IF (my.run_blend == 2) {
ent_cycle("run",my.animate);
my.animate += 9 * time;
str_cpy(current_player_frame,"run");
} ELSE {
ent_cycle(current_player_frame,my.animate2);
ent_blend("run",0,my.animate);
my.animate += 40 * time;
IF (my.animate > 100) {
my.animate -= 100;
my.run_blend = 2;
}
}
}
} ELSE {
IF (my.run_blend == 1) { str_cpy(current_player_frame,"run"); }
IF (my.walk_blend == 1) { str_cpy(current_player_frame,"walk"); }
IF (my.stand_blend == 0) {
my.run_blend = 0;
my.walk_blend = 0;
my.stand_blend = 1;
my.animate2 = my.animate;
my.animate = 0;
}
IF (my.stand_blend == 2) {
ent_cycle("stand",my.animate);
my.animate += 3 * time;
str_cpy(current_player_frame,"stand");
} ELSE {
ent_cycle(current_player_frame,my.animate2);
ent_blend("stand",0,my.animate);
my.animate += 40 * time;
IF (my.animate > 100) {
my.animate -= 100;
my.stand_blend = 2;
}
}
}
IF (my.animate > 100) { my.animate -= 100; }

camera_pan_to -= mouse_force.x * 6 * time;
IF (mouse_force.x < 0) { camera_pan_direction = 1; }
IF (mouse_force.x > 0) { camera_pan_direction = -1; }

IF (mouse_force.y < 0) && (camera_height_main > 70) { camera_height_main += mouse_force.y * 50 * time; camera_height = camera_height_main; }
IF (mouse_force.y > 0) && (camera_height_main < 800) { camera_height_main += mouse_force.y * 50 * time; camera_height = camera_height_main; }

IF (key_a == 1) {
my.pan_to = camera.pan + 90;
camera_pan_to += 6 * time;
camera_pan_direction = 1;
}
IF (key_d == 1) {
my.pan_to = camera.pan + 270;
camera_pan_to -= 6 * time;
camera_pan_direction = -1;
}
IF (key_w == 1) {
my.pan_to = camera.pan;
}
IF (key_s == 1) {
my.pan_to = camera.pan + 180;
}
IF (key_w == 1 && key_d == 1) {
my.pan_to = camera.pan + 315;
}
IF (key_s == 1 && key_d == 1) {
my.pan_to = camera.pan + 225;
}
IF (key_s == 1 && key_a == 1) {
my.pan_to = camera.pan + 135;
}
IF (key_w == 1 && key_a == 1) {
temp = random(2);
my.pan_to = camera.pan + 45;
}
IF ((key_d == 1 && key_a == 1) || (key_w == 1 && key_s == 1)) {
my.pan_to = my.pan;
}
IF (key_d == 1 || key_a == 1 || key_w == 1 || key_s == 1) {
my.force_x = fcos(my.pan_to,15 * time);
my.force_y = fsin(my.pan_to,15 * time);
}

IF (key_d == 1 || key_a == 1 || key_s == 1 || key_w == 1 || my.jumping_mode != 0) {
temp = ang(my.pan_to - my.pan);
IF(temp > 5) {
my.pan_force = 20;
} ELSE {
IF (temp < -5) {
my.pan_force = -20;
} ELSE {
IF (temp > -2) && (temp < 2) { my.pan_velocity = 0; }
my.pan_force = 3 * ang(my.pan_to - my.pan);
}
}

my.pan_velocity += (TIME * my.pan_force) - (min(TIME*0.7,1) * my.pan_velocity);
my.pan += my.pan_velocity * TIME;
}
IF (key_shift == 1) {
my.force_x /= 1.5;
my.force_y /= 1.5;
}
}

FUNCTION player_gravity() {
vec_set(temp,my.x);
temp.z -= 4000;
trace_mode = ignore_me+ignore_passable+use_box;
result = trace(my.x,temp);
IF (you != null) {
result = ((my.z + my.min_z) - (you.z + you.max_z)); //for precise entity collision
}

IF (result <= 5) && (my.jumping_mode == 0) {
IF (result < 1.3) && (result > -1.3) && (result > 0.5) && (result < -0.5) { my.velocity_z = 0; } //change the value 1.5 to change how high steps he can climb, make it no higher than 3
my.force_z = -1 * result;
my.jump_blend = 0;
my.begin_fall = 0;
} ELSE {
IF (result > 60) && (my.begin_fall == 0) {
my.begin_fall = 1;
}
IF (my.begin_fall == 1) {
IF (my.jump_blend == 0) {
my.animate2 = my.animate;
my.animate = 0;
my.jump_blend = 1;
}
IF (result <= 5) && (my.animate > 20) {
IF (my.jumping_mode == 2) {
my.force_x = 0;
my.force_y = 0;
IF (my.animate <= 40) { my.jumping_mode = 0; }
IF (my.animate >= 100) {
my.jumping_mode = 0;
}
}
IF (result < 1.3) && (result > -1.3) && (result > 0.5) && (result < -0.5) { my.velocity_z = 0; } //change the value 1.5 to change how high steps he can climb, make it no higher than 3
my.force_z = -1 * result;
}
IF (my.jumping_mode != 1) {
IF (result < 30) {
IF (my.animate < 80) {
ent_frame("jump",my.animate);
my.animate += 12 * time;
} ELSE {
ent_frame("jump",my.animate);
my.animate += 4 * time;
IF (my.animate > 100) { my.animate = 100; }
}
} ELSE {
IF (my.force_x != 0) { my.force_x -= 0.08 * my.force_x * time; }
IF (my.force_y != 0) { my.force_y -= 0.08 * my.force_y * time; }
IF (my.jump_blend == 1) {
ent_cycle(current_player_frame,my.animate2);
ent_blend("jump",40,my.animate);
my.animate += 30 * time;
IF (my.animate > 100) {
str_cpy(current_player_frame,"stand");
my.walk_blend = 0;
my.run_blend = 0;
my.stand_blend = 0;
my.animate = 40;
my.jump_blend = 2;
}
} ELSE {
IF (my.animate < 40) {
ent_frame("jump",my.animate);
my.animate += 5 * time;
} ELSE {
my.animate = 40;
ent_frame("jump",my.animate);
my.jumping_mode = 2;
}
}
}
}
}
IF (my.force_z > -20) { my.force_z -= 3 * time; } ELSE { my.force_z = -20; }
}

my.velocity_z = 0.5 * my.force_z + max(1-0.5*0.7,0) * my.velocity_z; // calculate vertical speed, replace 0.3 with time to convert to the old equation
my.move_z = TIME * my.velocity_z; // distance down

my.move_x = my.force_x;
my.move_y = my.force_y;
}

FUNCTION camera_move() {
my.z += 15; //temporarily changed so that camera focusus slightly above middle

vec_set(temp.x,vector(my.x - fcos(camera.pan,camera_radius),my.y - fsin(camera.pan,camera_radius),camera.z));
trace_mode = ignore_me + ignore_passable + ignore_models + ignore_maps;
result = trace (my.x,temp.x);
IF (result > 0) {
result = sqrt(((target.x - my.x)*(target.x - my.x))+((target.y - my.y)*(target.y - my.y)));
camera_pan_to += camera_pan_direction * 15 * time;
IF (my.force_z < -2) {
camera_height += 80 * time;
}
} ELSE {
IF (camera_height > camera_height_main) { camera_height -= 15 * time; } ELSE { camera_height = camera_height_main; }
result = camera_radius;
}
IF (result < camera_radius) {
camera_radius_move_to = result;
} ELSE {
camera_radius_move_to = camera_radius;
}

IF (camera_radius_move_to < 15) { camera_radius_move_to = 15; }

vec_set(temp,my.x);
vec_sub(temp,camera.x);
vec_to_angle(temp.pan,temp);
camera_tilt_to = temp.tilt + camera_tilt_offset; //this causes the camera to tilt towards the player

camera_distance = camera_radius_move_to;
my.z -= 15; //temporarily changed so that camera focusus slightly above middle

vec_set(camera_move_to.x,vector(my.x - fcos(camera.pan,camera_distance),my.y - fsin(camera.pan,camera_distance),my.z + camera_height));

camera_tilt_force = (camera.tilt - camera_tilt_to) / -3;
IF (camera_tilt_force > 0) {
camera_tilt_force = min(camera_tilt_force,3);
} ELSE {
camera_tilt_force = max(camera_tilt_force,-3);
}
camera_tilt_velocity = 0.5*camera_tilt_force + max(1-0.5*0.7,0) * camera_tilt_velocity;
camera.tilt += camera_tilt_velocity * TIME;

camera_pan_force = (camera.pan - camera_pan_to) / -3;
IF (camera_pan_force > 0) {
camera_pan_force = min(camera_pan_force,10);
} ELSE {
camera_pan_force = max(camera_pan_force,-10);
}
camera_pan_velocity = 0.5*camera_pan_force + max(1-0.5*0.7,0) * camera_pan_velocity;
camera.pan += camera_pan_velocity * TIME;

IF (abs(camera.x - camera_move_to.x) > 2) {
camera_force.x = (camera.x - camera_move_to.x) / -4;
} ELSE {
camera_force.x = 0;
camera_velocity.x = 0;
}
IF (abs(camera.y - camera_move_to.y) > 2) {
camera_force.y = (camera.y - camera_move_to.y) / -4;
} ELSE {
camera_force.y = 0;
camera_velocity.y = 0;
}
IF (abs(camera.y - camera_move_to.z) > 2) {
camera_force.z = (camera.z - camera_move_to.z) / -12;
} ELSE {
camera_force.z = 0;
camera_velocity.z = 0;
}

IF (key_w == 1 && key_d == 1) || (key_w == 1 && key_a == 1) || (key_s == 1 && key_d == 1) || (key_s == 1 && key_a == 1) {
camera_force.x /= 1.5;
camera_force.y /= 1.5;
}

camera_velocity.x = 0.5*camera_force.x + max(1-0.5*0.7,0)*camera_velocity.x;
camera_velocity.y = 0.5*camera_force.y + max(1-0.5*0.7,0)*camera_velocity.y;
camera_velocity.z = 0.5*camera_force.z + max(1-0.5*0.7,0)*camera_velocity.z;
camera.x += TIME * camera_velocity.x;
camera.y += TIME * camera_velocity.y;
camera.z += TIME * camera_velocity.z;
}
Posted By: Orange Brat

Re: RPG Movement script non clipping 3rd person camera - 04/08/05 00:45

I'm always whining about wall clipping and have yet to find one that doesn't, so I'll eagerly test her out later on.
Posted By: Locoweed

Re: RPG Movement script non clipping 3rd person camera - 04/09/05 02:44

The camera code looks pretty good, I will check it out when I get some free time.

Thanks for the contribution,
Loco
Posted By: b_102373

Re: RPG Movement script non clipping 3rd person camera - 04/09/05 09:11

The camera is excellent. Will you be releasing this code publically? Also the camera starts to spin when I look down on the character.
Posted By: DavidLancaster

Re: RPG Movement script non clipping 3rd person camera - 04/09/05 15:09

Use the code to your heart's content. No need to add me in credits unless you really want to. Replace camera_move() function with the one below to fix the spinning problem. The spinning problem occured when the camera went through the roof. The new function should stop the camera going through the roof when you move the mouse up. If the player dissapears under a ledge and the camera is above the ledge, the spinning problem will occur again. You can make your levels around this by making sure the camera height is capped at a lower height, and making sure the player wont dissapear under a WED block. The camera works fine with buildings, it's when you have a tunnel or a roof and the camera is above it.

You can also use the same camera function, replace the "my" pointer with any other entity pointer. Then have a function which changes which entity possesses the pointer and the camera will move smoothly to that entity. This is useful in Turn Based fights. You select enemy and the selected enemy can be assigned the pointer, the camera will move to that enemy smoothly.

-------------------------------------------------------------
FUNCTION camera_move() {
my.skill68 = 1000;
trace_mode = ignore_me + ignore_passable + ignore_models + ignore_maps; //trace above player to see if there is a wall above
result = trace (vector(camera.x,camera.y,my.z + 70),vector(camera.x,camera.y,my.z + 2000));
IF (result > 0) { IF (camera_height_main > result - 20) { camera_height_main = result -20; my.skill68 = camera_height_main; } }

my.z += 15; //temporarily changed so that camera focusus slightly above middle

vec_set(temp.x,vector(my.x - fcos(camera.pan,camera_radius),my.y - fsin(camera.pan,camera_radius),camera.z));
trace_mode = ignore_me + ignore_passable + ignore_models + ignore_maps;
result = trace (my.x,temp.x);
IF (result > 0) {
result = sqrt(((target.x - my.x)*(target.x - my.x))+((target.y - my.y)*(target.y - my.y)));
camera_pan_to += camera_pan_direction * 15 * time;
IF (my.force_z < -5) {
camera_height_main += 80 * time;
camera_height += 80 * time;
IF (camera_height_main > my.skill68) { camera_height_main = my.skill68; }
IF (camera_height > camera_height_main) { camera_height = camera_height_main; }
}
} ELSE {
result = camera_radius;
}
IF (result < camera_radius) {
camera_radius_move_to = result;
} ELSE {
camera_radius_move_to = camera_radius;
}

IF (camera_height > camera_height_main) {
camera_height -= 15 * time;
IF (camera_height < camera_height_main) { camera_height = camera_height_main; }
}
IF (camera_height < camera_height_main) {
camera_height += 15 * time;
IF (camera_height > camera_height_main) { camera_height = camera_height_main; }
}

IF (camera_radius_move_to < 15) { camera_radius_move_to = 15; }

vec_set(temp,my.x);
vec_sub(temp,camera.x);
vec_to_angle(temp.pan,temp);
camera_tilt_to = temp.tilt + camera_tilt_offset; //this causes the camera to tilt towards the player

camera_distance = camera_radius_move_to;
my.z -= 15; //temporarily changed so that camera focusus slightly above middle

vec_set(camera_move_to.x,vector(my.x - fcos(camera.pan,camera_distance),my.y - fsin(camera.pan,camera_distance),my.z + camera_height));

camera_tilt_force = (camera.tilt - camera_tilt_to) / -3;
IF (camera_tilt_force > 0) {
camera_tilt_force = min(camera_tilt_force,3);
} ELSE {
camera_tilt_force = max(camera_tilt_force,-3);
}
camera_tilt_velocity = 0.5*camera_tilt_force + max(1-0.5*0.7,0) * camera_tilt_velocity;
camera.tilt += camera_tilt_velocity * TIME;

camera_pan_force = (camera.pan - camera_pan_to) / -3;
IF (camera_pan_force > 0) {
camera_pan_force = min(camera_pan_force,10);
} ELSE {
camera_pan_force = max(camera_pan_force,-10);
}
camera_pan_velocity = 0.5*camera_pan_force + max(1-0.5*0.7,0) * camera_pan_velocity;
camera.pan += camera_pan_velocity * TIME;

IF (abs(camera.x - camera_move_to.x) > 2) {
camera_force.x = (camera.x - camera_move_to.x) / -4;
} ELSE {
camera_force.x = 0;
camera_velocity.x = 0;
}
IF (abs(camera.y - camera_move_to.y) > 2) {
camera_force.y = (camera.y - camera_move_to.y) / -4;
} ELSE {
camera_force.y = 0;
camera_velocity.y = 0;
}
IF (abs(camera.y - camera_move_to.z) > 2) {
camera_force.z = (camera.z - camera_move_to.z) / -12;
} ELSE {
camera_force.z = 0;
camera_velocity.z = 0;
}

IF (key_w == 1 && key_d == 1) || (key_w == 1 && key_a == 1) || (key_s == 1 && key_d == 1) || (key_s == 1 && key_a == 1) {
camera_force.x /= 1.5;
camera_force.y /= 1.5;
}

camera_velocity.x = 0.5*camera_force.x + max(1-0.5*0.7,0)*camera_velocity.x;
camera_velocity.y = 0.5*camera_force.y + max(1-0.5*0.7,0)*camera_velocity.y;
camera_velocity.z = 0.5*camera_force.z + max(1-0.5*0.7,0)*camera_velocity.z;
camera.x += TIME * camera_velocity.x;
camera.y += TIME * camera_velocity.y;
camera.z += TIME * camera_velocity.z;
}
Posted By: Orange Brat

Re: RPG Movement script non clipping 3rd person camera - 04/12/05 07:35

I finally got to test it out a bit, and it's a very unique camera. It does tend to clip when whipping around to the opposite side of the player but it tends to avoid pretty consistenly when you're just walking around and not messing with the mouse. The animation blending is good, too. It would be nice if you could expand upon that aspect one day. Mainly for turning in place and idle animations and blending them with standing, walking, and running states.

The cam almost has an Eternal Darkness quality to it and if it can be finessed into more of a scripted camera it would be pretty much just like it. Kind of like what I quoted below only it would still target the player and still only move when the player does. However, it would be on more of a rail between position A to position B, etc. while targeting the player and rounding corners if need be.

Quote:

You can also use the same camera function, replace the "my" pointer with any other entity pointer. Then have a function which changes which entity possesses the pointer and the camera will move smoothly to that entity.




Posted By: Orange Brat

Re: RPG Movement script non clipping 3rd person camera - 04/13/05 02:27

Here's a demo of this cool camera. It's the guard model and a slightly modified version of my old tester level. Also, it uses the 2nd version of the camera_move function. Open with Winrar which can be downloaded from http://www.rarlabs.com/

http://www.geocities.com/hainesrs/rpgcamdemo.rar - 239KB
Posted By: Nadester

Re: RPG Movement script non clipping 3rd person ca - 04/13/05 03:20

Thanks OB... that saves a bit of trouble. (Or laziness )

@Access, looks really promising. Camera work is nicelly done, collision is great. My only grudge is that it flies around a bit too quickly, after a while of playing that could make you dizzy - but I'm sure thats easily fixable. It'd be great if you could expand upon it, and add some more movements!
Posted By: Orange Brat

Re: RPG Movement script non clipping 3rd person ca - 04/13/05 03:34

I'd like it better if the player was always kept in the dead center of the screen. I've been playing with values trying to figure out how to do it, but I'm coming up dry. I added it in an edit, but like Nadester, I'd like to see more moves added, too. Mainly for turning in place animations(a unique animation while player pans) and an inactivity idle. They should blend with the already implemented stand, walk, and run.
Posted By: Nems

Re: RPG Movement script non clipping 3rd person ca - 04/13/05 04:09

I really liked it when I first downloaded it but couldnt handle the camera so high.
I edited the camera to stay just at above head hight but tilt lower to facilitate 3rd person shoot anywhere the crosshair looks, works great so far.
Might play with it some more later but still an FPS fan.
Posted By: Orange Brat

Re: RPG Movement script non clipping 3rd person ca - 04/13/05 16:54

I found a tiny little buglet in the code. Nothing major but can lead to animation frame confusion. Change the "string current_player_frame = " ";" to "string current_player_frame;". Otherwise, if you have two animation sets with the same first letter, the engine will use whichever comes first and always ignore the other. Likewise, you could simply make the " " part larger, but what I suggested allows for any name.
Posted By: DavidLancaster

Re: RPG Movement script non clipping 3rd person ca - 04/15/05 10:20

Thanks for your comments. OB changed some of the script in the demo, so it isn't exactly the same, try both of them to see a difference. Thanks for posting a demo OB. The collision only uses one trace and pans when the trace is interrupted. I did that for compact code reasons (and less traces used the better), but if you use the concept behind the Zelda cam I posted before, you can get a normal 3rd person cam working which moves smoothly. The camera moving quickly and making you dizzy works well when the player turns a corner, this effect will be different with the above code instead of the demo as OB has turned off the camera panning when the player presses A or D in the demo.

The camera has coordinates at which it smoothly moves to. You can add this at the end of the camera function to remove the smooth movement and allow the camera to lock dead center on the player (but that's like making a Zelda cam all over again :P )

camera.x = camera_move_to.x;
camera.y = camera_move_to.y;
camera.z = camera_move_to.z;
camera.pan = camera_pan_to;
camera.tilt = camera_tilt_to;
Posted By: Orange Brat

Re: RPG Movement script non clipping 3rd person ca - 04/15/05 16:17

I just checked to see what I could have changed...there were a couple of lines commented out that shouldn't have been and a couple of values changed. I've corrected that and reuploaded.
Posted By: Nems

Re: RPG Movement script non clipping 3rd person ca - 04/16/05 02:31

Good work guys and thanks for both.
Bit of a God send to script challenged people like me.
Cheers.
Posted By: Eagle

Re: RPG Movement script non clipping 3rd person camera - 04/22/05 03:13

very cool AccessPhenomenon! thanks for the code and info~

always~
Eagle
Posted By: prophet

Re: RPG Movement script non clipping 3rd person camera - 06/13/05 02:26

I am so glad I stumbled across this. With what everyone says about it, I am hoping this will fix my issues, with my game atleast.

Thanks for the contribution.
Posted By: Thomas_Nitschke

Re: RPG Movement script non clipping 3rd person camera - 06/15/05 17:13

Same goes for me. Thank you very much AccessPhenomenon, this script is a great achievement and works nicely! I'll definitely use it in my project.

Btw, has someone ever tried converting the script so it uses c_trace for player and camera instead of trace? I got into troubles with that, resulting from the c_trace bug that causes strange values in the "result" var when nothing has been hit (see bughunt section)... Does anyone have a solution for that?
Posted By: draculaFactory

Re: RPG Movement script non clipping 3rd person camera - 06/16/05 22:15

Are you going to implement jumping or just falling? I can try myself, but this code makes my eyes pop out.
Posted By: prophet

Re: RPG Movement script non clipping 3rd person camera - 06/18/05 01:52

It is quite scary. How much time did it take you?
Posted By: draculaFactory

Re: RPG Movement script non clipping 3rd person camera - 06/18/05 02:11

I just went and made my own. It's perfect for what I'm using it for and its MUCH shorter. LOL.
Posted By: DavidLancaster

Re: RPG Movement script non clipping 3rd person camera - 06/18/05 08:22

Quote:

Are you going to implement jumping or just falling? I can try myself, but this code makes my eyes pop out.



You'll have to implement jumping in the 'player_gravity()' function. That's where to start. I'm not going to implement it. But you can check out my Zelda script for ideas:

http://www.coniserver.net/ubbthreads/sho...true#Post462719

Quote:

It is quite scary. How much time did it take you?



It's scary eh :P About a week I think, on and off. Alot of refining mostly.
Posted By: Guardian

Re: RPG Movement script non clipping 3rd person camera - 06/30/05 12:58

This is a very nice camera I had worked on this problem also a long time back and had some fair results but the code was very bad. This looks much more flexable, I will use it in my projects as well. Very pro looking camera.

Thanks very much.


Guardian
Posted By: Kotakide

Re: RPG Movement script non clipping 3rd person camera - 07/09/05 06:22

AWESOME

This is camera movement of my dream...

I beg you to combine this non cliping camera with your previous zelda code. or maybe add some more movement and capability to the player.
About a model I will give you everything that you need. just mention what kind of character that you want, and I will make it for you

deal....????
Posted By: Bilbo

Re: RPG Movement script non clipping 3rd person camera - 07/09/05 11:10

wow obinks model and an updated code with jumping ect sounds to good to be true :P i just saw his guard and its amazing!, i love this camera to altho it seems to get confused when its in a tight gap and spins wildly
© 2024 lite-C Forums