• Our friends from AlphaCentauri2.info are in need of technical assistance. If you have experience with the LAMP stack and some hours to spare, please help them out and post here.

Quick Modding Questions Thread

How do I combine BUFFY, Cultural Citystyles, and K-Mod?

(If that's really complicated I'll settle for adding BUG to K-mod.)

EDIT: No one seems interested so I made a thread.

I think the cultural citystyles mod is not very difficult to add to an existing mod, since it's only xml-changes and graphics. I added it to RevDcm for my mod, the difficult task is to merge
dll-mods, that requires some trial and error. I think there are tutorials for that but it is a learning process. There seems to be a few modcomps that combine k-mod with other mods.
 
I have a question:

Which python-file edits the city screen?

I want to be able to see all religions in the sidebar and their presence in the city, but once you add more religions than the standard ones, the margin space
is only calibrated to show 7.

This also applies for corporations I think

/Matte
Johny Smith has a mod for that. It is Python and it works for Corporations also. Sorry I am not in a position to find it for you at the moment.
 
The Incan Forbidden Palace in Varietas Delectat seems to have a separate modern/future version, but I am unable to find it anywhere in the FPK or Civ4CityLSystem.xml (I know it's called 'Great Palace' there, please don't tell me this). It's a big thick tower, looks a bit like the Empire State Building.

I also need help locating the early Native American academy.

EDIT: How do I give trading posts regular lighthouse graphics after the Renaissance era? I can do it in the Warlords Civ4CityLSystem.xml, but I can't bring that over to my mod without overwriting the Varietas Delectat version.
 
Last edited:
How do you control what animation a certain unit uses for a specific mission type? I have a nuclear bomber unit as precursor of the ICBM, but when it is used to nuke a plot the plane crashes into the tile like a missile, and does not leave a mushroom cloud. I copied the unit NIF and art defines from C2C where the unit correctly plays the bomber animation. In both mods the normal Bomber KFM is used. What am I missing?
 
Looking in the DLL code I found this line:
PHP:
pTarget->nukeExplosion(nukeRange(), this);
Looks like it's the line you need. The only problem is that it's inside CvUnit::kill(), meaning it's hardcoded to only trigger when you lose your unit.

I wonder if you should make bomb units, which can then be loaded into the bomber and then make those act like missiles with a range of 1. Alternatively you might need new code to trigger CvPlot::nukeExplosion(). Vanilla does expose this function to python, though I'm not sure it will help in your specific case.

The actual display of nukeExplosion is done by calling a function called nukeExplosion in the exe file. This means the animation is unique and not part of the usual attack system.

when it is used to nuke a plot the plane crashes into the tile like a missile, and does not leave a mushroom cloud.
Sounds like a dive bomber doing it wrong :p
 
How do you control what animation a certain unit uses for a specific mission type? I have a nuclear bomber unit as precursor of the ICBM, but when it is used to nuke a plot the plane crashes into the tile like a missile, and does not leave a mushroom cloud. I copied the unit NIF and art defines from C2C where the unit correctly plays the bomber animation. In both mods the normal Bomber KFM is used. What am I missing?
I think you just need to copy the effects details as well. That is how it works with arrows from bows etc.
 
I think that Dale's Road to War had atomic bombers. stolenrays made a nice little modcomp that included that portion:
https://forums.civfanatics.com/resources/ww2-style-a-bomb-unit-mod-v1-1.17769/
I'll try that as well, although it seems that simple copy and pasting does not work on its own.

Looking in the DLL code I found this line:
PHP:
pTarget->nukeExplosion(nukeRange(), this);
Looks like it's the line you need. The only problem is that it's inside CvUnit::kill(), meaning it's hardcoded to only trigger when you lose your unit.

I wonder if you should make bomb units, which can then be loaded into the bomber and then make those act like missiles with a range of 1. Alternatively you might need new code to trigger CvPlot::nukeExplosion(). Vanilla does expose this function to python, though I'm not sure it will help in your specific case.

The actual display of nukeExplosion is done by calling a function called nukeExplosion in the exe file. This means the animation is unique and not part of the usual attack system.
The nuclear bomber unit is set as nuke in the XML already (iNukeRange set to 1), so I think I'm all set from the DLL side, as that already enables the nuke mission for the unit that ultimately calls that function. It just seems that this isn't the code that controls the animation, so I need to associate the animation with that mission in some other way.

Sounds like a dive bomber doing it wrong :p
Yeah it looks kind of hilarious.

I think you just need to copy the effects details as well. That is how it works with arrows from bows etc.
Which effects though? Aren't they usually part of the unit art? How are they connected to the unit?
 
They are defined in Assets\XML\Misc\CIV4EffectInfos.XML and reside in the unit art I think, but I can't remember how you link them to the file. I'll do a bit more searching.

edit no I can't figure it out. I did it last with spiders shooting webs. It is EFFECT_SPIDERSILK but I can't see where that gets linked to the unit. Unless it is actually in the art and by defining it as the effect is all that is needed.

Did you copy the effect file info that matched the unit?
 
I made a custom unit, but when I look at it in certain places (in the archery tech for example) it appears small. Any idea why? This is my first mod (and post), and i'm slowly learning. Thanks, and I attached a picture of it.
 

Attachments

  • Broken Button.jpg
    Broken Button.jpg
    187.7 KB · Views: 69
Wait, what? So to make the button what I did was I got the 64x64 of an archer, recoloured it a bit, and saved it as .png. Then i used dxtbmp to turn it into a dds, and the alpha channel was already there (black at the border, white everywhere else). Could you tell me what I did wrong?

EDIT: Here's my art define unit code:

Code:
<UnitArtInfo>
            <Type>ART_DEF_UNIT_ISRAELITE_SLINGER</Type>
            <Button>Art/Interface/Buttons/Units/SlingerButton.dds</Button>
            <fScale>0.44</fScale>
            <fInterfaceScale>1.0</fInterfaceScale>
            <bActAsLand>0</bActAsLand>
            <bActAsAir>0</bActAsAir>
            <NIF>Art/Units/Unique_Israelite_Slinger/longbowman.nif</NIF>
            <KFM>Art/Units/Unique_Israelite_Slinger/longbowman.kfm</KFM>
            <SHADERNIF>Art/Units/Unique_Israelite_Slinger/longbowman.nif</SHADERNIF>
            <ShadowDef>
                <ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
                <ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
                <fShadowScale>1.0</fShadowScale>
            </ShadowDef>
            <fBattleDistance>0.35</fBattleDistance>
            <fRangedDeathTime>0.31</fRangedDeathTime>
            <bActAsRanged>1</bActAsRanged>
            <TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
            <AudioRunSounds>
                <AudioRunTypeLoop/>
                <AudioRunTypeEnd/>
            </AudioRunSounds>
        </UnitArtInfo>

EDIT 2: Could you please send me the alpha channel that I should use? just want to make sure i'm using the right one. :D
 
Last edited:
They are defined in Assets\XML\Misc\CIV4EffectInfos.XML and reside in the unit art I think, but I can't remember how you link them to the file. I'll do a bit more searching.

edit no I can't figure it out. I did it last with spiders shooting webs. It is EFFECT_SPIDERSILK but I can't see where that gets linked to the unit. Unless it is actually in the art and by defining it as the effect is all that is needed.

Did you copy the effect file info that matched the unit?
I did include the .kf file that came with the unit art, but never changed anything in the effect infos XML, let me give that a try. Thanks for your efforts :)
 
EDIT 2: Could you please send me the alpha channel that I should use? just want to make sure i'm using the right one. :D
Sadly I'm not a graphics artist and can't provide fancy solutions like that. If the image is truly 64x64, then I can't think of what you did wrong. Maybe you could try to share SlingerButton.dds and see if anybody else can figure out what's broken about it.

You can also try to edit the xml file and use vanilla button art to ensure that it is the dds file and not some weird xml setup.
 
Okay, thanks. I don't think it's XML, but then again I don't think it's the dds... :wallbash: But yeah i'll definitely try switching them out :)

EDIT: I just tried what you said, (switching out the .dds) and the icon in-game wasn't small. So it's definitely the dds.

I'm wondering if anyone could help me? I'm attaching the dds (in a zip) and if anyone could find out the problem, i'd be much obliged :lol:

Thanks!

EDIT 2: I have compared my dds to others, and I see no difference (i also compared the alpha channel) but I have no idea why mine is different. Please help me! :wallbash:
 

Attachments

Last edited:
Does anyone know how to fix the problem? Read my other posts, and please help me! I have no idea how to fix it :mad: :wallbash:

Thanks!
 
Okay, news on the nuclear bomber issue: I finally figured it out, and it basically was a combination of all the advice I have gotten. Turns out that I was missing the correct entries in the effect infos XML. But also, you have to change the DLL code so an air strike mission is executed for this unit, instead of the usual nuke mission. Lastly, the unit may not have the bSuicide tag, which is redundant for nuke units anyway. Thanks to everyone who helped.
 
Okay, news on the nuclear bomber issue: I finally figured it out, and it basically was a combination of all the advice I have gotten. Turns out that I was missing the correct entries in the effect infos XML. But also, you have to change the DLL code so an air strike mission is executed for this unit, instead of the usual nuke mission. Lastly, the unit may not have the bSuicide tag, which is redundant for nuke units anyway. Thanks to everyone who helped.


Could you please post what you did with those "effect infos XML" ? I been trying to get that bomber to work few months back and never could =(
 
Back
Top Bottom