12-22-2016, 02:41 PM
All public names in CBot (both for functions and classes) are shared between teams. We know this can cause name collisions, especially if you try to load the same programs for both teams, and it will be fixed in the future. See https://github.com/colobot/colobot/issues/526. There is also https://github.com/colobot/colobot/issues/697 for when you just want to use classes to organize things in the code and not for sharing data between robots.
Using factory() with function name actually just makes it run a program that looks something like that:
so it follows normal rules of calling public functions. An alternative is to provide a filename to load (I actually don't even remember where does it load the file from myself, but I think it's the "files" directory, the same one that is used when reading/writing files with CBOT) or full program code.
Using factory() with function name actually just makes it run a program that looks something like that:
Code:
extern void object::Autogenerated()
{
FunctionNameHere();
}