Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Autonauts

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

Add Conditional If or Case Statements

A topic by Penguinmanereikel created Aug 14, 2017 Views: 968 Replies: 2
Viewing posts 1 to 3

I feel this is necessary for a game like this. I need a way to have certain steps of a program to be different under certain circumstances without having to write another loop.

For example: I want a bot that takes logs from storage, saws them into planks, but if the log storage is empty, then look for logs around the beacon next to the wood farm and get logs from there. Right now, I'd have to set an entire loop for both conditions, but an If or Case statement can help me only allow it to branch at one step of the process.

Developer(+2)

We'll be adding more script features as we go so 'if' will probably make it in. Thanks

I did that sort of thing too, chop tree, drop axe, pick up log, take to storage, pick up axe, repeat. Then i watched the guys playthrough and now my bots all have their own task and everything runs a lot smoother and it's a lot more clear what is going wrong if something goes wrong. Just saying, complexity in the bot commands is not really the way to go. It is fun though so, yeah. :D