Lord Yanaek
Emperor
- Joined
- Aug 15, 2003
- Messages
- 1,662
Hi there. With few people being able to mod the C++ code, and those people having their own modding needs and limited free time, i guess if i want some modifications done, i'll have to do them myself.
That's OK except for the fact that when i mess with C++ code, i can't help but feel like a mad scientist mixing together various chemicals without knowing what they do
Of course, i know i could end up not blowing everything up
but i try to stay on the safe side by not touching it.
Now, the first thing i would need is the ability to get info from the database. I looked at an old Civ4 tuto by Kael but it was Civ4 and the database was in xml files and not SQL.
I tried to follow the track of some data used by the code (unit production cost) and i think i found it's origin in CvUnitClasses.cpp
So i searched for this kResults and found it in CvDatabaseUtility.cpp. It's also used plenty of times when accessing data that i know is in the database. Seems good so far and if there is a high level instruction available, i might be able to use it without frying my computer with bad code 
However, i see only one argument when kResults is called, and it would be the table column where the data is stored. I don't see where the table is defined. Many tables have a "Cost" column.
Am i at least on the right tracks with this kResults. I can't really find where it is defined nor what kind of code "stuff" (object being something specific) it is.
The lower the level i have to work with, the lower my chances of understanding. My hope, if i am to have some success, is to find some methods i can use because i can't write my own.
That's OK except for the fact that when i mess with C++ code, i can't help but feel like a mad scientist mixing together various chemicals without knowing what they do

Of course, i know i could end up not blowing everything up

Now, the first thing i would need is the ability to get info from the database. I looked at an old Civ4 tuto by Kael but it was Civ4 and the database was in xml files and not SQL.
I tried to follow the track of some data used by the code (unit production cost) and i think i found it's origin in CvUnitClasses.cpp
Code:
m_iProductionCost = kResults.GetInt("Cost");

However, i see only one argument when kResults is called, and it would be the table column where the data is stored. I don't see where the table is defined. Many tables have a "Cost" column.

Am i at least on the right tracks with this kResults. I can't really find where it is defined nor what kind of code "stuff" (object being something specific) it is.
The lower the level i have to work with, the lower my chances of understanding. My hope, if i am to have some success, is to find some methods i can use because i can't write my own.