Only want enemies that meet conditions to fire

Get help using Construct 2

Post » Tue Feb 12, 2013 5:17 am

I have successfully setup a simple line of site system so when the player is behind a house the enemy no longer pursues the player or fires any shots. This works fine if there is only 1 archer on the play field, but if there are multiple archers they will all fire if one archer has a good line of sight. I want to make it so that only an archer with a good line of site fires.

Here is the link to my capx file: http://lewispcservice.com/downloads/dragonrage.capx

I should add in order to get an archer on the screen shoot a tree and it will spawn an archer.wslewis722013-02-12 05:20:18
B
7
Posts: 14
Reputation: 481

Post » Tue Feb 12, 2013 9:33 am

I've played around with a few things and now I am getting just 1 archer shooting at me if multiple archers are on the play field with one with line of sight and one without line of sight. The problem is it only works for the first archer that is spawned. If the second archer has line of sight and the first doesn't the second archer just stands there.

Also I discovered that if multiple archers are on the playing field and the archer is destroyed it destroys all the archers line of sights so no one can shoot then until a new archer is spawned and then whatever archer on the playing field that was spawned first will fire if there is an archer with a good line of sight.

Here is an updated capx: http://lewispcservice.com/downloads/dragonrage2.capx

B
7
Posts: 14
Reputation: 481

Post » Tue Feb 12, 2013 10:04 am

Made few fixes:

Fixed project

Few notes: You could use containers and families to simplify your project a lot, just by using those you could have 75% less events with 100% of the functionality and 200% more manageability! :)
B
24
S
8
G
7
Posts: 756
Reputation: 7,192

Post » Tue Feb 12, 2013 3:13 pm

Thank you for the assistance and the advice. It is much appreciated, you are awesome.

I'm still running on the free version until I have the cash to pick up the personal edition......then I can start putting items into families.
B
7
Posts: 14
Reputation: 481


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 20 guests