Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (7th_zorro), 793 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | 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