How do I get turret target

Get help using Construct 2

Post » Mon May 29, 2017 3:40 pm

I have object_1 and object_2 and a soldier.
Soldier move to object_2. when soldier moving he found object_1, he stop and spawn bullet to object_1 until object_1 die.
I want soldier continue move to object_2 after object_1 destroy but he still stop. How can i make soldier continue moving?
B
4
S
1
Posts: 7
Reputation: 314

Post » Mon May 29, 2017 3:48 pm

If you are using the turret behavior you can check if soldier has target, if not call movement action.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Mon May 29, 2017 3:53 pm

i try to make Else statement of Hash Target but it not work.
Maybe my statement not correct.
Help me please!
B
4
S
1
Posts: 7
Reputation: 314

Post » Mon May 29, 2017 4:01 pm

Else statements don't work really well. Make the event on its own, or call it with a function I do not know how you structured your events.

Image
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Mon May 29, 2017 4:09 pm

My event
Image

How to add X (ELSE) to Turret has target??
I spend hours in google but don't find how to make Else statement like you.
B
4
S
1
Posts: 7
Reputation: 314

Post » Mon May 29, 2017 4:10 pm

Select the event right click it, and click invert.

I cant see your image btw.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Mon May 29, 2017 4:18 pm

Message: reddragon09 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
My event in link
http://imgur.com/vZhYthX

My soldier sill top after destroy object_1(tower_l)
B
4
S
1
Posts: 7
Reputation: 314

Post » Mon May 29, 2017 4:36 pm

Don't call the inverted function as a sub event. If you call it like that its never true, because the base event says turret has target and it will only trigger when it has target making the not target one always false.

Call the inverted has target on its own event and in it as sub event add the move along path and it will work.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Mon May 29, 2017 4:56 pm

Message: reddragon09 can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
Source code befor add Else statement
https://www.mediafire.com/?burx0520oaq68od
i try to add else statment but it still not working.
http://imgur.com/GpvLacJ
B
4
S
1
Posts: 7
Reputation: 314

Post » Mon May 29, 2017 5:31 pm

Here it should work now, I added extra targets and it worked fine.

https://www.dropbox.com/s/iclsxhg66m6af ... th.7z?dl=0

The problem was, the has no target function was going in endless loop, so I added trigger once when true condition and it worked fine.

Edit: I changed the capj file only, so start it from there.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Next

Return to How do I....?

Who is online

Users browsing this forum: charliesan763 and 15 guests