
Any kind of suggestion is welcome - the more detailed the better.
Moderator: PPS-Leaders
No problem, inline is not required.The Jo wrote:1st attempt: XMLPortParam(ArtificialController, "level", setBotLevel, getBotLevel, xmlelement, mode).defaultValues(1.0f);
-> I didn't define the setBotLevel function as an inline function. Is that a problem?
If you add XMLPortParam in ArtificialController, you have to define level="1.0f" in the controller (note: the controller is not visible in the xml file for ordinary bots). If you want it in the SpawnPoint, you have to move XMLPortParam into SpawnPoint.ccThe Jo wrote:I added the following xml code:
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff level="1.0f" /> There is no xml parsing error but also no measurable effect, if one modifies the level value.
Two problems here:2nd attempt: SetConsoleCommand("ArtificialController", "botlevel", &ArtificialController::setBotLevel);
the command "botlevel 10.0f" doesn't work.
My next attempt: "addbots 10 botlevel 10.0f" didn't result in an error message, but the measured effect isn't what I had intended.
--> As soon as I'm done with testing, I'll post the results here.
Code: Select all
static void setAllBotLevel(float level);
Code: Select all
void ArtificialController::setAllBotLevel
{
for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)
it->setBotLevel(level);
}
Users browsing this forum: No registered users and 1 guest