cohka cohka

Modding questions/help thread

Modding questions/help thread

Figured we needed a thread for questions that didn't need to take up valuable room from talented mod'rs.

1,924,174 views 844 replies
Reply #576 Top

Does anybody know if there's a way to make units be able to have more than 3 abilities in the design stage?

 

I tried looking in the ElementalDefs - nothing.

 

All I could find is that the accessories was limited to 4 by default:

 

<MaxEquippedAccessoryCount>4</MaxEquippedAccessoryCount>

 

But nothing about abilities. Is it hardcoded?

Reply #578 Top

Look at A_Traits in CorePlayerAbilities.xml

 

<PlayerAbilityType InternalName="A_Traits">
  <DisplayName>Traits</DisplayName>
  <Description>The amount of traits this faction can support.</Description>
  <Icon>FactionAbility_Traits.png</Icon>
  <UsedAsMultiplier>0</UsedAsMultiplier>
  <DefaultValue>4</DefaultValue>
</PlayerAbilityType>

 

 

 

+1 Loading…
Reply #579 Top

Dang, need to be quicker with the buzzer....

Reply #580 Top

Thanks for the modding help. Will give it a shot. +Karma

 

Yeah I was hoping for something like that:



Aiming for something where one faction would, as a bonus, get one additional trait.

 

 

Reply #583 Top

It seems that changing

 

<A_Traits>5.0000</A_Traits>

 

from 4 does the trick.

 

 

Edit:

 

<A_Traits>6.0000</A_Traits>

 

does not work at all. Looks like 5 is the upper limit.

 

 

Quoting Primal_Savage, reply 581



Reduced 78%Original 500 x 563
End of Primal_Savage's quote

 

Meow.

 

 

Edit 2:

Looks like it's hardcoded to 5.

Reply #586 Top

Quoting Primal_Savage, reply 584


Quoting UnleashedElf, reply 583Looks like it's hardcoded to 5.

 

I was able to go up to 9 (which seems to be the limit as far as the user interface is concerned)
End of Primal_Savage's quote

 

Odd? I could only go up to 5?

 

Did you use

<A_Traits>9.0000</A_Traits>

 

in your race config?

Reply #587 Top

Quoting UnleashedElf, reply 580
Aiming for something where one faction would, as a bonus, get one additional trait.
End of UnleashedElf's quote

You should be able to do that via a facion trait if you want, something like this in a faction trait ability should work I think...

 

<GameModifier>

  <ModType>Player</ModType>
  <Attribute>AbilityBonus</Attribute>
  <StrVal>A_Traits</StrVal>
  <Provides>Faction has one more traits that other factions.</Provides>
  <Value>1</Value>
</GameModifier>

Reply #589 Top
Quoting abob101, reply 587




You should be able to do that via a facion trait if you want, something like this in a faction trait ability should work I think...

 

<GameModifier>

  <ModType>Player</ModType>
  <Attribute>AbilityBonus</Attribute>
  <StrVal>A_Traits</StrVal>
  <Provides>Faction has one more traits that other factions.</Provides>
  <Value>1</Value>
</GameModifier>

End of abob101's quote

 

One seems to work perfectly, right now I think the discussion is mostly centered around the upper limit.

 

Quoting Primal_Savage, reply 588


Quoting UnleashedElf, reply 586

Did you use <A_Traits>9.0000</A_Traits> in your race config?

 

Tried both CorePlayerAbilities.xml (<DefaultValue> 7 and 9) [English folder] and <A_Traits>10.0000</A_Traits> in a custom RaceConfig [Mod folder]. The max ended up being 9. And what abob101 says should also do the job.

 
End of Primal_Savage's quote

 

 

Ok, will give it a shot and report back what I find.

Reply #590 Top

Ok findings:

 

- It looks like starting units are indeed limited to 5 traits

 

- You can however give as many traits as you want to units in the unit designer

+1 Loading…
Reply #591 Top

Regarding adding the trait slot(s) as a race/faction ability: if it matters to you, having extra selectable trait slots will probably not be a very beneficial ability for the faction when controlled by AI.  Just look at how frequently the AI chooses the "base" unit designs without even using all three default slots.  

At the very least you'd need to pre-design units to make use of all the slots at various tech levels, and I don't remember anyone ever having tested whether or not the AI will choose designs with > 4 traits.  

For larger values of additional trait slots, it could potentially also cause problems on higher difficulty levels where the AI gets "bonus" traits for its units applied on top of the ones in the unit design.  Worth testing, anyway.

+1 Loading…
Reply #592 Top

Quoting Crastiloowa, reply 591

Regarding adding the trait slot(s) as a race/faction ability: if it matters to you, having extra selectable trait slots will probably not be a very beneficial ability for the faction when controlled by AI.  Just look at how frequently the AI chooses the "base" unit designs without even using all three default slots.  

At the very least you'd need to pre-design units to make use of all the slots at various tech levels, and I don't remember anyone ever having tested whether or not the AI will choose designs with > 4 traits.  

For larger values of additional trait slots, it could potentially also cause problems on higher difficulty levels where the AI gets "bonus" traits for its units applied on top of the ones in the unit design.  Worth testing, anyway.
End of Crastiloowa's quote

 

Yeah there is that ... the AI has never been great at unit design.

Reply #593 Top

Odd situation:

 

<ImprovementType InternalName="Fort">
    <Prereq>
      <Type>RestrictedAbilityBonusOption</Type>
      <Attribute>GreatFortressTest</Attribute>
      <Target>Player</Target>
    </Prereq>
  </ImprovementType>

 

Although the faction has GreatFortressTest, it can still build Forts?

Reply #595 Top

The problem lies with the fact that one never builds a fort. The city levels to a fort. So you prevent the city from leveling to a fort.

That is go to CoreAbilities.xml and add your prereq to 


<AbilityBonus InternalName="CityLevel_UnlockLevel2">

    <AbilityBonusOption InternalName="UnlockFortress">
        <Prereq>
            <Type>RestrictedAbilityBonusOption</Type>
            <Attribute>GreatFortressTest</Attribute>
            <Target>Player</Target>
        </Prereq>
    </AbilityBonusOption>

</AbilityBonus>

This should prevent the choice from being available on city level-up.

Reply #597 Top

Quoting parrottmath, reply 595

The problem lies with the fact that one never builds a fort. The city levels to a fort. So you prevent the city from leveling to a fort.

That is go to CoreAbilities.xml and add your prereq to 


<AbilityBonus InternalName="CityLevel_UnlockLevel2">

    <AbilityBonusOption InternalName="UnlockFortress">
        <Prereq>
            <Type>RestrictedAbilityBonusOption</Type>
            <Attribute>GreatFortressTest</Attribute>
            <Target>Player</Target>
        </Prereq>
    </AbilityBonusOption>

</AbilityBonus>

This should prevent the choice from being available on city level-up.
End of parrottmath's quote

 

Nah it was building a fort as Primal said. Got it fixed last night.

Reply #598 Top

Out of curiosity, is there a way to selectively apply:

 

<ModType>CityTrainingBonus</ModType>

 

For example, only archers get 1 type of bonus, while melee combat units get another type of bonus?

 

Reply #599 Top

Quoting UnleashedElf, reply 598
CityTrainingBonus
End of UnleashedElf's quote

Hypothetically, you could have the CityTrainingBonus apply an attribute which specified that a spell be cast at start of combat (similar to the "Noble Legacy" for Pariden.)  The spell could then check a condition and apply results based on the results of the check (boolean.)  Not sure if there are any testable conditions to see if a unit has an equipped ranged weapon, though.

Reply #600 Top

Quoting Crastiloowa, reply 599




Hypothetically, you could have the CityTrainingBonus apply an attribute which specified that a spell be cast at start of combat (similar to the "Noble Legacy" for Pariden.)  The spell could then check a condition and apply results based on the results of the check (boolean.)  Not sure if there are any testable conditions to see if a unit has an equipped ranged weapon, though.
End of Crastiloowa's quote

 

Hmm, could something like "class" be used for that?