|
problem with movement script
#220273
08/06/08 18:40
08/06/08 18:40
|
Joined: Dec 2004
Posts: 11
Jonah
OP
Newbie
|
OP
Newbie
Joined: Dec 2004
Posts: 11
|
I'm using this movement code but when i try to run the game it says: "camera.z += z_offset; Parameter unknown SKILL50" Here's the whole code: define true, 1;
define false, 0;
define relSpeed_x,skill7;
define relSpeed_y,skill8;
define relSpeed_z,skill9;
define absSpeed_x,skill10;
define absSpeed_y,skill11;
define absSpeed_z,skill12;
define P_Speed,skill13;
define P_AngSpeed,skill14;
define P_Weight,skill15;
define P_Friction,skill16;
var GLOB_BkgColor[3];
var PHY_Gravity[3];
var MOV_Playerspeed = 25;
var MOV_Turnspeed = 10;
var MOV_MaxUpAngle = 90;
var MOV_MaxDownAngle = -90;
var MOV_ShiftFactor = 1.35;
function FNC_ApplyPhysics(ent, enablePoly)
{
me = ent;
vec_set(me.absSpeed_x, PHY_Gravity.x);
while(me)
{
c_move(me, nullvector, me.absSpeed_x, IGNORE_SPRITES);
c_move(me, me.relSpeed_x, nullvector, IGNORE_SPRITES|GLIDE);
wait(1);
}
}
function FNC_MoveWASD(ent)
{
// :: Assign ME pointer to entity.
me = ent;
// :: Main loop
while(me)
{
// :: Rotate camera
camera.pan += -((mouse_force.x * MOV_Turnspeed) * time_step);
// :: Assign camera pan to entity pan
me.pan = camera.pan;
// :: Camera Tilting
// : If Camera tilt is over or under maximal tilt angles
if(camera.tilt > MOV_MaxUpAngle || camera.tilt < MOV_MaxDownAngle)
{
if(camera.tilt > MOV_MaxUpAngle)
{
// :: If it is over the maximal upper limit
camera.tilt = int(camera.tilt - 2*time_step);
// : Limit mouse movement
if(mouse_force.y < 0){camera.tilt += ((mouse_force.y * MOV_Turnspeed) * time_step);}
}
else
{
// :: If it is over the maximal lower limit
camera.tilt = int(camera.tilt + 2*time_step);
// : Limit mouse movement
if(mouse_force.y > 0){camera.tilt += ((mouse_force.y * MOV_Turnspeed) * time_step);}
}
}
else
{
// :: Else
// : Free tilting
camera.tilt += ((mouse_force.y * MOV_Turnspeed) * time_step);
}
// :: If camera roll is not equal to 0°
if(camera.roll != 0)
{
// :: And if camera roll is higher or equal to 180°
if(camera.roll >= 180)
{
// : Roll clockwise
camera.roll = int(camera.roll + 2*time_step);
}
else
{
// :: else
// : roll counter-clockwise
camera.roll = int(camera.roll - 2*time_step);
}
}
vec_accelerate(my.relSpeed_x, my.P_Speed, vector(((key_w-key_s)*MOV_Playerspeed*(1+key_shift*MOV_ShiftFactor))*time_step, ((key_a-key_d)*MOV_Playerspeed*(1+key_shift*MOV_ShiftFactor))*time_step, me.relSpeed_z), 0.5);
wait(1);
}
}
function FNC_AttachCam(ent, z_offset)
{
me = ent;
vec_set(camera.x, vector(me.x, me.y, me.z));
if(!key_ctrl){ camera.z += z_offset; }
}
action ACT_Player
{
player = me;
FNC_ApplyPhysics(player, false);
FNC_MoveWASD(player);
camera.genius = player;
while(1)
{
FNC_AttachCam(player, 35);
wait(1);
}
}
I also have the PHY_Gravity[0] = 0;
PHY_Gravity[1] = 0;
PHY_Gravity[2] = (-9.8);
camera.arc = 75;
fps_max = 60;
fps_min = 35;
fps_lock = on;
in my main function. How to fix this? Thanks in advance.
|
|
|
Re: problem with movement script
[Re: Jonah]
#220321
08/06/08 22:45
08/06/08 22:45
|
Joined: Nov 2007
Posts: 1,032 Croatia
croman
Serious User
|
Serious User
Joined: Nov 2007
Posts: 1,032
Croatia
|
i dont see that skill name defined anywhere. try to add this somewhere on top of this code: define z_offset, skill50;
Ubi bene, ibi Patria.
|
|
|
Re: problem with movement script
[Re: Jonah]
#220328
08/06/08 23:43
08/06/08 23:43
|
Joined: Aug 2003
Posts: 7,440 Red Dwarf
Michael_Schwarz
Senior Expert
|
Senior Expert
Joined: Aug 2003
Posts: 7,440
Red Dwarf
|
solved it, another script was causing the problem could have told you that  i tested my script thoroughly, I know for a matter of fact that it works just fine 
"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|