12-25-2016, 02:29 PM
Hello!
I've returned to Colobot after many years when I saw new feature - Bot Battles.
So, I've instantly tried to build my own program:
So, I'm having error concerning 'util' not declared in OreCheck() altough I've declared it in OverlordAI01A(). Conclusion is that stuff declared in one block is unavailable to the other blocks, which sucks, as I'm using coordinates based system for building and having a colossal brick of position data at the very start of my program generates total mess (that's the PosLog() in first block, which will be unavailable for the rest of the program, I guess).
So, how to allow all blocks to use declared positions, objects etc. from any other block?
I've returned to Colobot after many years when I saw new feature - Bot Battles.
So, I've instantly tried to build my own program:
Code:
extern void object::OverlordAI01A()
{
object util;
int c;
PosLog();
OVBuildInit();
}
void object::OreCheck()
{
util = radar(TitaniumOre, 0, 360, 0, 100);
if(radar(TitaniumOre, 0, 360, 0, 100) != null)
{
c = 1
}
else
{
c = 0
}
}
void object::BuildInit()
{
build(Converter);
OreCheck();
util.position = orepos;
while(true)
{
if(c = 1)
{
goto(orepos);
grab();
turn(180);
break;
}
else
{
turn(180);
while(c = 0)
{
wait(0.1);
}
break;
}
break;
}
}
So, how to allow all blocks to use declared positions, objects etc. from any other block?
Si vis pace, para bellum.