How do I apply an event to various instances of an object

Get help using Construct 2

Post » Thu Jan 01, 2015 6:06 pm

Happy New Year to all!

I have started dabbling in Construct2 again with the Free Edition, sitting at around 40 hours usage however my time has been consumed with just trying out different mechanics and essentially learning some of the programming. At the minute I am attempting to utilise the path finding and line of sight behaviours to create a 'smart' alerting system (smart being a complete overstatement as this is probably simplistic to most people).

In my head, my problem is pretty simple but trying to find a resolution for this is proving to be a pain.

What I want to achieve is whenever the Zombie has line of sight to the player, I need the losIcon to show on each zombie that has line of sight. The way the capx is currently working is that the icon can only be show on one zombie at a time which is not intended.

Please do excuse the everything except the event sheet, the layout is terrible as I am just trying to nail down some behaviours prior to actually doing anything 'nice looking'.

Any help is appreciated! :)
You do not have the required permissions to view the files attached to this post.
Posts: 12
Reputation: 251

Post » Fri Jan 02, 2015 3:11 am

your code is pretty much just garbage, dont use "every tick" all the time and if you add "every 1 second" and put a "every tick" as a sub event it pretty much doesnt make sense because your code will only triggered every 1 sec.

Try to spawn the icon on the image point and pin it to the zombie and if its not on LOS you just unpin and destroy it. becareful to pick the zombie with "pick by uid" other wise it can happen that the wrong zombie will get the icon etc.
Read this:
yeah, i really like to say that you should "Read this:"
Posts: 138
Reputation: 1,490

Post » Fri Jan 02, 2015 2:05 pm

Hi EyeForcz,
I appreciate your honesty :).

your code is pretty much just garbage

Looking at it now, yeah you are correct having an event occur every tick within a event which is only active every second does not really compute. I have amended this and it is still working as expected.

I am now working on the LOS Icon on each individual enemy, however I am still having some problems. I shall perceiver and try to get this working, I will edit this post once either I have worked it out or I am still in dire need for assistance :)

Posts: 12
Reputation: 251

Post » Fri Jan 02, 2015 3:00 pm

C2 is going to choose the first instance closest to you to perform your "Chunk" of code to....
Need Sprites For Your Next Project?
100% Vector Animated Sprites
Posts: 170
Reputation: 1,086

Post » Wed Jan 07, 2015 5:24 pm

that's not honesty, that being a douche bag. If that's your real pic, how about you cut your hair you effin mop head? Honest?
Posts: 104
Reputation: 1,098

Return to How do I....?

Who is online

Users browsing this forum: dop2000, namaewayukidesu and 13 guests