Colobot Wiki

The instruction drop(); instructs the bot to drop whatever the operating arm is carrying on the ground, on the platform of a building or on the power cell location of a bot.

Basic use[]

The instruction drop(); written in this form drops the object in front of the bot. Here is a short program that grabs an object in front of the bot and drops it 5 meters further:


For specialists[]


drop ( oper );

This instruction appeals to the operating arm of a grabber bot, in order to drop what it is holding.

oper: int (default valueInFront)[]

Oper indicates where the robot should drop the object. If no indication is given, the object is dropped in front of the bot. 

  • InFront     Drops in front (default value).
  • Behind      Drops behind.
  • EnergyCell  Drops on the bot's own power cell location.

Return value: int[]

Normally an error stops the program. You can prevent the program from stopping on errors by using the errmode(0) instruction. A value different from zero if an error occurred is then returned by drop();.

== 0 object was dropped

!= 0 error, no object was dropped