Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,280 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 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 | 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