Author Topic: Naming an AIPlayer  (Read 1739 times)

As I understand it, bots (AKA AIPlayers) can now be named.

However, I can't find the method/variable used to do this. I've tried %bot.setBotName(%name); as it seemed like the most obvious function, but it did absolutely nothing.


Note: I don't want a shapename, I just want the death message to show a bot name. Preferrably without having to hack up a new onDeath function AGAIN.

Dunno. The code for the bot's name in the death message isn't in Bot_Hole.

Maybe isHoleBot in the bot's datablock needs to be set to true?

Maybe isHoleBot in the bot's datablock needs to be set to true?

Tried that and it made every single bot disappear instantaneously. :|

Looked through the code for bots. You used the right function, just the wrong parameters.
Code: [Select]
AIPlayer::setBotName(%bot,%name);

Looked through the code for bots. You used the right function, just the wrong parameters.
Code: [Select]
AIPlayer::setBotName(%bot,%name);
Calling that method on an AIPlayer like thisBot.setBotName( thisBot , "theBotName" ); will not work because %bot is automatically filled when called by a method, so it'd just be like calling AIPlayer::setBotName( thisBot , thisBot , "theBotName" ); which will simply name the bot as either the objectID or both the objectID and the wanted name.

Xalos is calling it correctly by thisBot.setBotName( "theBotName" );.