Mod-Modders Guide to Fall Further

Use a negative value to give gold to a city IIRC. Science has come up a few times, and I am pretty sure is written in my design doc a couple of dozen places as "do this soon" just keeps getting dropped from the priority list :)
 
After testing some more in WB, both positive and negative values for fGold don't give or take away gold in your own cities (I didn't test in enemy cities). Negative values show up as an increase in maintenance and positive values show up as a decrease in maintenance, but both do absolutely nothing to my gold per turn even though the financial advisor states it should be (see attached).
 

Attachments

  • GoldTag.JPG
    GoldTag.JPG
    178.1 KB · Views: 90
  • GoldTag2.JPG
    GoldTag2.JPG
    153.5 KB · Views: 140
Did you ever get feats defined in the xml instead of DLL to work properly? I see there is a CIV4FeatInfos.xml file in FF 0.51, but I think I recall you saying before that it didn't really work the way you had written it so you went back to the normal way.

Last time I tried adding more feats (placeholders FEAT_MAGISTER1 though FEAT_MAGISTER50) in my dll it would cause the game to crash upon loading. (There were a couple other changes at the same time though, so it could have been a mistake elsewhere.) I think need to be able to ad a lot of feats if I want to be able to rewrite the Resurrection spell to work though an event that lest you choose what hero to bring back (including religious heroes) and to make the Netherblade make resurrecting its victims impossible. (I guess I could use trophies instead, but I didn't want it to carry over from game to game.)
 
Meant to post this before Patch A was anywhere close, but kept on forgetting to.

Be certain that you have downloaded the sourcecode from the first post BEFORE you apply the patch. Patch will include the changes to the sourcefiles in the directory path stated on first post, so unzipping this file AFTER patching overwrites the new source with the old. But you only need this large download once ever, after that all patches automatically update you to the latest version. (and we have a new method of generating patches/releases which should work to avoid forgetting to include the DLL folder in future major release versions)

I know that this makes MY life a whole lot easier at least :) Even though I now have 2 copies of the source on my drive, I never have to worry about inability to generate a debug DLL which works with loaded savegames when I am elbow deep in new features for the next patch/version.
 
I've been trying to make a promotion that grants a promotion to the followers which in turn grants a promotion back to the commander. A bouncing promotion so to speak.

The second promotion applies as it should to followers. I just can't get the bouncing promotion to work. If I don't set it to bMustMaintain the commander gets two permanent copies each time it should get one temporary. If I set it to bMustmaintain, the commander never gets any promotion at all.

Commander promotion:
Spoiler :
Code:
<PromotionInfo>		<!-- Cruel Mistress -->
    <Type>PROMOTION_CRUEL_MISTRESS</Type>
    <Description>TXT_KEY_PROMOTION_CRUEL_MISTRESS</Description>
    <PromotionPrereq>PROMOTION_MISTRESS</PromotionPrereq>
    <MinionPromotions>
        <PromotionType>PROMOTION_CRUEL_MISTRESS_EFFECT</PromotionType>
    </MinionPromotions>
    <UnitCombats>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_ADEPT</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_DISCIPLE</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_COMMANDER</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
    </UnitCombats>
    <Button>Modules\NormalModules\FallInLove\Art\mistress.dds</Button>
</PromotionInfo>

Follower promotion:
Spoiler :
Code:
<PromotionInfo>		<!-- Cruel Mistress Effect -->
    <Type>PROMOTION_CRUEL_MISTRESS_EFFECT</Type>
    <Description>TXT_KEY_PROMOTION_CRUEL_MISTRESS_EFFECT</Description>
    <bEffectProm>0</bEffectProm>
    <bStackEffect>0</bStackEffect>
    <CommanderPromotions>
        <PromotionType>PROMOTION_CRUEL_MISTRESS_BOUNCE</PromotionType>
    </CommanderPromotions>
    <iCombatPercent>-15</iCombatPercent>            
    <UnitCombats>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_ADEPT</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_DISCIPLE</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_COMMANDER</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
    </UnitCombats>
    <Button>Modules\NormalModules\FallInLove\Art\fallinlove.dds</Button>
    <iMinLevel>-1</iMinLevel>
</PromotionInfo>

Bounce promotion:
Spoiler :
Code:
<PromotionInfo>		<!-- Cruel Mistress Bounce -->
    <Type>PROMOTION_CRUEL_MISTRESS_BOUNCE</Type>
    <Description>TXT_KEY_PROMOTION_CRUEL_MISTRESS_BOUNCE</Description>
    <bEffectProm>0</bEffectProm>
    <bMustMaintain>1</bMustMaintain>
    <bStackEffect>1</bStackEffect>
    <iPower>2</iPower>
    <iCombatPercent>15</iCombatPercent>
    <UnitCombats>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_ADEPT</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_ARCHER</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_DISCIPLE</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_MELEE</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_RECON</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
        <UnitCombat>
            <UnitCombatType>UNITCOMBAT_COMMANDER</UnitCombatType>
            <bUnitCombat>1</bUnitCombat>
        </UnitCombat>
    </UnitCombats>
    <Button>Modules\NormalModules\FallInLove\Art\fallinlove.dds</Button>
    <iMinLevel>-1</iMinLevel>
</PromotionInfo>

I also have two more general questions:

I cant find any example of python code looping through the followers of a commander. Is there a way that doesn't involve going through every single unit of the player to check if that unit follows the commander?

Is there a way to have a promotion execute some python code on the death of a unit?
 
bMustMaintain means that any time the unit wouldn't be capable of selecting the promotion for their next level-up (or immediately if it is bNoXP. Also assuming they didn't already have it already) that the promotion will be removed. So using a iMinLevel of -1 along with MustMaintain forces them to automatically lose it.

bStackEffect means that you can have multiple copies of the promotion applied to you. So that is what is letting you get 2 copies, if you intended that you can never have more than 1 applied.

Also, UnitCombat is only required to be listed for MinionPromotions. CommanderPromotions are always given to the Commander, regardless of their UnitCombat.

How I am reading this, Captain has Cruel Mistress, Sergeant under her gets Cruel Mistress Effect, and grants the Captain Cruel Mistress Bounce. End result is -15% for Sergeant, +15% for Captain. Since the bounce is Stacking, if the Captain has 2 Sergeants, each gets -15%, Captain gets +30%.


By permanent, did you mean that even if you remove/delete/move the Followers that the Cruel Mistress Bounce remains in place?
 
bMustMaintain means that any time the unit wouldn't be capable of selecting the promotion for their next level-up (or immediately if it is bNoXP. Also assuming they didn't already have it already) that the promotion will be removed. So using a iMinLevel of -1 along with MustMaintain forces them to automatically lose it.
<snip>
Also, UnitCombat is only required to be listed for MinionPromotions. CommanderPromotions are always given to the Commander, regardless of their UnitCombat.

I added UnitCombat along with bMustMaintain, when I noticed that they were lost instantly.

If I remove iMinLevel = -1, the promotion becomes purchasable, so I must remove UnitCombats as well, which in turn causes bMustMaintain to delete the promotion. Right?

Regardless, I will try some variations.

bStackEffect means that you can have multiple copies of the promotion applied to you. So that is what is letting you get 2 copies, if you intended that you can never have more than 1 applied.

By permanent, did you mean that even if you remove/delete/move the Followers that the Cruel Mistress Bounce remains in place?
Yes.

I want two followers to give two promotions. Currently I'm getting each follower to give two promotions, each time they enter command range. Moving one follower outside and then back in grants two additional promotions each time.

I also had some issues with commander give promotions persisting after the commander was deleted before, but I think that's cleared up since the patch.

How I am reading this, Captain has Cruel Mistress, Sergeant under her gets Cruel Mistress Effect, and grants the Captain Cruel Mistress Bounce. End result is -15% for Sergeant, +15% for Captain. Since the bounce is Stacking, if the Captain has 2 Sergeants, each gets -15%, Captain gets +30%.

Exactly the intention.

With two followers, which is standard for the unit, it's a slightly better Combat promotion at the expense of the followers.
 
Is this all with Patch A? It sounds worse than the bug which Patch A solved, but similar.

Didn't notice your other 2 questions before:

You can ask the Commander how many Minions he has, then loop over that number and ask for each minion.
Code:
for i in range(pComm.getNumMinions()):
  pLoopUnit = pComm.getMinionUnit(i)


Best way I can think of to run python on death of a unit would be a Promotion which grants Immortality and executes some python when removed. That could include killing the unit again if you hadn't intended they actually be immortal you can kill them during that python, though the C++ code might not like them dying just at that particular point. I can fix that up if it does cause a crash though.
 
Is this all with Patch A? It sounds worse than the bug which Patch A solved, but similar.

Ayeup, patch A.

I tested with a normal commander boosting promotion, one without bouncing and that seems to work despite being nearly identical. Gonna try having Cruel Mistress grant that promotion, and see what happens.

Didn't notice your other 2 questions before:

You can ask the Commander how many Minions he has, then loop over that number and ask for each minion.
Code:
for i in range(pComm.getNumMinions()):
  pLoopUnit = pComm.getMinionUnit(i)

Thanks. I figured there was something like that, but I couldn't guess at the name.

Best way I can think of to run python on death of a unit would be a Promotion which grants Immortality and executes some python when removed. That could include killing the unit again if you hadn't intended they actually be immortal you can kill them during that python, though the C++ code might not like them dying just at that particular point. I can fix that up if it does cause a crash though.

Cute. To stop the potential crash I could just apply a fleeting promotion, "Mortal Wound", that deals a bunch of damage when removed. Or considering the use case, "Dying Words" might be more appropriate.
 
I tested with a normal commander boosting promotion, one without bouncing and that seems to work despite being nearly identical. Gonna try having Cruel Mistress grant that promotion, and see what happens.

I'm afraid it is a bug. When granted by the commander the previously well behaved promotion also started handing out double doses of permanent promotions.
 
Technically Regimental Discipline does exactly the same kind of thing as your Cruel Mistress, except it trickles all the way up the chain of command, and does nothing for the Minion itself. So I am rather confused as to why yours isn't working out

EDIT: Crossposted. So Patch A broke RD more than it was before I guess. Well craps.
 
Hi there!

We have a weird issue at Orbis. Some players reported disappearing units without notification and, apparently, in late game. Any idea about what could cause such a bug?

It seems it's random, as reloading prevents the unit to disappear...
 
Are their units on strike and they are missing the message? Completely random means deciding precisely how it is happening is a bugger-all shot in the dark though. Could just be that a message which SHOULD show isn't showing (strike, attack by invisible unit, Haunted Lands effect causing damage on promotion removal...), or it could mean something natural is glitching out (invisible unit moves on tile, pushes them away, but no valid push locations), or some code somewhere is just messing up completely (bad value passing to setXY)


You'll have to hope someone can produce a reproducible save, then scope it out with the debugger.
 
My tester for the game before patch A reported the same thing happening here, Xien - just forgot about it due to the OOS issue killing the game. He kept stating his Trolls were disappearing at random with nothing in the Combat Log to explain why.
 
Allright. If I see anything like that happen myself I will be sure to pass you a save.

About to load up my traditional Sunday game of solo-trying-not-to-get-squished-on-high-difficulty, so we'll see where we get.
 
I'm not familiar enough with the current features of Orbis to know if this is a possibility, but could the disappearing trolls in FF have been Diakonos-related? The "lost" units do completely disappear if nothing else is in range to see them.
 
I'm not familiar enough with the current features of Orbis to know if this is a possibility, but could the disappearing trolls in FF have been Diakonos-related? The "lost" units do completely disappear if nothing else is in range to see them.

We didn't have the Diakono's/Dark Forests option on. So I'm assuming no.
 
Back
Top Bottom