[SOLVED] [SOLVED] Renaming bots? (In the debugger)

Ask questions, discuss ideas, get answers

Renaming bots? (In the debugger)

Postby Skull Kid » Thu Jun 07, 2018 6:13 pm

Alright, I searched the forums for this, but couldn't find anything related to renaming bots. I've successfully been able to spawn vehicles in the debugger, reassigning bots from Axis to Allies, and vice-versa. But I have yet to find out how to rename bots.

I tried in the console with the "player.name" command. It doesn't seem to work though… as it says "property is readable only.".
Last edited by Skull Kid on Sat Jun 09, 2018 6:34 pm, edited 1 time in total.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 111
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Renaming bots? (In the debugger)

Postby russ » Fri Jun 08, 2018 5:10 pm

The Player.name method is read-only, there's no way to get around that. game.changePlayerName initially looked promising, but is unimplemented. The Object.name method cannot be used because a BFPlayer is not part of the object system.

game.addFirstNameOnTeam/game.addSecondNameOnTeam can of course be used for randomly generated names (along with setRandomNames)

Normally bots are created automatically, but you should be able to also create them with game.createAIPlayer game.createUnspawnedAIPlayer. These might let you set whatever names you want.

http://www.battlefieldsingleplayer.com/ ... t3527.html
mdt/scripting/Game/Properties/CreateAIPlayer.html
mdt/scripting/Game/Properties/CreateUnspawnedAIPlayer.html
russ
 
Posts: 42
Joined: Sun Oct 29, 2017 8:12 am

Re: Renaming bots? (In the debugger)

Postby freddy » Fri Jun 08, 2018 8:18 pm

There is some command to spawn a bot, forgot the exact command but something like ai.spawnbot "value" "value" "value" (team, name, class i think)

But if you only want to change the bot name once and for all you can use this method directly in your map.

Code: Select all
game.addFirstNameOnTeam 1 -BOT-
game.addSecondNameOnTeam 1 SUM_DUM_FUK
game.addSecondNameOnTeam 1 SUK_MI_WONG
game.addSecondNameOnTeam 1 NEEPO_ZEEPO
game.addSecondNameOnTeam 1 BOOZE_LEE
game.addSecondNameOnTeam 1 YAMA_MORAN
game.addSecondNameOnTeam 1 SUKEE_FUKEE
game.addSecondNameOnTeam 1 MEE_WON_NOOB
User avatar
freddy
 
Posts: 1228
Joined: Sun Oct 18, 2009 4:58 pm

Re: Renaming bots? (In the debugger)

Postby russ » Fri Jun 08, 2018 10:24 pm

BTW, what is "the debugger"?
russ
 
Posts: 42
Joined: Sun Oct 29, 2017 8:12 am

Re: Renaming bots? (In the debugger)

Postby Skull Kid » Sat Jun 09, 2018 12:36 am

russ wrote:BTW, what is "the debugger"?

It is an exe called "BF1942_r" as far as I know.

EDIT: Now I am facing a new problem, how I remove bots.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 111
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Renaming bots? (In the debugger)

Postby russ » Sat Jun 09, 2018 8:36 am

Can you be more specific on the removing? What goal are you trying to accomplish? I don't think removing bots from a running round is possible. The only way I've seen it happening is when a bot dies, a check is made to see if the number of players is greater than the max number of players. If so, and the bot is on the team with more players, the bot is removed. You might be able to script this into happening, but it'd be very racey.

Bots can be deactivated, but I'm not sure what that state means.
russ
 
Posts: 42
Joined: Sun Oct 29, 2017 8:12 am

Re: Renaming bots? (In the debugger)

Postby Skull Kid » Sat Jun 09, 2018 8:54 am

Well... my goal was to spawn an enemy bot on a local server that would battle against me, with me deciding the kit, and the name.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 111
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Renaming bots? (In the debugger)

Postby Skull Kid » Sat Jun 09, 2018 5:26 pm

This is the error I get when I type the following game.createAiPlayer "Boris Borisenkov" 2 Assault
Attachments
2018-06-09.png
2018-06-09.png (6.73 KiB) Viewed 648 times
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 111
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden

Re: Renaming bots? (In the debugger)

Postby Skull Kid » Sat Jun 09, 2018 6:33 pm

Okay... I don't have a clue what I did… but now it just worked. I must have changed from Conquest to Cooperative… that was the issue then. My bad.
Regards,

Skull Kid
User avatar
Skull Kid
 
Posts: 111
Joined: Fri Aug 03, 2012 8:44 pm
Location: Sweden


Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 14 guests