Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by AndrewAMD. 12/02/26 15:26
SGT_FW
by Aku_Aku. 11/30/26 08:19
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 6,080 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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