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
1 registered members (TipmyPip), 18,606 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
c_move simple question #416199
01/29/13 00:00
01/29/13 00:00
Joined: Jan 2013
Posts: 24
M
milaz Offline OP
Newbie
milaz  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 24
Hola! how are you guys, hope yo r healthy/wealthy grin

How can i move the enemy to a cover while always facing or in another words looking toward player using c_move?
The cover can be in the left, right or in front of him. And how can i know which animation to play? like strafing left, strafing right or simply walking toward front/back cover.
I already have the cover's pos in temp vector.

Re: c_move simple question [Re: milaz] #416213
01/29/13 07:05
01/29/13 07:05
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
The c_move instruction has two speed parameters, you need to use the second one, f.i. as follows:

vec_diff(temp,cover.x,my.x);
temp.z = 0;
if(vec_length(temp) > 15) vec_normalize(temp,15);
c_move(me,nullvector,vector(temp.x*time_step,temp.y*time_step,0),IGNORE_PASSABLE);

For the animation part you could continue as follows:

vec_to_angle(temp2,temp);
i = ang(temp2.x-my.pan);
if(abs(i) < 45) anim normal
if(abs(i) > 135) anim back
else
{
if(i >= 45) strafe left // should be left, I think
else strafe right
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

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