0 Favourites

How do I select which instance to trigger action from?

  • 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

  • Look into using a bots Family

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • You can put LOS on a Family.

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,136
karshinkoff's avatar
karshinkoff
Unread hot topic
94 21,753
LaDestitute's avatar
LaDestitute
Unread hot topic
0 Favourites
[Plugin] instance bank2
85 18,368
rexrainbow's avatar
rexrainbow