Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Autonauts

Make and teach robots to automate the world! · By Denki

Suggestions: functions / subroutine

A topic by huangjunwei created Nov 30, 2020 Views: 170
Viewing posts 1 to 1

Should add a new code block that act like a "function" or maybe a more basic "subroutine". This way one won't have to repeat the exact same actions and use up the limited space in the bot brain.

One great example will be when crafting:

Instead of:

Pick up stick 3 time

Put on bench 1

Put on bench 2

Put on bench 3

Pick up stone 3 time

Put on bench 1

Put on bench 2

Put on bench 3


One can simply do this:

Pick up stick 3 time

Goto "place in bench"

Pick up stone 3 times

Goto "place in bench"


Subroutine "Place in bench" :

Put on bench 1

Put on bench 2

Put on bench 3

Return


This way, one can save on bot brain storage while also keep the code more tidy by minimizing repeats.