Gamestudio Links
Zorro Links
Newest Posts
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
ZorroGPT
by TipmyPip. 08/29/26 06:56
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (VoroneTZ), 1,555 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[DONE] vec_set stops c_move working #156062
09/21/07 17:22
09/21/07 17:22
Joined: Sep 2007
Posts: 42
Germany - Braunschweig
deleRium Offline OP
Newbie
deleRium  Offline OP
Newbie

Joined: Sep 2007
Posts: 42
Germany - Braunschweig
Hi

I just starded creating my own player-wovement function. The function works.

So I added a function to set a vector to the player coordinates for further purposes. This function is started by pressing space. Now, when I press Space, the c_move function stops working.

I can look around with the mouse but i can't move by pressing WASD. Here's the code:

Code:
// adjustable mouse-sensitivity and movement-speed
var mouse_sens = 5, movement_speed = 8;

// vector for further purposes
VECTOR* bla = nullvector;

...

action Spieler()
{
player = me;

while(1)
{
// ingame-actions
if(GameState == gsINGAME)
{
x = (((key_w && !key_s) || ((!key_w && key_s) * -1)) * movement_speed) * time_step; // forward and backward movement
y = (((key_a && !key_d) || ((!key_a && key_d) * -1)) * movement_speed) * time_step; // strafing

camera.pan = my.pan -= mouse_force.x * mouse_sens; // players & cameras pan
camera.tilt = minmax(camera.tilt + (mouse_force.y * mouse_sens), -80, 80); // cameras tilt

c_move(me, vector(x,y,0), nullvector, GLIDE); // players managed-movement

vec_set(camera.x,my.x); // sync camera with player
camera.z += 105; // camera to players head

frame += 1; // a simple debug counter

if(key_space)
{
vec_set(bla.x, player.x); // What the hell???
}
}

wait(1);
}
}



The "frame"-var was just a debug var to test if the movement-function is still active (added to watch-vars in SED). I also checked the movement-vectors. All is working ... just c_move not!?

Can somebody help me?

Last edited by deleRium; 09/21/07 17:37.
Re: vec_set stops c_move working [Re: deleRium] #156063
09/21/07 17:29
09/21/07 17:29
Joined: Sep 2007
Posts: 42
Germany - Braunschweig
deleRium Offline OP
Newbie
deleRium  Offline OP
Newbie

Joined: Sep 2007
Posts: 42
Germany - Braunschweig
Ehm ... hehe

Just found it ... I removed the asterisk from the "bla"-Vector definition:

Old:
Code:
VECTOR* bla = nullvector;



New:
Code:
VECTOR bla = nullvector;



It works now


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

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