What am I doing wrong with this Lua variable?

Enginseer

Salientia of the Community Patch
Supporter
Joined
Nov 7, 2012
Messages
3,670
Location
Somewhere in California
Code:
pPlayer:DoStartEvent("GameInfoTypes.PLAYER_EVENT_" .. GameInfo.MinorCivilizations[minorPlayer:GetMinorCivType()].Type)

I know pPlayer:DoStartEvent has no errors because it works with anything in the database.. but I'm having issues with the identifiers. I'm trying to make it identify the variable as GameInfoTypes.PLAYER_EVENT_MINOR_CIV_SOMENAME, but rather I think the Lua is only understanding GameInfoTypes.PLAYER_EVENT_ and just leaving the rest of GameInfo out. What am I doing wrong?
 
I'm pretty certain the issue is that you should be doing:

Code:
pPlayer:DoStartEvent(GameInfoTypes["PLAYER_EVENT_" .. GameInfo.MinorCivilizations[minorPlayer:GetMinorCivType()].Type])
Ah of course that makes sense! Thanks!
 
Top Bottom