Page 1 of 1

Generate resources in play time.

Posted: Fri Feb 21, 2014 12:09 pm
by AlexPhoenix
Hello again.
I wanna make something like resource surveing.
mainly i wanna do somethink like survey bot, but i didnot see that this is possible.

So i think about georadar.

But i cannot find, which event i must use to imitate something like scanning?(and also how to create resources)

Re: Generate resources in play time.

Posted: Fri Feb 21, 2014 2:52 pm
by ficolas
What is a survey bot?
Also when do you want to trigger this... When placing something? When an amount of time has passed?

The command to create a resource is game.createentity{name=,position=}
where name is for example iron-ore.
Also to specify the amount of ore in that ore chunk I think it is richness the field.

Re: Generate resources in play time.

Posted: Wed Feb 26, 2014 6:35 am
by AlexPhoenix
ficolas wrote:What is a survey bot?
Also when do you want to trigger this... When placing something? When an amount of time has passed?

The command to create a resource is game.createentity{name=,position=}
where name is for example iron-ore.
Also to specify the amount of ore in that ore chunk I think it is richness the field.
survey bot is bot with will scan surface for resources.
or with radar scanning, or just when new chunk generated.
will look to what i can to do.

with creating i found all i needed.
amount field is amount of ore.
dont try with oil yet.

Re: Generate resources in play time.

Posted: Wed Feb 26, 2014 2:30 pm
by FreeER
the onsectorscanned event will be raised when a radar scans and onchunkgenerated when new land is explorered, and you can find ores just like any other entity (using findentitiesfiltered{area, type="resource"}). you could create a new radar that looks like a survey bot and then move it using game.canplaceentity (so you don't land on other entities or in water) and bot.teleport(position), to find where to move it you could probably modify the A* code/algorithm from drs9999, found here. A simple entity that when placed near a bot spawns some buttons could be used to 'program' the bot for what to look for (by asking the player what resources they want to find). Oh, and you can use bot.energy=100000000 to make it act as if it has a battery (so it doesn't need to be connected to an electrical network).

Re: Generate resources in play time.

Posted: Wed Mar 05, 2014 7:19 am
by AlexPhoenix
i found another thing which is difficult for me.

when i place resource at tile, i try to use findnoncollidingposition, but resource dont block place as i see.
so there is any functions with which i can easy(and fast) find position to place resource(line findnoncollidingposition do).

or i must write my own function?(then i need to check tiles, how?)



found on dorum about game.gettile.
so looks like i will start to write my own function.