Gathering Minerals... Some Instances Ignored

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

    Thanks!

    http://dl.dropbox.com/u/76227787/GatheringMinerals.capx

  • <img src="http://i.imgur.com/yqLi9Xu.png" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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="http://i45.tinypic.com/10zn78w.jpg" 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)