Quick Modding Questions Thread

OK, so most stupid question ever: how to mod python?

Could you maybe be a bit more specific?


Changing CvGameCoreDLL copied to mod directory doesn't work nor changing original one does.

Did you also create the new .dll?
Or did you just change the .cpp files?
 
Did you also create the new .dll?
Or did you just change the .cpp files?

My bad. Now, how can I modify .dll? I want to modify .dll of RFCC- I've downloaded Microsoft Visual C++ Toolkit 2003, msvcrt.lib, msvcrtd.lib, msvcprt.lib, Microsoft Platform SDK, Microsoft Visual C++ Express Edition and RFCC source. I've got some code from other sources that I would like to include. Do I have to create another project or can I use RFCC's one? Is there any really simple way to create the .dll?
return std::max(0, ((getPopulation() + iExtra - ((bNoAngry) ? angryPopulation(iExtra) : 0)) * 2));
BTW: "* 2" shouldn't be after next bracket?
 
If you count the brackets carefully, you'll notice it won't matter.
return std::max(0, ((getPopulation() + iExtra - ((bNoAngry) ? angryPopulation(iExtra) : 0)) *2));
is equal to all of those:
return std::max(0, ((getPopulation() + iExtra - ((bNoAngry) ? angryPopulation(iExtra) : 0))) *2);
return std::max(0, ((getPopulation() + iExtra - ((bNoAngry) ? angryPopulation(iExtra) : 0)))) *2;
return std::max(0, 2*((getPopulation() + iExtra - ((bNoAngry) ? angryPopulation(iExtra) : 0))));
return 2*std::max(0, ((getPopulation() + iExtra - ((bNoAngry) ? angryPopulation(iExtra) : 0))));

Just use the project file from the RFCC dll.
 
When attacking a city I get a siege tower in the graphics.

How do I change this to something more appropriate, like an artillery piece or similar. It is not part of Civ4UnitInfos.

EDIT it was in the art infos file

Code:
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_SIEGE_TOWER</Type>
			<Button/>
			<fScale>0.20</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			<bActAsLand>0</bActAsLand>
			<bActAsAir>0</bActAsAir>
			<NIF>Art/Units/Siege_Tower/Siege_Tower.nif</NIF>
			<KFM>Art/Units/Siege_Tower/Siege_Tower.kfm</KFM>
			<SHADERNIF>Art/Units/Siege_Tower/Siege_Tower_FX.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
				<ShadowAttachNode>SiegeTower_Main_Bone</ShadowAttachNode>
				<fShadowScale>1.0</fShadowScale>
			</ShadowDef>
			<TrailDefinition>
				<Texture>Art/Shared/wheeltread.dds</Texture>
				<fWidth>1.0</fWidth>
				<fLength>180.0</fLength>
				<fTaper>0.0</fTaper>
				<fFadeStartTime>0.2</fFadeStartTime>
				<fFadeFalloff>0.35</fFadeFalloff>
			</TrailDefinition>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.05</fRangedDeathTime>
			<fExchangeAngle>-38.0</fExchangeAngle>
			<bActAsRanged>1</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>

(attached graphic)
 
Try copying the artillery graphics on top of that but remember to use the same type the siege tower has. I haven't tried this, but I think it should work. Something like this:
Spoiler :
Code:
		<UnitArtInfo>
			<Type>ART_DEF_UNIT_SIEGE_TOWER</Type>
			<Button/>
			<fScale>0.65</fScale>
			<fInterfaceScale>1.0</fInterfaceScale>
			<bActAsLand>0</bActAsLand>
			<bActAsAir>0</bActAsAir>
			<NIF>Art/Units/Artillery/Artillery.nif</NIF>
			<KFM>Art/Units/Artillery/Artillery.kfm</KFM>
			<SHADERNIF>Art/Units/Artillery/Artillery_FX.nif</SHADERNIF>
			<ShadowDef>
				<ShadowNIF>Art/Units/01_UnitShadows/ArtilleryShadow.nif</ShadowNIF>
				<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
				<fShadowScale>1.0</fShadowScale>
			</ShadowDef>
			<TrailDefinition>
				<Texture>Art/Shared/wheeltread.dds</Texture>
				<fWidth>0.9</fWidth>
				<fLength>180.0</fLength>
				<fTaper>0.0</fTaper>
				<fFadeStartTime>0.2</fFadeStartTime>
				<fFadeFalloff>0.35</fFadeFalloff>
			</TrailDefinition>
			<fBattleDistance>0.35</fBattleDistance>
			<fRangedDeathTime>0.31</fRangedDeathTime>
			<bActAsRanged>1</bActAsRanged>
			<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
			<AudioRunSounds>
				<AudioRunTypeLoop/>
				<AudioRunTypeEnd/>
			</AudioRunSounds>
		</UnitArtInfo>
 
Thanks for that. I changed it for artillery. Looks much better now.

BETA release is getting close for my mod.
 
I have a question:

What are these values in the unitinfos.xml:

<iCombat>1</iCombat> (this I know, this is the strength value)
<iCombatLimit>100</iCombatLimit>


<iAirCombat>0</iAirCombat> (what do these values do?)
<iAirCombatLimit>0</iAirCombatLimit>

<iWithdrawalProb>0</iWithdrawalProb> (with withdrawal you could simulate morale in a sense)

<iCollateralDamage>0</iCollateralDamage> (is this how many points of collateral damage the unit does? )
<iCollateralDamageLimit>0</iCollateralDamageLimit>
<iCollateralDamageMaxUnits>0


<TerrainNatives> (what does the terrainnative do?)
<TerrainNative>
<TerrainType>TERRAIN_GRASS</TerrainType>
<bTerrainNative>1</bTerrainNative>

<FeatureNatives/> (there is also a featurenative line)

<BonusProductionModifiers/> (this is interesting, I wonder what could be done with it?)

<iBombRate>0</iBombRate> (these require some clarification, does this mean how many points of damage it does or what?)
<iBombardRate>0</iBombardRate> (this is the same for artillery units I guess)

<iAsset>0</iAsset> (what´s this?)
<iPower>0</iPower> (or this, this isn´t strength so what is it?)

<UnitMeshGroups>
<iGroupSize>1</iGroupSize> (this is how many units are in the group)
<fMaxSpeed>1.75</fMaxSpeed>
<fPadTime>1</fPadTime>
<iMeleeWaveSize>3</iMeleeWaveSize> (what about this, what does this determine?)
<iRangedWaveSize>0</iRangedWaveSize> (or this?)
<UnitMeshGroup>
<iRequired>1</iRequired>
<EarlyArtDefineTag>ART_DEF_UNIT_LION


<FreePromotions/> (freepromotions is what promotions the unit gets at start)
<LeaderPromotion>NONE</LeaderPromotion> (but what about this?)
<iLeaderExperience>0</iLeaderExperience> (or this?)

<iDCMBombRange>0</iDCMBombRange> (this means ranged attack range I guess?)
<iDCMBombAccuracy>0</iDCMBombAccuracy> (and ranged accuracy?)

<bDCMAirBomb1>0</bDCMAirBomb1> (these are boolean tags but for what exactly?)
<bDCMAirBomb2>0</bDCMAirBomb2>
<bDCMAirBomb3>0</bDCMAirBomb3>
<bDCMAirBomb4>0</bDCMAirBomb4>
<bDCMAirBomb5>0</bDCMAirBomb5>
<bDCMFighterEngage>0</bDCMFighterEngage> (this is for fighters, that I get and its a boolean so its either true or false, but what does it do?)

<bMilitaryHappiness>0</bMilitaryHappiness> (unit creates happiness when garrisoned, a boolean)
<bMilitarySupport>0</bMilitarySupport> (what´s this boolean?)
<bMilitaryProduction>0</bMilitaryProduction> (or this?)

<bFound>0</bFound> (this is if the unit can found cities I guess?)
<bGoldenAge>0</bGoldenAge> (or can start a golden age?)

<bMechanized>0</bMechanized> (what does it mean if a unit is mechanized?)

<UnitClassDefenders/> (what are these? unitclassdefenders?)
<UnitCombatDefenders/> (or these?)

<FlankingStrikes/> (this is if a unit has flanking attack against something, but what does a flanking attack mean? and can I designate a whole unitclass for flanking attacks, for example cavalry has flanking attack against melee or gunpowder units?)

<Builds/> (what´s this?)

<iAirRange>0</iAirRange> (this is the air range in tiles I guess?)
<iAirUnitCap>0</iAirUnitCap> (and this is for carriers, how many air units it can carry?)

<iBaseDiscover>0</iBaseDiscover> (these are a bit of a mystery?)
<iDiscoverMultiplier>0</iDiscoverMultiplier>
<iBaseHurry>0</iBaseHurry>
<iHurryMultiplier>0</iHurryMultiplier>
<iBaseTrade>0</iBaseTrade> (what is this?)
<iTradeMultiplier>0</iTradeMultiplier> (???)
<iGreatWorkCulture>0</iGreatWorkCulture> (this is how much culture you get from a great work?)
<iEspionagePoints>0</iEspionagePoints> (or how many espionage points after a successful infiltration?)

<iCultureGarrison>0</iCultureGarrison> (what about this?)

Thanks for the help! :goodjob:
 
First read this.
Second, if you don't know exactly what a tag does, try to find a unit where it's activated or not 0, and look what the unit does ingame. For example iWithdrawalProb is >0 for all mounted units, and all can withdraw from combat, if the chances get to low.
Afterwards ask again, if you still don't know anything.
 
Ok, thanks. :goodjob:

But what does the flanking attack do. In the default game it is used against siege machines, but could you use it against other unit types aswell, say melee units etc.

Does the flanking attack give some sort of attack bonus or what? What does the flanking attack do?

My idea is to give cavalry and other units flanking attack capability against melee units etc.
 
If you don't know what flanking does, mod less and play more :p

:yup:


Flanking allows the unit to damage the target units in a stack, if it attacks another unit and is successful with that.
And yes, flanking can affect every unit, you just have to put it in the files.
 
Thanks for the info! :goodjob:

A question, is there a civilization pack for Rise of Mankind, I read somewhere that there´s a huge number of Civs that can be added by downloading a civ pack, where can I find such a pack?

What about units? Are there packs that supply different unit graphics etc.
Is it difficult to make unit graphics, what programs do you need?

I guess its pointless to start making any new unit graphics for Civ 4 since we´re about to get Civ 5 soon, but if there are ready packs of different units, I´d be interested in taking a look at them.

Thanks! :goodjob:
 
Hi I'm putting together an XML module and although I can add tags to things, I can't turn existing ones off - example

my modules_CIV4promotioninfos.xml contains...
Code:
        <PromotionInfo>
            <Type>PROMOTION_MARCH</Type>
            <PromotionPrereqOr1>PROMOTION_COMBAT2</PromotionPrereqOr1>
            <PromotionPrereqOr2>PROMOTION_DRILL2</PromotionPrereqOr2>
            <bAlwaysHeal>1</bAlwaysHeal>
            <iEnemyHealChange>10</iEnemyHealChange>
            <iNeutralHealChange>10</iNeutralHealChange>
            <iFriendlyHealChange>10</iFriendlyHealChange>
            <UnitCombats>
                <UnitCombat>
                    <UnitCombatType>UNITCOMBAT_BEAST</UnitCombatType>
                    <bUnitCombat>0</bUnitCombat>
                </UnitCombat>
                <UnitCombat>
                    <UnitCombatType>UNITCOMBAT_DISCIPLE</UnitCombatType>
                    <bUnitCombat>1</bUnitCombat>
                </UnitCombat>
                <UnitCombat>
                    <UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
                    <bUnitCombat>1</bUnitCombat>
                </UnitCombat>				
                <UnitCombat>
                    <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
                    <bUnitCombat>0</bUnitCombat>
                </UnitCombat>
            </UnitCombats>
		</PromotionInfo>

because I wish to change the prerequisites, allow it to be taken by recon units, but disallow it by melee. When I load up a game and check the 'pedia the prereq changes and recon permission are there, but melee units can still pick it up. I've come across similar problems trying to turn off other booleans too.

EDIT: I should add that I am already loading my module last, and (on the whole) am using as few lines on XML as I can.
any suggestions would be most welcome, thanks
 
I could make it not modular - but then the xml would need remergeing with each new core mod update. Which is why I chose the modular approach in the first place. does anyone know explicitly which parts of that infos.xml update badly or why?
 
I would like to limit the movement of my Fortress/Pillbox units to 0, yet give them the ability to fire with ranged weapons and to fortify themselves. If I set the movement to 0 they can do neither. So I am considering giving them a movement of 1, but make all terrain types impassable, so they effectively can't move but still have a movement point available so they can fire or fortify.
 
Try setting the unit's domain to DOMAIN_IMMOBILE that should work.
 
Back
Top Bottom