Checking spectators doesn't work for specs who have always been specs
Posted: 16 Sep 2018, 07:23
So evo has a lot of audio/visual prompting. This can be annoying for spectators, especially spectators who are catching up to a game that is already in progress.
So, this works perfectly if the person was previously a player and is now a spectator. But if the person was always a spectator, it doesn't take any effect at all. How can I just check if the person is a spec, regardless of whether they were originally a player or not.
So as I was writing this post I had an idea:
So I then pushed this, and make a game between 2 null ai and myself as a spec and launched the game. Echo for prompts was 0, SUCCESS! But wait... as soon as I selected a unit on the field it changed to 1, and then when I selected the unit from the OTHER team, it was 0 again... what in the hell???
I fully recognize that this is likely because a widget used for spectating is likely getting cute with getplayerinfo. My question is, is there any way for me to work around it?
Code: Select all
if n%30 == 1 then
local myteam = Spring.GetMyTeamID()
local _, _, spectator = Spring.GetPlayerInfo(myteam)
--Spring.Echo(spectator)
resourcePrompts = Spring.GetConfigInt("evo_resourceprompts", 1)
simplifiedResourceBar = Spring.GetConfigInt("evo_simplifiedresourcebar", 1)
--Assume that if it isn't set, resourcePrompts is true
if resourcePrompts == nil then
resourcePrompts = 1
end
if spectator then
resourcePrompts = 0
end
--Spring.Echo(resourcePrompts)
end
So as I was writing this post I had an idea:
Code: Select all
if n%30 == 1 then
local myteam = Spring.GetMyTeamID()
local _, _, spectator = Spring.GetPlayerInfo(myteam)
--Spring.Echo(spectator)
resourcePrompts = Spring.GetConfigInt("evo_resourceprompts", 1)
simplifiedResourceBar = Spring.GetConfigInt("evo_simplifiedresourcebar", 1)
--Assume that if it isn't set, resourcePrompts is true
if resourcePrompts == nil then
resourcePrompts = 1
end
if not spectator then
resourcePrompts = 1
else
resourcePrompts = 0
end
Spring.Echo("I herd u liek prompts!")
Spring.Echo(resourcePrompts)
end
I fully recognize that this is likely because a widget used for spectating is likely getting cute with getplayerinfo. My question is, is there any way for me to work around it?