Where can I find the code for this function?

Jamesds

Great Scientist
Joined
Mar 14, 2002
Messages
1,158
Location
Highlands, Scotland Uni: St Andrews
I've never really delved into Civ modding before, but in the interest of learning more about the game mechanics I've been exploring the Assets folder and checking out some of the Lua files. I've never learned Lua before, but it's similar to other languages I know so I'm fine with reading through it.

I was interested in the mechanics behind unit maintenace costs, so I checked out the Economics Advisor UI script file and found a call to pPlayer.CalculateUnitCosts() where it puts that value in the expenses part of the sidebar.

Assets\UI\InGame\Popups\EconomicOverview.lua: Line 279, Col 64:
Code:
Controls.UnitExpenseValue:SetText( Locale.ToNumber( pPlayer:CalculateUnitCost() , "#.##" ) );

It sounds like that function would explain to me everything I'm wanting to know. However, I can't find this function in the Assets folder with a simple search. Is this function, and the player class (I presume) it belongs to part of the SDK, or is it lying around somewhere for me to check it out sooner? Might it be in the SDK DLL, and if so, how should I go about reading that?

Thanks in advance!
 
:bump:

Please don't all rush to answer, you might crash the forum again ;).
 
I think all the pPlayer stuff is in the DLL, so you're going to have to wait for the SDK to come out.
 
I think all the pPlayer stuff is in the DLL, so you're going to have to wait for the SDK to come out.

That's all I was wondering, thanks :goodjob:
 
As far as I can see then it is a call to the DLL and since the SDK hasn't been released yet there is no telling exactly what it does.
 
Top Bottom