How do I select which instance to trigger action from?

Just started using Construct 2? Post your questions here

Post » Fri Dec 05, 2014 2:48 pm

Hello,

I am trying to make a bot deathmatch.
I want to be able to use as many bots as I want and have them interact and follow the same AI behaviors.
So far I get the bots to chose a random location via pathfinding and if a bot is in LOS he is tinted in red (for debug).
My problem is the following : how to I tell construct which is which? At the moment the bot that is seen is the bot that shoots a laser. I can't seem to find how to tell construct that I want the bot that has the LOS to another bot to trigger the spawn laser action.
Is there something simple I am overlooking?

Many thanks, caps enclosed.
JMF
You do not have the required permissions to view the files attached to this post.
B
5
S
1
Posts: 9
Reputation: 603

Post » Sun Dec 07, 2014 12:14 am

Look into using a bots Family
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Dec 08, 2014 2:49 pm

Yes, except that Family do not have a LOS condition for instance. So for my particular example I'm not sure it can be used. There does not seem to be a way to do this but create as many different sprites of bots that I want and code the specific events for each of then:
If bot1 has LOS to bot2...
If bot1 has LOS to bot 3...
if bot2 has LOS to bot1...
if bot2 has LOS to bot3...
etc.
Doesn't seem very code effective to do it that way.
But thanks for your help, I will keep searching.
B
5
S
1
Posts: 9
Reputation: 603

Post » Mon Dec 08, 2014 2:58 pm

You can put LOS on a Family.
ImageImageImage
B
71
S
21
G
221
Posts: 3,651
Reputation: 124,231

Post » Mon Dec 08, 2014 9:53 pm

melomaniak wrote:Yes, except that Family do not have a LOS condition for instance. So for my particular example I'm not sure it can be used. There does not seem to be a way to do this but create as many different sprites of bots that I want and code the specific events for each of then:
If bot1 has LOS to bot2...
If bot1 has LOS to bot 3...
if bot2 has LOS to bot1...
if bot2 has LOS to bot3...
etc.
Doesn't seem very code effective to do it that way.
But thanks for your help, I will keep searching.


ok good luck
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests