Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - Creation & Customization

Notices

Reply
 
Thread Tools
Old Sep 26, 2010, 02:19 PM   #1
Jamesds
Great Scientist
 
Jamesds's Avatar
 
Join Date: Mar 2002
Location: Highlands, Scotland Uni: St Andrews
Posts: 1,158
Images: 1
Where can I find the code for this function?

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!
__________________
"You don't stop laughing when you grow old, you grow old because you stop laughing" - M Pritchard
Economic Left/Right: -1.38 || Social Libertarian/Authoritarian: 2.10
Jamesds is offline   Reply With Quote
Old Sep 27, 2010, 07:11 PM   #2
Jamesds
Great Scientist
 
Jamesds's Avatar
 
Join Date: Mar 2002
Location: Highlands, Scotland Uni: St Andrews
Posts: 1,158
Images: 1


Please don't all rush to answer, you might crash the forum again .
__________________
"You don't stop laughing when you grow old, you grow old because you stop laughing" - M Pritchard
Economic Left/Right: -1.38 || Social Libertarian/Authoritarian: 2.10
Jamesds is offline   Reply With Quote
Old Sep 27, 2010, 07:16 PM   #3
Kobata
Chieftain
 
Join Date: Sep 2010
Posts: 10
I think all the pPlayer stuff is in the DLL, so you're going to have to wait for the SDK to come out.
Kobata is offline   Reply With Quote
Old Sep 27, 2010, 07:17 PM   #4
Jamesds
Great Scientist
 
Jamesds's Avatar
 
Join Date: Mar 2002
Location: Highlands, Scotland Uni: St Andrews
Posts: 1,158
Images: 1
Quote:
Originally Posted by Kobata View Post
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
__________________
"You don't stop laughing when you grow old, you grow old because you stop laughing" - M Pritchard
Economic Left/Right: -1.38 || Social Libertarian/Authoritarian: 2.10
Jamesds is offline   Reply With Quote
Old Sep 27, 2010, 07:22 PM   #5
CyberChrist
You caught my attention
 
CyberChrist's Avatar
 
Join Date: Dec 2001
Location: The Matrix
Posts: 1,381
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.
__________________
CyberChrist
CyberChrist is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION V > Civ5 - Creation & Customization > Where can I find the code for this function?

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 04:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR