Gathering Minerals... Some Instances Ignored

0 favourites
  • 5 posts
  • Hi guys,

    I'm having a headcache when i'm figuring out how to make it perfect AI when each servbots should gather minerals togheter and don't ignore, this .capx is wrong because some servbots move and ignore gathering minerals.

    I'm looking best practices and remove their "ignorance" when they encounter minerals

    It spawns a servbot, wait to gather a mineral, everything works if is only one instance

    But multiple instances, when other servbots are gathering and spawn another servbot, then walks and ignored minerals to gather.

    Would you help me?


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • <img src="" border="0" />

  • Joannesalfa - the trigger once condition in setting the state is what's doing it, because it's telling it only do this once. so once they have been set to "harvest" and that becomes untrue and then true again it will not re-reset to harvest and will keep walking. i think anyway, this fixes it:

    <img src="" border="0" />

  • Thanks wretchedshark, there another irregular, disable every 2 seconds to spawn servbot, create 1 servbot, watch Minerals Collected: # looks pretty normal, but spawn another servbot, it looks very irregular, it shouldn't generate more 50 minerals than 20 per gathering.

    Do you know what i mean?

  • Joannesalfa - trigger once doesn't always work as expected, also triggering minerals added by animation frame leads to weird problems. because every tick that it's on that animation frame it will continuously add 10 minerals.

    you can try adding a harvest time variable that counts down every dt while harvesting and then when it = 0 > add 10 minerals > reset harvesttimevariable

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)