[SDK MODCOMP] Civ4 Core Community Project v1.0

Status
Not open for further replies.
The mod will have no effect unless the Commerce tags are expanded, if Civ4TechInfos is altered to give one or more Techs the <CommerceFlexable> you can alocate Commerce towards the new Commerce types. Alternativly any thing in the game that adds commerce with tripple <iCommerce> tags can create the new Commerce types, simply extend them, the order is as follows. Note that experience dose not yet do anything, its intended to be used for Python moding.

Gold
Science
Culture
Happyness
Health
Experience
My question is regarding this: what if I want a technology to give experience to my units? I don't quite understand what you mean by the 6th commerce tag not working, and it only being meant for python modding. Were any functions added for that purpose? How can I take advantage of experience as another form of commerce?
 
You would need Mod something like a Building or Specialist to give it an output of Experience Commerce, its a simple as adding some more <iCommerce> tags ware normaly only 3 would be allowed you can have up to 6, the 4th and 5th have been coded to give happyness and health and they do this at the SDK level without you needing to do anything other changing the XML.

<Commerce>
<iCommerce>0<iCommerce> (gold)
<iCommerce>0<iCommerce> (science)
<iCommerce>0<iCommerce> (culture)
<iCommerce>0<iCommerce> (happyness)
<iCommerce>0<iCommerce> (health)
<iCommerce>1<iCommerce> (the 6th one is experience)
<Commerce>

I chose to use little muscular arm strength icon for experience, somone can design something better I woulc be glad to switch it. It will apear in the spot that the gold/science/culture icon would othwise have been (health and happyness also display their assosited symbols)

Then to write a Python mod and call CyCity::getCommerceRate(5) to get its output, use that number in any way you like, their have already been a couple of mods that are designed to let buildings like Barracks slowly train the units in the city, but they have to crudly hack the quantities of experience in by calling CyCity::hasBuilding("Barracks") and other such stuff, it was messy and hard for other people to modify later. Now the input values can come out of XML so their easy to play with, In addition the output can have bonuses just like any other form of Commerce.

I intentianaly left out having any effect because I knew the method of experience gain would have to be more sophisticated then simply adding the value directly to the units exp (that would give you rediculusly elite units even if they got 1 point per turn). So it will inevitably be a lot of testing and tweeking to get these exp mods to work correctly and it wont be feasable to redo them at the SDK level everytime.

If you want to have a tecnology give Exp and you can manage the Python Moding or even easier if you hack one of the existing Training Mods you could create an unbuildable Building (cost -1) and give it some Exp output. Then use my <FreeWithTech> tag to give that building in all Cities when the Tech is discovered (the Building should list that tech as its Prerequisite as well). Then you Python mod reads the Commerce and fires off its exp effects. If your looking for a one time effect then that would again be a simple Python script firing at onTechAchived and you realy wouldnt need any of these features as they are all geared to an Exp over time effect.
 
Ah, I see now ... you wanted to keep it open for modders to set their own usage of the exp, and as you said since these are geared towards continuous use it would be too overpowered to give +x exp every turn.

Thanks for the clarification (although I'de still like a one time exp boost given by a tech as set in a new XML tag, hehe).
 
That could thoreticaly be done but I would think it would make a bit more sense (and be more fun) to give every unit a FreePromotion rather then Free Exp. It would be like that Revolutionary war senario when Laffeyet joins your side and all your continental Regulars get a promotion. Their could be options for <UnitClass> and <PromotionType> if their not used the game defaults to all units and an unalocated (aka the Blue Glow). I might get around to moding that someday but not any time soon.

As I said just use Python to fire off the effect.
 
This is cool cool cool.

I got a good's night sleep, and girded myself for battle. I took another attempt at installing. And it worked easily. Impaler, I love your new trait stuff (especially Charismatic and Seafaring)... this is going to help my mod immensely.

By the way, something I noticed. I assigned the Charismatic trait to one of my leaders, and when I hovered over a city, the bonus had worked: +2. When I hovered over, I saw this:
+1: Some buildings are making us happy
+2: Our leader is awesome!
+5: Difficulty
+2: OH YEAH!

It still displayed correctly as 8 happies, but that OH YEAH thing was still there.

Thanks again for the great work.
 
I was just reading what you guys have written, and I thought of an idea to allow buildings to still give experience.

I'm not much of a modder; i've modded some of the XML files in my own game and i've combined a multiple of mods that I liked the sound of, but i've never made my own mod. I certainly don't understand what you guys mean by an SDK or anything like that though. :blush:

Anyways, what if you set the experience levels to eg. x10? That way, even if your units got 1 exp point per turn, it would still take a long time for your units to increase in level - especially for elite units.

...You'd have to increase actual battle experience by the same amount to balance it out though. I'm not sure if doing this part is possible or not - like I said, i'm not much of a modder. :blush:
 
The water animal change is definatly a good mod and its not a lot of code either, it will probably get rolled in with other mods by Lopez rather then be added piece-meal, as TGA says were aiming for another version very shortly with a lot of realy neat Python Eventmanager and Option control code by SimCutie. As we will be focused on that I am not shure we will get it in the next release.

Thanks for the reply erikg88, I think I know the source of the incorrect text your getting their, the Awsome leader bit is produced by directly checking the leader for any Happyness modifying traits and getting a sum of the total. The OH YEAH I belive is the Player global Happyness bonus usaly used for stuff like NotraDame and FutureTech. My Charismatic trait works by adding to this value, I just need to subtract Trait Happyness that was found in the first check to return this to its proper amount and it should display correctly.

Play around with the Traits yourself (negative happyness, diplomacy should work, unfortunatly right now the vote modifier is buged, everyone with out it will have 0 votes, I have already got it fixed in the code for next release).

I'm also interested in proper balance for Progressive (Inspired by Sevomod trait of the same name but sligtly reduced effect, he gives the free specialist only once the city reaches a certain size and use only a 15% on the Scientific trait) as it was my intent to beef up all Traits I hope Progressive and Scientific are not unbalanced, if it is I would beef the other traits more.

Matress: The numerical values for each experience level are from what I have read heald in a Compiled PythonFile and are thus very difficult (though not impossible) to mod. At 10:1 ratio I think just strait adding of the exp to the unit would be balanced or atleast close to balanced. If someone wants to do this by all means go for it.
 
Impaler[WrG] said:
Matress: The numerical values for each experience level are from what I have read heald in a Compiled PythonFile and are thus very difficult (though not impossible) to mod.
I'm pretty sure you can change the experience values needed using this function in CvUnit.cpp:
Code:
int CvUnit::experienceNeeded() const
{
	return ((getLevel() * getLevel()) + 1);
}
 
[QUOTE='Impaler[WrG]
I'm also interested in proper balance for Progressive (Inspired by Sevomod trait of the same name but sligtly reduced effect, he gives the free specialist only once the city reaches a certain size and use only a 15% on the Scientific trait) as it was my intent to beef up all Traits I hope Progressive and Scientific are not unbalanced, if it is I would beef the other traits more.
[/QUOTE]

Another idea for Progressive is to allow the XML file to set the type of specialist and then you can add in your own kind of specialist for each progressive city. Allowing the XML to set what pop the specialist comes into play would be great as well
 
Ok, I wasn't sure if I should use this thread to post a suggestion, or the one on the main C&C page, but this is more current so here it goes...

I'm not sure how easy or hard it is, it might be trivial, but I don't think this exists currently in the game. What I'd like to see is buildings having a one time effect, kinda like the culture boost that the GA gives. This "one time" will happen on the turn that the building (most likely a wonder really) is built. The thematic reasoning for this is that the completion of some particular building/structure is a big achievement and is a "global" event.

So, in game it will (for the above example) give a culture boost, maybe money, but of course any effect should be possible. After that the building gives the usual bonuses.

This maybe could also be expanded such that the effect can only happen once in a game. So if it's tied to a national wonder, there'd be a reason to build it first, though this probably something that the AI wouldn't understand, at least not "out of the box".

Oooh, and also, I'm thinking something like this could be added to the Manhattan project with a chance of an event that causes radiation (less than successful A-Bomb experiments). Although, of course at this point we're not just talking regular one-time effect but rather one-time anything... I'll stop babling now. :)
 
I'm pretty sure a wonder already gives a one-time pop boost across your civilization. Hanging gardens I think.

What would happen when the wonder became obselete? Would the bonus be reversed?
 
The Great Apple said:
I'm pretty sure a wonder already gives a one-time pop boost across your civilization. Hanging gardens I think.

What would happen when the wonder became obselete? Would the bonus be reversed?
Hmm, HG does have that +1 pop thing, but I always thought it ment your cities can have one more pop w/o any affects on health (i.e. that's on top of the health bonus). Can this be extended to other stuff?

I don't have the XMLs in front of me but I bet that for HG it's a unique tag in XML, something like <iIncreasePopulation> and not something expandable like for example
Code:
<OneTimeBonus>
    <iIncreasePopulation></...>
    <iIncreaseCulture></...>
</...>

As for bonus reversing, no, why should it? I mean the way I see it, wonders don't become obsolete themselves, rather their effects become obsolete because whatever they were "doing" is no longer needed due to new technologies. (Btw, do wonders stop contributing culture and/or GP points when they become obsolete?) Anyway, in this case the bonus is one time because it's a result of the completion of the project and what happens with the wonder after that shouldn't affect it.
 
Jolly good show, you lot. Keep pumping out the goodness. However, happiness is the proper spelling.

Also I love the abbreviation: CCP ~~ CCCP

Tickled my funnies to no end.
 
The Unique Units for Leaders mod is ready for next release and is merged onto the SourceForge CVS, I am now working to incorporate Dale's Bombardment mod with significant modification to it so it will be fully XML controled. Rather then replacing the reduce fortifications ability of units their will be 2 seperate abilities Bombard and Reduce either of which can be done at a distance and can be turned on or off in XML independently. Without any changes the artilery units will default to range 1 fortification reduction.

I was also toying with the idea of making units that have a bombardment range unable to attack by normal means, they would ONLY bombard. What do people think of that. It would nessesitate the ability to fully kill units using bombardment, perhaps only units in a City are given a basment health loss from bombardment of the basement is determined by the defense modifier of the square (I am thinking basment of half the tiles defense modifier so 100% defence = maximum of 50% damage from bombardment)

WR: I could see something like this being done with a new Tag <CultureOnBuild> or such but I dont realy see many people using it. An alternative idea, using the regular culture value of the wonder and multiplying it by some value we put in global defines (so just put a zero their to get nothing) and giving that as a Culture Bomb at completion. That way you get an Across the Board change to all wonders and they give you border pops like everyone is flocking to your Civ because they are in Awww of the Wonder.
 
Impaler[WrG] said:
WR: I could see something like this being done with a new Tag <CultureOnBuild> or such but I dont realy see many people using it.

I'd personally use this it opens up a really great kind of option for wonders.
then again i am kind of a culture nut
 
Well in that case I will have to reconsider and put this on my TODO list (their are several little things their already). I might actualy make it <CommerceOnBuild> and allow all forms of Commerce to be given as a one time bomb, so you can have a Gold bomb and a Science Bomb. It would even synergize with my expanded forms of Commerce (though I cant realy see the benifit of a onetime Health or Happyness effect :crazyeye: )
 
Impaler[WrG] said:
Well in that case I will have to reconsider and put this on my TODO list (their are several little things their already). I might actualy make it <CommerceOnBuild> and allow all forms of Commerce to be given as a one time bomb, so you can have a Gold bomb and a Science Bomb. It would even synergize with my expanded forms of Commerce (though I cant realy see the benifit of a onetime Health or Happyness effect :crazyeye: )

although i think most of us could see the benifit of a one time XP effect (assuming it worked)
 
Impaler[WrG] said:
Well in that case I will have to reconsider and put this on my TODO list (their are several little things their already). I might actualy make it <CommerceOnBuild> and allow all forms of Commerce to be given as a one time bomb, so you can have a Gold bomb and a Science Bomb. It would even synergize with my expanded forms of Commerce (though I cant realy see the benifit of a onetime Health or Happyness effect :crazyeye: )
What about an automatic, and free, upgrade to all the units, would that be possible?

Depending on how flexible the implementation there are tons of things that could be added. For example, the effect could be that it immediately improves relations with other civs. It could be used to change whole sections of terrain, i.e. change the climate - I think there's something like that in FFH so it'd be cool if that ability is "generalized" and put in as an XML tag.

What about, and I'm really reaching here, calling a python function from XML, is that possible? What I'm thinking of here is basically an XML tag that calls a python file, or function, or both (like the art tags calling NIFs), which would be executed when the event associated with that tag happens.
 
I had some ideas that I've discussed in private and I was advised to bring it up for discussion here in this thread, so here goes:

I was thinking that Python offers a great deal of functionality that is not available in Civ4. Right now, I'm wondering whether we can pull external modules and such into the game that would let us develop more sophisticated GUIs for the game.

In particular, Python CAN with OpenGL produce 3D graphics, and so it makes me wonder if it would be possible to produce 3D graphics in the game (with a widget or something) that might not be available since we don't have access to the graphics engine. Now, in discussion, it was decided that even if this could work, it would probably be resource intensive to be running two graphics engines at once.

Other ideas I've been consider are an in-game web browser and drag-and-drop capabilities that could be used for inventories and cargos. Right now the drag-and-drop would not be terribly useful with the standard game, but with all the new mods coming out, surely some of them would find this functionality a godsend. There ARE Python packages that can add both web browsers and drag-and-drop to an interface but I'm not sure how or even if these can be added to the game. And if these packages cannot be accessed within the game, could it be possible to add the functionality somehow?

These are thoughts and questions I've been having and I figured that I should take it to the experts... please, feel free to disappoint me... :)

(P.S. I'm not necessarily asking you guys to do it. Merely to comment on the feasability of doing any or all of these things.)
 
Status
Not open for further replies.
Back
Top Bottom