How do I line of site

Get help using Construct 2

Post » Sat Jul 12, 2014 9:26 pm

i can get the sprite to change animation once im within the set pixel distance for line of sight but when i leave out of that distance it does not go back to its original animation , not sure why.?
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Jul 12, 2014 9:29 pm

Have you programmed it to return to its original animation?

A .capx or more info on your events would be helpful for us to help you.
Be nice until it's time to not be nice
B
36
S
9
G
9
Posts: 293
Reputation: 6,662

Post » Sat Jul 12, 2014 9:31 pm

B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Jul 12, 2014 9:31 pm

line 224 is what im referring to
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Jul 12, 2014 9:52 pm

yea you were right about it needing a animation change once animation is finished....


some odd reason i just expect the states to go back to the original states before the line of sight is activated.
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Jul 12, 2014 10:58 pm

so i got that to work now...

now I am having a picking issue...when the idle sprite gets within sight of the Chesnut sprite the first one switches
animation but then i go to the other ones that i copied and pasted from within the editor do not change animation..

i never know how my picking order should be...

Image
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Jul 12, 2014 11:37 pm

Picking order doesn't matter; you will still end up with the same objects. Each condition is like a filter that reduces the number of objects that are picked. The exception is Pick All, which resets the picking and so increases the number of objects picked. You might sometimes need this in sub-events. Definitely re-read the manual section on Events that describes this if you're unclear on picking.

So event 25 is saying

"Filter out all chesnut objects except the nearest one to an Idle object, but only if it has LOS to an Idle object; then, for each one that is picked (if any; in your case there should be 0 or 1) set its animation to 'chesnutAttack'"

So when you say "the other ones... do not change animation", are they not following your logic (above)?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Jul 12, 2014 11:39 pm

exactly, ill destroy the first one and then go to the next one and nothing happens, no change in animation.
B
9
S
2
Posts: 272
Reputation: 1,632

Post » Sat Jul 12, 2014 11:57 pm

So without the full capx it's difficult to know what you mean by "ill destroy the first one" (like, which objects you're referring to). Sorry but like this it's a guessing game for me.

If you're destroying the chesnut objects then if your event 25 is on every tick (i.e. not a subevent) then I would expect the nearest chesnut with LOS to Idle would be destroyed, then again on the next tick the nearest one with LOS is destroyed... etc. If this is not occurring, make sure there is actually an object with LOS (is the animation changing to attack?).
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Jul 12, 2014 11:59 pm

B
9
S
2
Posts: 272
Reputation: 1,632

Next

Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, ketramtu18, XMatrix, Zav and 9 guests