How do I activate an enemy animation by distance?

Get help using Construct 2

Post » Wed Aug 27, 2014 7:07 am

When I get near an enemy how do I get it to play a different animation?
I tried looking the answer up to this, but could find nothing. No matter what I typed.
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Wed Aug 27, 2014 8:05 am

system for each enemy
system compare two values: distance(player.x,player.y,enemy.x,enemy.y)<100
system trigger once
-- enemy set animation
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Aug 28, 2014 5:46 am

Thanks LittleStain, but I need a little more help. Are any of these conditions or sub-events? How exactly would I put this in?
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Thu Aug 28, 2014 9:12 pm

(Event)system for each enemy
(Sub Event) system compare two values: distance(player.x,player.y,enemy.x,enemy.y)<100
(Same Sub Event - Add a second condition) system trigger once -> Action-- enemy set animation
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Thu Aug 28, 2014 10:41 pm

I'd have to say use the line of site behaviour. Adjust the line of site for a specific distance. Set an action so when the enemy has line of site to the player, start the animation.
Kurieus
Come visit and play Blast Box!
B
15
S
3
Posts: 205
Reputation: 1,349

Post » Fri Aug 29, 2014 2:20 am

I tried the last 2 responses and still nothing.
WASD to move
"BlueSoldier" is the enemy that I want to change to the animation "Throw"

https://www.dropbox.com/s/tfupt3a1r433x ... aproj?dl=0
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Fri Aug 29, 2014 3:51 am

CapX did not work
save as single file
B
9
S
1
Posts: 18
Reputation: 515

Post » Fri Aug 29, 2014 4:55 am

B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Post » Fri Aug 29, 2014 9:05 am

If you include eventsheet1 into eventsheet zero it works..

The events are now on an eventsheet that isn't connected to the layout..
Either put the events on the eventsheet of the layout or include the eventsheet with the events inside it..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Sep 05, 2014 4:57 am

Still trying to get it to work perfectly, but I'm having trouble with it freezing up on me and then shutting down everytime I try to make a sprite strip.
B
24
S
7
G
3
Posts: 122
Reputation: 3,047

Next

Return to How do I....?

Who is online

Users browsing this forum: Lancifer, MPPlantOfficial, Sup with that? and 60 guests