Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(3 edits)

Repeat loops don't work (Version 3)

Example:

  • Forever


    • Repeat until hands full
      • Move to General Storage
      • Take from General Storage
    • Repeat until hands empty
      • Find nearest Tree Soil
      • Mode to Tree Soil
      • Use held item

Start : a bot with empty hands next to a Storage with wooden shovels in the middle of tree soils

=> the bot move to the storage, take the shovel and loops forever at the first repeat

If you remove the first repeat, the bot will loop forever at the second repeat even if its shovel break (and it'll walk around with a white and red circle on its head). The behaviour of the bug is like the condition is only tested at first.

The repeat loops and forever loops do work properly because I have been using them perfectly fine. Make sure things are inside the loops not under them. That might help.

°Forever

     °repeat until hands empty

          -Find tree soil

          -Move to tree soil

          -Use item

     (End of repeat)

     -Find nearest shovel

     -Move to shovel

     -Pick up shovel

(End of forever)




This is what my digger bot's script looks like.

Mr_Mobius_Your script didn't work. The bot has nothing in its hands (and inventory) and it is stuck in the first loop.


This works for me, but I have them grab it off of the ground instead. :/

(1 edit)

Ok. Sometimes, save/load unlock the situation

Good, because I see nothing faulty with the script... good work!

(8 edits)

TheRuinGuardian21, I wrote what I done ;) (Judy is the blue bot and it's stuck at the first loop with a shovel in its hands)


EDIT: I think I understand the issue. The "hands is full" just test if there are empty slots in hands, not if the bot could take more in hands (that is a mistake in my guess). If the bot cannot take another thing, then the hands must be consider as full.


EDIT2: For logs, there are still empty slot and the bot is not stuck with the "hands full" test. So maybe it's specific with tools.

One can only carry one tool in their hands, and it takes up one out of the bots 6 slots, so of course its hands are not full, hence why it keeps trying to take more tools.