[eINFO] Modbugs

A place to gather bugs that appear as a result of mods only. They would not be reproduceable in the vanilla game. Since I doubt they'll fix modbugs this early in the beta, I think it wouldn't hurt to gather them in one place for when they do want to listen. Also, perhaps other modders can avoid the same bugs.

A modbug would be something that does not perform as expected. See below for examples.

34,660 views 49 replies
Reply #1 Top

Bug: Trait descriptions in their tooltips are cut short with no rhyme or reason.It is not dependant on the amount of characters, or amount of words.

Example: http://i.snag.gy/6qPoX.jpg

Temporary solution: Use newlines (press enter) and split up the description.

First observed in: FE beta 0.77

Reply #2 Top

       <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
        <StrVal>UnitStat_ResistBlunt</StrVal>
        <StrVal2>UnitStat_IsOrc</StrVal2>
            <Value>-1000</Value>
            <Duration>-1</Duration>
        <Effect>Y_Defend_Particle</Effect>
       <vsLower>1</vsLower>
        </GameModifier>

This modifier was in a spell, and applied to an enemy unit. The point was that if the unit later on would be attacked by an enemy unit that had a lower UnitStat_IsOrc, that unit would be able to deal +2000% blunt damage to the unit the spell was cast on.

The strangest thing happened, however... Even though the spell was applied correctly, and the effect played for a while, as soon as I hovered my mouse over the unit the debuff disappeared. I could hover over the unit in the unit list on the left and see the debuff, but if I hovered over it normally, the effect would immediately stop playing and the debuff would not be there. The offender is the <vsLower>1</vsLower>. If I removed that tag, the spell would work (although without the tag functionality). If I added it back in, the same problems appeared again.

First observed in: FE beta 0.77

 

Reply #3 Top

As always, the modding an improvement produces double the improvement (placed in the documents)

and now none of my save game load... great.... i was going to provide a picture

Reply #4 Top

I agree that it is not expected behaviour, but I also find it very useful for modular mods. For example I can have one mod add +1 X resource to metal mines, and another add +1 Y resource to metal mines, and they will work with each other without a problem.

But, of course, there are downsides as well. It makes it difficult to mod the original numbers, such as replacing the mechanics of an Adventurer's Guild.

Reply #5 Top

Which is exactly what I am doing, but what is happening is Adv G cost 2g/turn, give my 5% exp and the random 1xp. aggravating.

Reply #6 Top

Another modbug, when using this modifier

            <GameModifier>
                <ModType>Unit</ModType>
                <Attribute>BattleAutoCastSpell</Attribute>
                <StrVal>MassCurse</StrVal>
                <Value>100</Value>
            </GameModifier>

inside an itemtype instead of an abilitybonusoption (trait), it can be triggered several times in combat. It appears to trigger once, then once for each enemy. The expected behaviour is to trigger once only.

Reply #7 Top

Another modbug.

When I am using abilities from troops, like skills, I use the defendabledamage. For example, the modifier below should hit for damage equal to 1 per Troopcount in fire damage.

      <GameModifier>
            <ModType>Unit</ModType>
                        <Attribute>DefendableDamage</Attribute>
            <AttackStat>UnitStat_Attack_Fire</AttackStat>
            <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                <Expression><![CDATA[[Unit_GetTroopCount]]]></Expression>
            </Calculate>
            <Calculate InternalName="Value">
                <Expression><![CDATA[[Calc]]]></Expression>
            </Calculate>
    </GameModifier>

But for some reason, the Unit_GetTroopCount does NOT function inside this gamemodifier. The returned value from Unit_GetTroopCount (castingunit) is ALWAYS one. The expected behaviour is that the Unit_GetTroopCount properly reads the troopcount from the casting unit.

This one is actually very bad for us modders, because it makes it difficult to add unique skills to our troops, such as special strikes.

Observed in 0.77 beta.

 

 

Edit: Just so we're clear, I do understand how defendabledamage works. And I understand that if I attack a target with no fire resistance with a 9-troopcount unit, this ability should deal 4-9 damage. It ALWAYS deals 1 damage.

Reply #9 Top

I would definitely categorize it as high priority, compared to other modbugs.

Reply #10 Top

This may be a bug in the EXE file but I saw it while looking for tags.

EnemyTroop..EnemyLeader.LiklihoodOfPursuit..LiklihoodOfEscape...Liklihood...StatEffect......

We know this is meeded up in the items and weapons. If this is messed up with respect to internal code it might explain odd map movement sof the AI or something else. Also possible that Likli is Robin's cousin in Sherwood. :grin:

Reply #11 Top

Quoting Heavenfall, reply 7
Another modbug.

When I am using abilities from troops, like skills, I use the defendabledamage. For example, the modifier below should hit for damage equal to 1 per Troopcount in fire damage.


      <GameModifier>
            <ModType>Unit</ModType>
                        <Attribute>DefendableDamage</Attribute>
            <AttackStat>UnitStat_Attack_Fire</AttackStat>
            <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                <Expression><![CDATA[[Unit_GetTroopCount]]]></Expression>
            </Calculate>
            <Calculate InternalName="Value">
                <Expression><![CDATA[[Calc]]]></Expression>
            </Calculate>
    </GameModifier>


But for some reason, the Unit_GetTroopCount does NOT function inside this gamemodifier. The returned value from Unit_GetTroopCount (castingunit) is ALWAYS one. The expected behaviour is that the Unit_GetTroopCount properly reads the troopcount from the casting unit.

This one is actually very bad for us modders, because it makes it difficult to add unique skills to our troops, such as special strikes.

Observed in 0.77 beta.

 

 

Edit: Just so we're clear, I do understand how defendabledamage works. And I understand that if I attack a target with no fire resistance with a 9-troopcount unit, this ability should deal 4-9 damage. It ALWAYS deals 1 damage.

So...there is no MinValue or MaxValue with DefendableDamage anymore?

Reply #12 Top

I only tried using minvalue and maxvalue once, but when I did they weren't working. It is possible that they have been removed altogether for FE. Keep in mind the defendabledamage is in itself slightly random.

 

Reply #13 Top

Anyone know if Stardock is aware of the Likelihood/Liklihood bug?

 

I'm tempted to make a mass replace of Liklihood in all the xml in FE just to see what happens and what breaks.

Reply #14 Top

Either DefendableDamage always returns *something*, or GetNumFireShards is doing something strange, because this:

 <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>DefendableDamage</Attribute>
            <AttackStat>UnitStat_Attack_Fire</AttackStat>
            <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                <Expression><![CDATA[[UnitOwner_GetNumFireShards] * 5]]></Expression>
            </Calculate>
            <Calculate InternalName="Value">
                <Expression><![CDATA[[Calc]]]></Expression>
            </Calculate>
            <PerTurn>1</PerTurn>
            <Duration>3</Duration>
        </GameModifier>

is causing damage even when the caster has zero fire shards.

Edit: Unless Magnar's fire attack > 0 ...?

Reply #15 Top

Maybe GetNumFireShards returns 1 when there are 0, and used for normal basis for spells when there are no extra shards.  This is the way it may have been working in WoM, I recall that GetNum shards may return "number of shards + 1".

Reply #16 Top

No, that's been changed, it returns 0 with 0 shards now. Try the following modifier without a fireshard and with:

 

        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>CurHealth</Attribute>
             <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                <Expression><![CDATA[[UnitOwner_GetNumFireShards] * 100]]></Expression>
            </Calculate>
            <Calculate InternalName="Value">
                <Expression><![CDATA[[Calc] *-1]]></Expression>
            </Calculate>
        </GameModifier>

It deals no damage with 0 fire shards, and 100 damage with 1 fireshards

 


 

I don't know what's wrong with defendabledamage. It may be that we just aren't understanding how it is supposed to work.

Reply #17 Top

Tested minvalue and maxvalue last night. Non-functional. I'd love SD to hook them back up as limits within a gamemodifier. That way if I want to cap a spell effect I could set one or both and the calculated value would be bound within the limits.

Defendable damage in spells is flat out broken. If you take it out and assume you will just do X damage (in this case I set a spell to do 6 points with no modifiers of my own applied) per cast you will be surprised when nothing happens. No damage to target at all. With the attribute selected, I am seeing is damage against unarmored opponents exceeding the max calulatable effect of the spell. Again my 6 point static value was scoring 7, 8, and 9 points. Now the odd thing. Once I was attacking someone with armour, the values seemed to be okay. Either way this is a big bug on two front and it has another "bug" for lack of a better term. Why is it that a defendable damage spell can't be dodged/blocked like other weapon attacks?

Again, in order to have some lattitute for making tons of cool spells we really need to be able to have spells that can branch between defendable (including dodge) and autohit. To me this is tagging the spell with DefendableDamage. Next we need to be able to trigger random amounts (limited by min and max value would be the optimal here) or have a static effect. This would give any simple spell four possible combinations of effect with four mana cost levels to apply against it.

I would also be happy if defendableDamage indicated "random" versus armor and the application of RangedAttack would trigger dodge/block when cast.

Right now it has to be the bugged DefendableDamage or nothing.

Reply #18 Top

Update: You can get static damage using the following with defendabledamage not used-

<GameModifier>            

<ModType>Unit</ModType>            

<AttackStat>UnitStat_Attack_Fire</AttackStat>            

<!--Attribute>DefendableDamage</Attribute-->             

<ModType>Unit</ModType>            

<Attribute>CurHealth</Attribute>            

<Value>-6</Value>         

</GameModifier>

 The spell always does 6 points in this case.

Reply #19 Top

I was thinking more along the lines that UnitStat_Attack_Fire was set to a non-zero value.  It's somewhat unclear to me what all of these new attack/defense types are really doing, and how they affect and interact with each other. 

Reply #20 Top

Not 100% sure, but I think UnitStat_Attack_X just sets the type of damage for the effect and should get matched up to defense_fire when calculating damage. Of course the only defenses I've seen are Blunt, Cutting and Pierce.

Reply #21 Top

Yes, the elemental powers have no "defense", only resistance. The physical powers have only defense, no resistance. I have a mini-lib-mod that adds resistances to the physical powers. http://dl.dropbox.com/u/32649007/LIB_Damagetypemod.rar

Quoting Capn, reply 18
Update: You can get static damage using the following with defendabledamage not used-

<GameModifier>            

<ModType>Unit</ModType>            

<AttackStat>UnitStat_Attack_Fire</AttackStat>            

<!--Attribute>DefendableDamage</Attribute-->             

<ModType>Unit</ModType>            

<Attribute>CurHealth</Attribute>            

<Value>-6</Value>         

</GameModifier>

 The spell always does 6 points in this case.

I don't like this. It's two modifiers in one. Who knows what is read and what is done. It is not something we can depend on. You say it deals 6 damage every time it hits. That is not how defendabledamage is supposed to work. DefendableDamage is supposed to hit somewhere between value and value/2 (modified for defense and resistances). I don't think that modifier in any way counts as defendabledamage, it is a simple curhealth modifier.

Reply #22 Top

Heavenfall,

The DefendableDamage is commented out and not used in the above call. The effect just hits the target for 6 points of damage with no defenses applied like the Barbs spell. It is a way to get an automatic damage of x points.

Can we pester a Dev for some formulas on how defendabledamage really works with all of the riders for extra damage? It is obvious 0 armor targets are getting hit for more than the effects are set for.

Reply #23 Top

Another modbug.

For some reason, this

    <PlayerAbilityType InternalName="A_UnitStat_Accuracy">
        <DisplayName>Accuracy Bonus</DisplayName>
        <Description>Provides a bonus to the hit points of all units.</Description>
        <Icon>Kingdom_Crest_02.png</Icon>
</PlayerAbilityType>

does not work in a mod file, but it does work if it is inserted into the core file CorePlayerAbilities.xml.

Reply #24 Top

Why does it mention Accuracy, and then talk about providing a bonus for hit points?  Must be a copy and paste error. =)

Reply #25 Top

Yes, but that is not what doesn't function. With that PlayerAbilityType, I should be able to give a faction a faction-wide accuracy bonus by calling the A_UnitStat_Accuracy. This only works if the PlayerAbilityType has been defined in a core file. If it was defined in a mod file, it does not work.