Wait, doesn't that just tell you who the human player is? That's what I read several times when searching the forum. Well if you say so I'll give it a shot. Thank you.
I'm afraid the event method won't do for my purposes, but good to know about the IsTurnActive method.
So if I understand things right, I could use the following as a surrogate?
Code:
function TheTurnPlayer()
for pPlayer in Players do
if pPlayer:IsTurnActive() then return pPlayer
end
end
end
That would work, but depending on how many times you call it, the following may be more efficient
Code:
local g_CurrentPlayer = 0
function OnPlayerDoTurn(iPlayer)
g_CurrentPlayer = iPlayer
end
GameEvents.PlayerDoTurn.Add(OnPlayerDoTurn)
function GetCurrentPlayer()
return g_CurrentPlayer
end
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.