Getting units to stop moving until enemy disappear

Get help using Construct 2

Post » Tue Jan 28, 2014 9:23 pm

Right now, I am attempting to get the units to stop moving and enter attack phase. When there are no units, the unit moves on.

capx file
https://www.dropbox.com/s/svamvor1vcorfqx/sftahg_0_4_2_1.capx

For that to work, I had to give each unit its unique aiming range as part of the container.

I also check to see not only that the aiming sprite collides with the unit, the player values shall not be the same.



I have noticed a difference between on collision and overlapping. When i replaced on collision with is overlapping, the unit stop behavior does not work. when I did keep on collision, the stop unit movement works.

Now I want to know how I can get the unit to stop moving until there is no enemy unit on sight?JBRPG2014-01-28 21:24:31
B
10
S
2
G
1
Posts: 13
Reputation: 1,134

Post » Wed Jan 29, 2014 12:06 am

use the line of sight behavior and invert it or add an else to it so that you can react to not having line of site with the enemy?
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Wed Jan 29, 2014 3:37 am

[QUOTE=BluePhaze] use the line of sight behavior and invert it or add an else to it so that you can react to not having line of site with the enemy?[/QUOTE]

I have tried that but it has no success.

I will give you details and the evidence;

download link

https://www.dropbox.com/s/umq2img1lxgn5hj/sftahg_0_4_2_2.capx

image:



Each unit is a container with its aim line. The aim line has its line fo sight as the previous poster suggested.

I am still checking the condition that the unit is on the line of sight and the value of player for the target unit is NOT EQUAL to the aim line from the unit.

units1_grunt and unit1_aim as container object

when running the game, neither of those conditions worked.

Any other way to help out or improve existing behaviorJBRPG2014-01-29 03:42:19
B
10
S
2
G
1
Posts: 13
Reputation: 1,134


Return to How do I....?

Who is online

Users browsing this forum: Blendi1223 and 50 guests