Colobot Forum - International Colobot Community

Full Version: Space don't work as expected
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to use goto(space(spaceShip.position)); drop(); to store Titanium Ore in my spaceship. For the first ore it works ok, but for next program ignores existence of first one trying to put second ore on place occupied by first one. I'm doing something wrong or space() is broken?
In my case third ore threw error, but I can confirm there might be something wrong with space().
At space command what means

dist: float (default value: 4)
Required distance between two free spaces.

??? I don't understand
This is the nearest place for next dropping.
From what I gather, space() searches for a free place that is a circle with given radius (the dist parameter). When a free space is found, it is guaranteed not to have any items within that circle. When searching for a space to drop items, this controls how densely they will be placed. Small radius will result in denser item placement while bigger radius will result in quite a spread. You can see how it works if you add a parameter to space() in CollectTitanium3().