Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
problem with movement script #220273
08/06/08 18:40
08/06/08 18:40
Joined: Dec 2004
Posts: 11
J
Jonah Offline OP
Newbie
Jonah  Offline OP
Newbie
J

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:
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
Code:
 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 Offline
Serious User
croman  Offline
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: croman] #220322
08/06/08 22:55
08/06/08 22:55
Joined: Dec 2004
Posts: 11
J
Jonah Offline OP
Newbie
Jonah  Offline OP
Newbie
J

Joined: Dec 2004
Posts: 11
solved it, another script was causing the problem

Re: problem with movement script [Re: croman] #220323
08/06/08 22:57
08/06/08 22:57
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
are you sure you don't have any other scripts attached/running, that error wouldn't be present otherwise,

the z_offset is only a parameter created locally in the FNC_AttachCam function...? =/ strange one that...

Re: problem with movement script [Re: MrGuest] #220324
08/06/08 22:58
08/06/08 22:58
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
aah foolish me, i didnt see that smile



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 Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,440
Red Dwarf
Originally Posted By: Jonah
solved it, another script was causing the problem


could have told you that laugh

i tested my script thoroughly, I know for a matter of fact that it works just fine laugh


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku

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