Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking used objects. (ore that was moved)
#1
I am working on the code for a bot, that will be automatically drag a titanium ore to a specific destination (for instance flag, or even better just destination (z,x,y)), find a free space, and go to the next chunk.
And repeat this till the end of times Big Grin.

But i got a problem. Is there any way to check, was this specific piece of rock was already taken by my bot, or not?
I think there is a way - i have to make an Array and add every ore that was moved, and after that check the whole array, before choosing a next target.

But there is some flaws. Let's imagine making check by destination (z,x,y), if ore was moved by me(or another bot) bot would be think that it's a new piece of ore.
if use checking by reference to an object (a piece of ore) to it could to error if this or is consumed (to make a new bot for instance).
How do you advise me to make a program, without using radar function, and playing with its angle parameter.
Main idea for this bot - to only once touching one piece if ore and forever forget about of it.


And last but not least - is there any way to save this information. Just imagine there is some kind of glitch and i have to restart bot's funtion.
And it will completely incredible if there is a way to share this information beetwen different bots. For instance i have 2 bot's that collect ore at the same time


P.S.
Is it possible to make a bot to build something in company mode?
#2
(07-02-2016, 01:24 PM)clop1000 Wrote: Is it possible to make a bot to build something in company mode?

build(); function is available for Grabber bots. In future it will be for Builder bots, but for now Grabbers do this.

(07-02-2016, 01:24 PM)clop1000 Wrote: And last but not least - is there any way to save this information. Just imagine there is some kind of glitch and i have to restart bot's funtion.

I think this is possible with public classes, but I don't know how it exactly works. Somebody else should explain that.
Spoiler :
[Image: unknown.png]
#3
I'm gonna take my opportunity to curse dynamic id system. Should every item get static id, like in original Colobot, you could save list of id's of Titanium which was moved.
"Deep within all of us lives an idiot, and if you let that idiot dictate your decisions your live is going to be rough."
~ Ryan Letourneau, 2k15
#4
(07-02-2016, 02:53 PM)radioactivity Wrote: I'm gonna take my opportunity to curse dynamic id system. Should every item get static id, like in original Colobot, you could save list of id's of Titanium which was moved.

Yeah. If there had been such this i would have been much more easier to realize that.

Maybe just try to check by reference?
#5
There are static IDs added in Gold. Check object.id. You can use that number to get a specific object using retobjectbyid().
#6
(07-02-2016, 07:47 PM)krzys_h Wrote: There are static IDs added in Gold. Check object.id. You can use that number to get a specific object using retobjectbyid().

This is like 8th time I ask for feature and It already exists in game. How do you do it?
"Deep within all of us lives an idiot, and if you let that idiot dictate your decisions your live is going to be rough."
~ Ryan Letourneau, 2k15
#7
(07-03-2016, 02:13 AM)radioactivity Wrote:
(07-02-2016, 07:47 PM)krzys_h Wrote: There are static IDs added in Gold. Check object.id. You can use that number to get a specific object using retobjectbyid().

This is like 8th time I ask for feature and It already exists in game. How do you do it?

I just add random things that sometimes happen to be useful later Tongue


Forum Jump:


Users browsing this thread: 1 Guest(s)