Quick Modding Questions Thread

As an example for copying the Warlord glow, additionally to copying the 'ATTACHABLE_HIGHLIGHT_WARLORD' node plus subnodes into the BIP structure of your unit, you will also need to copy the 'ATTACHABLES' node plus subnode to the 'MD NonAccum' node of your unit.

If you copy both nodes (plus subnodes) from the same original unit, all entries should already fit to each other. Otherwise, you will have to check their entries (for example, the entry of the 'NiStringExtraData' subnode of the 'ATTACHABLES' node). Further, if you want to have the glow appear or disappear for different animations, you will have to create entries in the respective kf file.

Hope this helps. :)

I was missing inserting the node into the BIP structure. When I look at the list of nodes in the Modern Warlord NIF, the glow nodes don't appear as a sub-node of NiMultiTargetTransformController. Only when I look at the Bip01 NiNode and its subnodes does the glow appear. So I didn't know I was missing that part.

I have the glow working now. Thank you.
 
Oh ... Probably needs to define two empty teams and players
Code:
BeginTeam
EndTeam
BeginTeam
EndTeam
Code:
BeginPlayer
EndPlayer
BeginPlayer
EndPlayer
Unless your mod uses a DLL with MAX_CIV_PLAYERS set to 16 instead of 18. Anyway, if I correct the speed thing, take out the mod path line and add those teams and players (edited WBSave attached), I can launch the scenario in BtS. I had previously only tried it with my own mod, which tolerates missing teams and players.
 

Attachments

Thank You!! This allowed me to at least get the thing started up.

Now here are 2 weird things I'm seeing.
While tinkering with my file before I got your responses, I thought maybe just defining start locations wasn't good enough and I had to put units on the starting plots, so I put units on the starting plots. In spite of that, I started with 1 Settler on the start plot and a warrior or scout nearby, not the settler+2 archers+2 scouts the plot has defined in the file (I play on Emperor). All Civs including me are also starting with only the starting techs the civ normally has and not the ones assigned in the file.

This is a surmountable issue, as I can go into the WB at the start of a new game and assign the units and techs before proceeding just like I always have. But I was hoping not to have to do that every time.

But also, the spot where civ 15 should be is empty.
 
Last edited:
If I choose 'Play A Scenario', then only the first 9 slots are filled, the remaining civs are gone.

If I select 'Custom Scenario', and fill all civs 2-16 with AI, the last one is still empty.

Current file:
 

Attachments

Last edited:
I suspect that you need to assign fixed civs and leaders if you want players to start with specific units. And that, otherwise, you get a number of random players based on the world size (as set in GameInfo\Civ4WorldInfo.xml). If you already use a mod and just want random civs with the freebies from the handicap, then perhaps just increasing the default player count for LARGE world size will solve your problems.
 
Thank you for all your help.

I added to my mod the worldinfos file and set default #civ for huge=16, large=12, standard=8, and set the world size in the file to huge. Now I still have to go through the rigamarole of starting units and techs, like I've done in random maps since I stepped up to Emperor, but it plays.

But I guess in order to publish this mod+scenarios, I'm going to have to pick specific civs/leaders in order to insure balanced starts.
 
You're welcome. If I understand you correctly, you want all players – human and AI – to start with the Emperor freebies (incl. Archery), Pottery and all first-column techs. That should all be doable by changing the Emperor handicap data in GameInfo/Civ4HandicapInfo.xml: iStartingDefenseUnits, iStartingExploreUnits, FreeTechs for the human player, iAIStartingDefenseUnits, iAIStartingExploreUnits, AIFreeTechs for the AI players. Could also do something similar for the other difficulty levels so that the player can still pick any level.
 
Did I leave Pottery in? Gotta remove that.

Yeah, the whole point of the Symmetry mod is to remove any dis/advantage based on un/lucky start position.
I also hate the part of the game at the start where your workers can't do anything, but like to have ancient wonders available.
 
BTW I followed your advice about adjusting the number of default civs by map size. It worked fine, but I laughed out loud when the Master Smith event came up and I was tasked with building 16 Forges.
 
Ah, I've run into that side-effect myself last year:
Another thing is I got lucky with receiving the quest for building War Chariots. If I build 17 War Chariots, [...]
[...] I've made it worse by increasing the default player count on Huge maps from 11 to 16 (the target number of Chariots is that number plus 1). Let's use the BuildingClassPrereqModifier from the map size (which is what determines e.g. the number of Libraries for Oxford University); that'll mean 6 (Duel) to 10 (Huge) Chariots are needed, instead of 3 to 17 (or 3 to 12 in BtS). Actually, pretty much all quests scale with the default player count ... That's really dumb because, when the default player counts are increased, players actually end up with fewer cities.
Took a bit of work to fix: Git commit
 
Can someone tell me why this code doesn't work:
Code:
## Ice Hotel Start ##
        
        if (iBuildingType == self.iBUILDING_ICE_HOTEL):

            pPlayer = gc.getPlayer(pCity.plot().getOwner())
            pPID = pPlayer.getID()
            pTID = pPlayer.getTeam()
            iX = pCity.getX()
            iY = pCity.getY()
            tt_tundra = gc.getInfoTypeForString( 'TERRAIN_TUNDRA' )
            tt_ice = gc.getInfoTypeForString( 'TERRAIN_SNOW' )

            for iXLoop in range(iX - 2, iX + 3, 1):
                for iYLoop in range(iY - 2, iY + 3, 1):
                    pPlot = CyMap().plot(iXLoop, iYLoop)
                    if ( pPlot.isPlayerCityRadius(pPID)==true ):
                        if ( pPlot.getTeam()==pTID ):
                            if ( pPlot.getTerrainType()==tt_tundra or pPlot.getTerrainType()==tt_ice ):
                                CyGame().setPlotExtraYield(iXLoop, iYLoop, YieldTypes.YIELD_COMMERCE, 2)
            

            CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_ICE_HOTEL_PYTHON",()),'',0,',Art/Interface/Buttons/Empty.dds,Art/Interface/Buttons/Atlases/Afforess_Atlas.dds,4,7',ColorTypes(44), iX, iY, True,True)

## Ice Hotel End ##
Python file also attached.
Thanks in advance :hatsoff:
 

Attachments

Can someone tell me why this code doesn't work:
Code:
## Ice Hotel Start ##
       
        if (iBuildingType == self.iBUILDING_ICE_HOTEL):

            pPlayer = gc.getPlayer(pCity.plot().getOwner())
            pPID = pPlayer.getID()
            pTID = pPlayer.getTeam()
            iX = pCity.getX()
            iY = pCity.getY()
            tt_tundra = gc.getInfoTypeForString( 'TERRAIN_TUNDRA' )
            tt_ice = gc.getInfoTypeForString( 'TERRAIN_SNOW' )

            for iXLoop in range(iX - 2, iX + 3, 1):
                for iYLoop in range(iY - 2, iY + 3, 1):
                    pPlot = CyMap().plot(iXLoop, iYLoop)
                    if ( pPlot.isPlayerCityRadius(pPID)==true ):
                        if ( pPlot.getTeam()==pTID ):
                            if ( pPlot.getTerrainType()==tt_tundra or pPlot.getTerrainType()==tt_ice ):
                                CyGame().setPlotExtraYield(iXLoop, iYLoop, YieldTypes.YIELD_COMMERCE, 2)
           

            CyInterface().addMessage(pPID,false,15,CyTranslator().getText("TXT_KEY_ICE_HOTEL_PYTHON",()),'',0,',Art/Interface/Buttons/Empty.dds,Art/Interface/Buttons/Atlases/Afforess_Atlas.dds,4,7',ColorTypes(44), iX, iY, True,True)

## Ice Hotel End ##
Python file also attached.
Thanks in advance :hatsoff:

This code is working in AND. Are you trying to use it somewhere without the RoMEventManager? That file has a separate definition for self.iBUILDING_ICE_HOTEL that for some reason is called on game start. I would replace self.iBUILDING_ICE_HOTEL with gc.getInfoTypeForString( 'BUILDING_ICE_HOTEL' ) and see where that gets you.
 
This code is working in AND. Are you trying to use it somewhere without the RoMEventManager?
Yes. Long story short: Thanks to Inthegrave I'm using a modded version of AND's dll with plans to add new xml tag to modify terrain yields around cities. It's not yet implemented but RoMEventManager was greatly modified, so I tried to add back the effects of Djenne, Crusade and Snowcastle. I managed the first two but not the Snowcastle. It's especially frustrating since its code is almost identical to Djenne's which is working properly.
Spoiler :
upload_2022-4-4_11-29-14.png

So I tried your suggested change but it's still not working :confused:
 

Attachments

Yes. Long story short: Thanks to Inthegrave I'm using a modded version of AND's dll with plans to add new xml tag to modify terrain yields around cities. It's not yet implemented but RoMEventManager was greatly modified, so I tried to add back the effects of Djenne, Crusade and Snowcastle. I managed the first two but not the Snowcastle. It's especially frustrating since its code is almost identical to Djenne's which is working properly.

So I tried your suggested change but it's still not working :confused:

You aren't getting any Python exception popups, are you? HidePythonExceptions in Civilization4.ini should be set to 0. That way you get a Python popup whenever something is wrong in your code. If you do have the popups enabled and still aren't getting any, then something is really weird because as you say, the two code pieces are nearly identical.
 
You aren't getting any Python exception popups, are you? HidePythonExceptions in Civilization4.ini should be set to 0. That way you get a Python popup whenever something is wrong in your code. If you do have the popups enabled and still aren't getting any, then something is really weird because as you say, the two code pieces are nearly identical.
Okay, I tried again. Now I set up a test game and the code IS working. But in my current game, where I tested first, it didn't. Weird :confused:
Thanks for your help :)
 
Hey team,

I would like to fix that when you die (in multiplayer game) people cannot use the chat box anymore to talk to you (would like to find the popup code of the chat to make it that the player being alive is not a condition to be in the scroll down list).

Can't find the concerned popup code.

I'm looking for anywhere the XML tags
TXT_KEY_MISC_SAY_TO_ALL
TXT_KEY_MISC_SAY_TO_PLAYER
are being used but not finding any location

Cheers :grouphug:
 
Hey team,

I would like to fix that when you die (in multiplayer game) people cannot use the chat box anymore to talk to you (would like to find the popup code of the chat to make it that the player being alive is not a condition to be in the scroll down list).

Can't find the concerned popup code.

I'm looking for anywhere the XML tags
TXT_KEY_MISC_SAY_TO_ALL
TXT_KEY_MISC_SAY_TO_PLAYER
are being used but not finding any location

Cheers :grouphug:

I found them in the PitBoss EXE files. I don't think those can be modified but I can't say for sure.
 
Back
Top Bottom