Quick Modding Questions Thread

ok i got it.
in this case, does this mean that:

<iMonthIncrement>1</iMonthIncrement>
<iTurnsPerIncrement>156</iTurnsPerIncrement>

game slows down to 1 month per turn? I thought 1 year was the smallest. I guess I never played that far yet :D

:yup: you're right here.
But not sure if everything <12 works.
I know that 1, 3 and 6 months are valid values, not sure about the rest.
 
plotDistance is a member of CvPlot I believe. Try this:

if (pLoopCity.getPlot()->plotDistance(getX_INLINE(), getY_INLINE(), pCapital->getX_INLINE(), pCapital->getY_INLINE() .....

Or it might be a member of CvMap, in which case use GC.getMapINLINE(). Check both classes to see which one it's in.

Here is an example of using plotDistance in some code I wrote recently:

if(... || (plotDistance(pLoopPlot->getX_INLINE(), pLoopPlot->getY_INLINE(), pNearestCity->getX_INLINE(), pNearestCity->getY_INLINE()) < 11))

I did a quick check and plotDistance is actually in CvGameCoreUtils.h which most of the .cpp files #include so you can call it. For your case I think your code should look something like this:

if (plotDistance(pLoopCity->getX_INLINE(), pLoopCity->getY_INLINE(), pCapital->getX_INLINE(), pCapital->getY_INLINE() .....

Thanks. I've tried several combinations of these suggestions but still can't get it to work. I fear my quick modding question is no longer quick (there are other issues in writing this code I'm struggling with), so I think it's best if i open an actual thread that covers it.
 
XML\GameInfo\GameSpeedInfo

Thank you very much - it helped a lot :)

And another question:

Tell me someone please all the steps for setting cultural diversity for units. I mean all required XML-files. Thanks in advance.
 
God-Emperor and The_J - thanks again! those links are indeed helped a lot!

One more question on sounds. I followed some instruction on how to add custom unit sounds, and I have successfully added new selection sounds to one of my units.

However, the guide mentions that game will randomly select between sound files with endings -000, -001 etc. But this only seem to work for these two. I have added -003, -004 etc, but only first 2 are played and rest are ignored. Is there a hard limit on random sound selection for those?

thanks!
 
Tell me someone please all the steps for setting cultural diversity for units. I mean all required XML-files. Thanks in advance.

You should then take a look at this thread. Post #4 has the needed information.

----
edit: Sadly no idea for the sounds :/.
 
I figured the sounds out =) As always - checking folder path is the first thing to do =) I had "unit" instead of "units", "sound" instead of "sounds" etc :)

Another thing I like to discuss, is not really a question.
I noticed SOME units have dual combat animation - what I mean under dual, is Archers shoot bows at range, but switch to knives when enemy gets into melee range.
I was thinking that early gunpowder units do not behave properly in game: they keep shooting their muskets, while being pommeled in melee. Realistically, they shroud start using their bayonets/side weapons, to fight off a melee attack. Same thing with gunpowder cavalry - they should be switching to sabers. I was thinking it would be cool to somehow combine parts of Cuirasier and Conquistador graphics. Cuirasiers shot muskets, while Conquistadors use sabers. If these 2 could be combine, you would produce truly realistic gunpowder cavalry, which will use muskets at range/during first strikes, and switch to savers in melee.

This is mostly rambling, thought, as it truly has nothing to do with this "questions" thread :) But if any modelers are interested, that would be cool to see your work ;)


Another thing I am curious about - missile/rocket units. I was under impression that AT Infantry or at-least SAM infantry would actually shoot rockets.. However AT Inf uses their "tubes" but nothing really flies out of them. SAM Inf, carries their tubes around but always keeps using their UZIs, even vs airborne targets, helicopters, planes etc. Kind of puzzling...
 
How easy is it to create brand new promotions? For example, let's say one if an attacker kills something without taking damage, it gets another attack.

Would that be coded in python or dll?
 
How easy is it to create brand new promotions? For example, let's say one if an attacker kills something without taking damage, it gets another attack.

Would that be coded in python or dll?

Might be doable in Python, not sure about it. dll is definitely the better choice.

yeah related question - where does it controlled which unit can get which promotions?
do they only apply by unit TYPE - like mounted, melee, etc, or can they be restricted by specific unit?

It's controlled in the units\promotionsInfos.xml, and it's only possible to restrict it to the unit combats (mounted, melee, etc).
Starting promotions (leader trait, or set in the unitInfos) can override that.

If you want to restrict a promotion only to certain types, i'd create a promotion which does nothing, which is added as starting promotion to these units and is a prerequisite for the real promotion. Not nice, but will work.

P.S. The_J - thanks on that info, I will look into ;)

:thumbsup: good luck.
 
It's controlled in the units\promotionsInfos.xml, and it's only possible to restrict it to the unit combats (mounted, melee, etc).
Starting promotions (leader trait, or set in the unitInfos) can override that.

If you want to restrict a promotion only to certain types, i'd create a promotion which does nothing, which is added as starting promotion to these units and is a prerequisite for the real promotion. Not nice, but will work.

:thumbsup: good luck.

I say its brilliant :) cause its either that, or I would have to create 15 new combat types just to insure that say Longbows get some extra promotions that other archer units don't and so far ;)

I was also thinking - you know how events can grant units free promotions? including to specific units
Is it possible, in pure XML to do something like that: city has a building which grants specific new units that built there specific free promotion?
 
Actually, yes, it works (through the tag <FreePromotion>) and it also overrides the prerequisites from the Promotion file. The only restriction is that you can only give one free promotion per building.
 
thanks, I will use that :)

another question

What exactly determines when unit becomes obsolete and no longer available for building? I noticed for example that Archers do not obsolete until both Longbows and Crossbows become available.
On other hand, considering many medieval units require Iron, I am curious how game makes sure I do not get screwed up by something like this:
-I have all pre-req to build macemen, so axeman no longer available.
-Then if I suddenly loose access to Iron - do axeman reactivate themselves? (I haven't noticed, since I never lost access to Iron in my games)
 
Oh, the devs took care of that thing ;).
An unit becomes obsolete/is not longer buildable if you can build all the upgrades.
So the archer can#t be build any longer if you're able to build longbowmen and crossbowmen. If you're not able to build at least one (e.g. due to the lack of resources), then you're still able to build the archer.
So in your example, yes, if you're having copper and iron, are able to build macemen, and you lose access to iron, you'll again be able to build axemen.
 
How can one remove city ground texture?

attachment.php
 

Attachments

  • Civ4ScreenShot0008.JPG
    Civ4ScreenShot0008.JPG
    97.8 KB · Views: 173
Back
Top Bottom