kmod+++

keldath

LivE LonG AnD PrOsPeR
Joined
Dec 20, 2005
Messages
7,366
Location
israel
hey all,

ive made a nice mod mod for kmod,

it does not change game play,
but it does add many useful stuff, mainly to modders,

i didnt quite know where to post this, so i decided to put it here.

credits:

karadoc...
platyping
stolenrays
the revdcm team and evolution team.
lib sp'it
and many more.
i hope people will use this.

heres the link:

http://speedy.sh/nYH3B/Kmod-v1.rar

this is the stuff i added:

Spoiler :
mod components

kmod 1.41 core.
with:
1. jculture and j improvement mods culture control is game option.
2. hated civs/favorite civs
3. fresh water mod - water from improvements + no fresh water from lakes or ocean
4. extended mountains mod - aloow pass on mountains, improvements tags and resources.
5. free tech from building tag (not implemented)
6. city unit and city size prereq (not implemented)
7. terrain health good/bad
8. unit prereq civic
9. specialist hsppiness/unhappiness
10. 50 civs on a map
11. woc tga index
12. unique civ project
13. project free unit
14. project help tag
15. kmod 1.41
16. slavery mod
17. extra pillage - 1.6
18. replaceble buildings
19. tlo promotion tags
20. natuve route mod
21. specialist civics
22. new tags from revdcm:
units:
maxerastart
statereligion
obselete unit
prereq gameoption/prereq - not gameoption
bPrereq Building Class
Prereq Building Class OverrideTec
Prereq Building Class OverrideEra
Force Obsolete Unit Class
tags for buildings:
prereq gameoption/prereq - not gameoption
23.influence driven war (sdk)optional
24. some sdk fixes from revdcm:
xienwolf fixes along the codes from revdcm
NoXP from PreReqBuildin - i dunno what it does - but it sounds good
mongoose feature fix
more stuff.
25. platypings uuuu interface
26. platyping requierment script - does not work in pedia - cause i dont know how to merge it :)
 
Nice job on the mod,

You couldnt help me (do for me) compile this new dll. I only changed one thing in cvcityai.cpp but it will only take effect after I recompile the dll which is way beyond my computer skill. I could give you a few bucks for helping me out.
 
Ok so I wanted to change the base number of ai city defenders so I changed cvcityai.cpp

int iDefenders used to be = 1 but I changed it to:

int CvCityAI::AI_minDefenders()
{
int iDefenders = 4;
int iEra = GET_PLAYER(getOwnerINLINE()).getCurrentEra();
if (iEra > 0)
{
iDefenders++;
}
if (((iEra - GC.getGame().getStartEra() / 2) >= GC.getNumEraInfos() / 2) && isCoastal(GC.getMIN_WATER_SIZE_FOR_OCEAN()))
{
iDefenders++;
}

return iDefenders;
}

Thats the only change I made to cvcityai.cpp and now I need the source recompiled into a new dll for the change to take effect, but Im completely out of my depth even with a guide. (I'm using latest version of kmod).
 
The line number is 4445 (1st change) and 4449 (2nd change) in cvcityai.cpp- I changed my mind I want there to be two changes. Ill mark them with (HERE) on the code below, but (HERE) isnt part of the changes tho. One is the idefenders value that used to be 1 that I want to be 3. The other one is an extra + sign next to "if the era >0" value.

int CvCityAI::AI_minDefenders()
{
int iDefenders = 3 (HERE);
int iEra = GET_PLAYER(getOwnerINLINE()).getCurrentEra();
if (iEra > 0)
{
iDefenders+++(HERE);
}
if (((iEra - GC.getGame().getStartEra() / 2) >= GC.getNumEraInfos() / 2) && isCoastal(GC.getMIN_WATER_SIZE_FOR_OCEAN()))
{
iDefenders++;
}

return iDefenders;
}

The code changes I made, try to force the ai to have 3 defenders minimum in its cities and then increase that minimum by 2 more if the era is beyond the first. So basically 3 to start, then 5 after the first era but the code counts the first era as the 0 era, just to clarify.
 
100% error.
There is no such thing as +++
 
Ok so clearly I wanted there to be +2 defenders if the era was >0. Perhaps Platypus could just tell us how to make it +2...

It was originally ++, which I thought was for +1 defender, so I thought +++ would be +2, but I am wrong.

After he tells us that change, I would like that change and then recompile. THANK YOU GUYS SO MUCH :D
 
x++ is a shortcut for x = x+1

So if you want +2, you either copy the whole line again, use a loop or simply write in full
 
Why you make it so hard on us noobs Platyping? :D


OK so would this work?

int CvCityAI::AI_minDefenders()
{
int iDefenders = 3;
int iEra = GET_PLAYER(getOwnerINLINE()).getCurrentEra();
if (iEra > 0)
{
iDefenders++;
}
if (iEra > 0)
{
iDefenders++;
}

if (((iEra - GC.getGame().getStartEra() / 2) >= GC.getNumEraInfos() / 2) && isCoastal(GC.getMIN_WATER_SIZE_FOR_OCEAN()))
{
iDefenders++;
}

return iDefenders;
}
 
its like Chinese for me.. i don't understand what either of the code does, im just a worker here.
w8 for merge instructions.

How about knowing this:

EraTypes:

-1 = NO_ERA
0 = ERA_ANCIENT
1 = ERA_CLASSICAL
2 = ERA_MEDIEVAL
3 = ERA_RENAISSANCE
4 = ERA_INDUSTRIAL
5 = ERA_MODERN
6 = ERA_FUTURE


Does it make more sense now?
 
It will work, but not in an elegant way.
I only teach people how to fish, but I won't provide the fish directly.
 
I guess humanity has not evolved ro the point where one thing can be explained to another.

Kedath can you make these two changes to cvcityai.cpp and then send me a recompile. Im so sorry that people are playing games and wasting time and making things harder on you. Changes in bold.

int CvCityAI::AI_minDefenders()
{
int iDefenders = 3;
int iEra = GET_PLAYER(getOwnerINLINE()).getCurrentEra();
if (iEra > 0)
{
iDefenders++;
}
if (iEra > 0)
{
iDefenders++;
}

if (((iEra - GC.getGame().getStartEra() / 2) >= GC.getNumEraInfos() / 2) && isCoastal(GC.getMIN_WATER_SIZE_FOR_OCEAN()))
{
iDefenders++;
}

return iDefenders;
}
 
Top Bottom