Start player Golden Age via Lua?

Player:ChangeGoldenAgeTurns(numberOfturns)
 
Player:GetGoldenAgeLength() will tell you how long a "standard" GA is for the player (allows for traits, wonders, etc)
 
Not certain how either of those actually initiates a golden age. Paucity of examples in mods I've looked at and in the wiki make me puzzled about the parameters.

"Player:ChangeGoldenAgeTurns(int change)" seems to me to have to do with the length of a golden age, not the occurence of one.

"Player:ChangeGoldenAgeProgressMeter()" has no examples in the wiki and does not say what the parameters are. My guess, something to do with how soon a Golden Age will occur.

Player:GetGoldenAgeProgressMeter() and Player:GetGoldenAgeProgressThreshold may be used, but again, the wiki does not show them in use except in toppanel.lua.

Player:SetGoldenAgeProgressMeter() may be useful but I've no examples of how to use it.

I'll continue to look, but I may have to add it via a wonder. I was hoping to have a golden age initiated when a certain Project was finished, this done by lua.
 
Did you actually try it from the FireTuner console?

Players[0]:ChangeGoldenAgeTurns(Players[0]:GetGoldenAgeLength())

will start a standard length GA for player 0
 
Not certain how either of those actually initiates a golden age. Paucity of examples in mods I've looked at and in the wiki make me puzzled about the parameters.

"Player:ChangeGoldenAgeTurns(int change)" seems to me to have to do with the length of a golden age, not the occurence of one.
I can assure you that ChangeGoldenAgeTurns will trigger a golden age, I'm using it in one of my mods.
 
I've yet to figure the mysteries of firetuner :).

I usually use it to see if I've find where errors are in my code I've sweated over and created, but not to see results in real time... something I've obviously have yet to learn.

Just plopping in test code with Player (0) is something I'm unused to doing... thank-you for the example. Looks easy enough now I know it's the function I need to use. My usual method of looking for examples in the code of others sometimes fails to provide the info I need.

I saw a firetuner tutorial online, but I found that it skipped the basics of the program, and went straight to explaining how to generate code. I need a tutorial on how to use the UI first and foremost... then I can get to testing code.

Thanks for the info in any case.
 
Historical Spawn Dates

but for example:

Players[0]:ChangeGoldenAgeTurns(5)

will start a 5 turn long golden age if the player 0 is not already in a golden age
or
will add 5 turns to the current golden age of the player 0.
 
Back
Top Bottom