GetPlayerRoster() does not return AIs. Should it?
Moderator: Moderators
GetPlayerRoster() does not return AIs. Should it?
LolUI uses Spring.GetPlayerRoster() to get playerlist, while AdvPlayerList uses less convenient Spring.GetPlayerList(). The first one returns no AI players. Is it a bug? I miss AI players in LolUI & have to activate Advanced Player List widget.
Re: GetPlayerRoster() does not return AIs. Should it?
Would be nice if there was a way for widgets such as AdvPlayerList to get the names of the AI.
Re: GetPlayerRoster() does not return AIs. Should it?
I was thinking about it too. If Lua can't reach "ShortName" tag in [AIx] section of script.txt, then it is lobby developers who must put AI library name into "Name" key (e.g. in brackets), so there will be no need to adjust Lua widgets.
Re: GetPlayerRoster() does not return AIs. Should it?
Can't the contents of the script be caught and parsed at game-start?
Re: GetPlayerRoster() does not return AIs. Should it?
i had a look at the code, and it looks like the PlayerRoster class is only used for visualizing stuff, as in.. if we change what it contains, it would not break anything, just show different stuff here and there, so it should be safe to add AIs there. Don't know how big of a change it would be.
no part of the game should put the AI library/short-name into anything that is as easily visible as the player list though.
If you really need it there, then add it to Name yourself when you start the game in the lobby, or when you generate the start script.
there are enough ways already to get short-name, you could eg press B ingame, or use /debuginfo profiling, or /ailist.
no part of the game should put the AI library/short-name into anything that is as easily visible as the player list though.
If you really need it there, then add it to Name yourself when you start the game in the lobby, or when you generate the start script.
there are enough ways already to get short-name, you could eg press B ingame, or use /debuginfo profiling, or /ailist.
Re: GetPlayerRoster() does not return AIs. Should it?
hoijui, thank you!
As we concerned getting short name of AI i have one more question to precise your answer. /ailist & other methods you specify are built-in engine methods. Does Lua has direct access to Short Name? Or Lua scripter has to grab & parse output of the executed commands provided above?
As we concerned getting short name of AI i have one more question to precise your answer. /ailist & other methods you specify are built-in engine methods. Does Lua has direct access to Short Name? Or Lua scripter has to grab & parse output of the executed commands provided above?
Re: GetPlayerRoster() does not return AIs. Should it?
Code: Select all
int LuaSyncedRead::GetAIInfo(lua_State* L)
best is if you look at the code, cause it is not documented anywhere else. The shortName, version and options of the AI can be fetched this way, but only for local AIs, as this is unsynced data, which only the spring they run on has access to.
edit: i just see, this code seems to have a bug or two :D
Re: GetPlayerRoster() does not return AIs. Should it?
Why?hoijui wrote:no part of the game should put the AI library/short-name into anything that is as easily visible as the player list though.
I just would like to be able to write a modified AdvPlayerList widget that tells which AI it is running instead of calling every AI by the same "AI-Bot" name.
Re: GetPlayerRoster() does not return AIs. Should it?
because not all players woudl see the same thing there then, and you just said that you want a polished game. that is not something i'd call polished, if i see some internal naming on a GUI thats always visible.
it would be ok in my eyes, if it was in a tooltip, but for things like missions and stuff, you want a custom name there, like "the barbarian hordes of the east", and not "KAIK".
it would be ok in my eyes, if it was in a tooltip, but for things like missions and stuff, you want a custom name there, like "the barbarian hordes of the east", and not "KAIK".
Re: GetPlayerRoster() does not return AIs. Should it?
Ok, I can understand how letting any code redefine the language and libraries is bad. I don't see how this is related to the topic at hand however.
Since I assume AI are mostly used in single player, showing their name in single player but not in multiplayer would already be interesting.hoijui wrote:because not all players woudl see the same thing there then
Yes, I want a polished game, but going toward it incrementally. Which is just my excuse to request polish from others when it suits me and write dirty code myself when it suits me.hoijui wrote:and you just said that you want a polished game. that is not something i'd call polished
I don't mean the hard coded player list. I mean widgets player list.hoijui wrote:if i see some internal naming on a GUI thats always visible.
Yeah. But it'd be nice if I could have a widget showing the AI names no matter who created the startscript. That doesn't preclude using a better name when the widget can find a better name through custom tags.hoijui wrote:but for things like missions and stuff, you want a custom name there, like "the barbarian hordes of the east", and not "KAIK".
Re: GetPlayerRoster() does not return AIs. Should it?
i can understand you, also i for one, would alwyas like to se the AI shortName of course, casue i ma usually testing, and i know them a lot, and i would like to see which color is which AI lib right away.
but for users it is much better if name is the primary thing thats shown, as they set it themselfs in the lobby. thye might set it to KAIK 1, or to MyAllyKAIK, or to MyAlly, and when the game starts, they will see only "KAIK" there, or "KAIK 1 (KAIK)". I and others got lots of requests to make the name show up in player lists, and not the shortName.
not to say you can not use that, but that users want the name as the primary thing.
but for users it is much better if name is the primary thing thats shown, as they set it themselfs in the lobby. thye might set it to KAIK 1, or to MyAllyKAIK, or to MyAlly, and when the game starts, they will see only "KAIK" there, or "KAIK 1 (KAIK)". I and others got lots of requests to make the name show up in player lists, and not the shortName.
not to say you can not use that, but that users want the name as the primary thing.
Re: GetPlayerRoster() does not return AIs. Should it?
Well, your upcoming Lua command will return both, widget makers will then be free to use one or another or both, and player be free to choose one widget or another, or to bug widget makers into showing one or another or both.
Re: GetPlayerRoster() does not return AIs. Should it?
Actually I was just making people aware of the concept/notion of monkey patching
Re: GetPlayerRoster() does not return AIs. Should it?
AF:
Still totally irrelevant to this thread.
Anyway, Hoijui coded some nice thing:
And it actually works: startscript, widget, result.
(as long as you don't assign to a C++ AI any other version than the ones it has.
(Omitting the version field in startscript works and is safer)).

Anyway, Hoijui coded some nice thing:
Code: Select all
Spring.GetAIInfo
( number teamID ) ->
nil | number teamID,
number skirmishAIID,
string name,
number hostingPlayerID,
string shortName, (synced => "SYNCED_NOSHORTNAME"; non-local => "UNKNOWN")
string version, (synced => "SYNCED_NOVERSION"; non-local => "UNKNOWN")
table options (synced & non-local => empty-table)
(as long as you don't assign to a C++ AI any other version than the ones it has.
(Omitting the version field in startscript works and is safer)).