Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 10:32
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
6 registered members (fairtrader, AndrewAMD, ozgur, TipmyPip, Quad, alibaba), 582 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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