Modding questions/help thread

By on June 1, 2013 9:05:52 PM from Elemental Forums Elemental Forums

cohka

Join Date 07/2007
0

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

843 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
February 16, 2014 11:54:52 PM from Elemental Forums Elemental Forums

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?

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 12:17:02 AM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 12:19:31 AM from Elemental Forums Elemental Forums

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>

 

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 12:20:40 AM from Elemental Forums Elemental Forums

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

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 12:37:20 AM from Elemental Forums Elemental Forums

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.

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 1:00:49 AM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 1:04:30 AM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 1:08:00 AM from Elemental Forums Elemental Forums

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,



Reduced 78%Original 500 x 563

 

Meow.

 

 

Edit 2:

Looks like it's hardcoded to 5.

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 1:41:41 AM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 1:50:22 AM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 2:17:29 AM from Elemental Forums Elemental Forums

Quoting Primal_Savage,


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)

 

Odd? I could only go up to 5?

 

Did you use

<A_Traits>9.0000</A_Traits>

 

in your race config?

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 2:55:17 AM from Elemental Forums Elemental Forums

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

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>

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 3:27:30 AM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 10:25:14 AM from Elemental Forums Elemental Forums

Quoting abob101,




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>

 

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

 

Quoting Primal_Savage,


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.

 

 

 

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

Reason for Karma (Optional)
Successfully updated karma reason!
February 17, 2014 11:34:19 PM from Elemental Forums Elemental Forums

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

Reason for Karma (Optional)
Successfully updated karma reason!
February 18, 2014 8:40:32 AM from Elemental Forums Elemental Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
February 18, 2014 1:13:50 PM from Elemental Forums Elemental Forums

Quoting Crastiloowa,

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.

 

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

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 1:01:42 AM from Elemental Forums Elemental Forums

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?

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 2:07:33 AM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 8:16:41 AM from Galactic Civilizations III Forums Galactic Civilizations III Forums

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.

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 1:24:42 PM from Elemental Forums Elemental Forums

N/A

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 1:36:31 PM from Elemental Forums Elemental Forums

Quoting parrottmath,

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.

 

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

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 4:24:23 PM from Elemental Forums Elemental Forums

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?

 

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 4:39:23 PM from Elemental Forums Elemental Forums

Quoting UnleashedElf,
CityTrainingBonus

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.

Reason for Karma (Optional)
Successfully updated karma reason!
February 19, 2014 4:41:38 PM from Elemental Forums Elemental Forums

Quoting Crastiloowa,




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.

 

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

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #108433  walnut3   Server Load Time: 00:00:00.0000625   Page Render Time: