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,921,911 views 844 replies
Reply #276 Top

alright trying to add a feature to make some forms of damage do extra damage to a creature. like say light damage deal more damage to undead? i was thinking i had to give them a negative defense to that form of damage was wondering if there is an easier way.

Reply #277 Top

Give them negative resistance instead.

Reply #279 Top

Does anyone remember how to make a specific world resource always spawn with a specific sovereign? Wasn't there a way to have, say, a wild wheat or iron ore spawn when you had some trait?

Thanks!

Reply #280 Top

I don't remember of a way, but you can spawn world resources using a quest and you can give hidden resources to your sovereign to trigger such a quest at the beginning of the game.

Reply #281 Top

Quoting LightofAbraxas, reply 279
Does anyone remember how to make a specific world resource always spawn with a specific sovereign? Wasn't there a way to have, say, a wild wheat or iron ore spawn when you had some trait?

Thanks!

I'm pretty sure that doesn't work anymore.

Reply #282 Top

Yeah, that old tag was broken in 1.1. You'll have to go the quest route.

Reply #283 Top

Does anyone know what the <UpgradePathID> tag does for champion perks? It seems redundant with everything having prerequisites?

Reply #284 Top

Is there any other simpler way besides creating a unique resource cost for training a unit, to limit having a unit being trained only once per game?

Reply #285 Top

Quoting Ivon1631, reply 284
Is there any other simpler way besides creating a unique resource cost for training a unit, to limit having a unit being trained only once per game?

You could try 'training' the unit by means of a quest (as with Bacco the Beggar or Ascian), or having something grant you a one-per-faction or one-per-world structure that spawns the unit the way that the Binding Altars spawn demons or the monster recruitment resources spawn monsters. I don't know that having a spawning structure would allow you to prevent it from ever being trained again if it dies, though you could put an enormously long spawn timer on it, but if you train it by quest I think you can make that quest not occur on the map again. You could also have the unit 'trained' by means of a consumable item such as the Token of the Sand Golem and then make certain that there is only one way to get one of those (e.g. purchase it at sovereign creation, or as a reward for a quest with the same lack of repeatability that the Arena of the Slakhanan has, though if it's a quest reward you might as well have just awarded the unit at the end of the quest).

If you want to require the player to occupy time in a city's build queue in order to gain the unit and do not want the unit to spawn from a structure the way Shard Demons do with Binding factions, I'd suggest creating a structure that you grant at some point in a quest that must be built in order to complete the quest, and have completion of the quest spawn the unit, if possible at the location where the structure was built. This way, you can attach all the resource costs and production requirements you wanted on your unit to the special structure. Since the unit in this case is a quest reward rather than a unit spawned from a recruitment structure, you don't need to worry about unit resurrections as with Shard Demons, and since it's not a unit you can produce from a city you don't need to worry about having a special resource in place to prevent training additional such units. Make the quest non-repeatable and you won't need to worry about having multiples of the unit.

Reply #286 Top

Quoting LightofAbraxas, reply 283
Does anyone know what the  tag does for champion perks? It seems redundant with everything having prerequisites?

It was added a few versions ago in LH.  

I could be wrong but I think that's what is now used to determine when to hide stackable abilities - like when you have dodge1 and dodge2, only dodge2 is displayed on the unit card.  Pretty sure it's now the upgradepath that does that rather than the prereqs.

 

+1 Loading…
Reply #287 Top

Any way to make a unit make an attack sound regardless of weapons?

Trying to tie this line into an ability instead of weapon: <AttackSFX>Hit_LightningHammer_03</AttackSFX>  

Since abilities doesn't have easy artdef for me to copy from it obviously didn't work alone. ;)

Reply #288 Top

Have you considered tying the ability to a spell?

Reply #289 Top

Thanks everyone. Another question- does anyone know of a GameModifier tag that could be used in a spell to grant +1 XP/ season? I've tried:

<GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_Experience</StrVal>
<PerTurn>1</PerTurn>
<Value>1</Value>
<Provides>+1 Experience per season</Provides>
</GameModifier>

and a variation with GiveExperience per turn, but I haven't been able to find anything that works?

Also: I've been toying around with new resources, and have successfully added some, but when I mouse over the resource in the top bar, the description reads as "String Not Found". I have a description tag in the code for it, anyone know why it's not being read?

Reply #290 Top

Quoting LightofAbraxas, reply 289
Also: I've been toying around with new resources, and have successfully added some, but when I mouse over the resource in the top bar, the description reads as "String Not Found". I have a description tag in the code for it, anyone know why it's not being read?

Yeah bummer that, it's not the description that shows.  You can fix this, but it requires editing core files.  Specifically, go take a look at elemental.str and search for [TABLEALIAS GlobalResourceStatEntry]... you'll see how it works.  I believe I got a custom resource to display properly in the past by adding entries in there.

 

 

Reply #291 Top

Anyone know if <UnitStat_Intelligence> against a (Monster) UnitType actually has any effect..... and if so how it works?

Reply #292 Top

I think it had something to do with monsters being able to attack cities, although I'm not sure of the specifics.

Reply #293 Top

Two questions, first any idea why this calculation refuses to work? (trying to tie an essence value into "building output" for troops) The code is combined and edited from Alchemist and the Heart of fire spell.

Code: xml
  1. &lt;GameModifier&gt;
  2. &lt;ModType&gt;CityTrainingBonus&lt;/ModType&gt;
  3. &lt;Attribute&gt;TrainingBonus_ApplyUnitModifier_Add&lt;/Attribute&gt;
  4. &lt;HasUpgradableValue&gt;1&lt;/HasUpgradableValue&gt;
  5. &lt;StrVal&gt;UnitStat_MagicResist&lt;/StrVal&gt;
  6. &lt;Calculate InternalName="Value" ValueOwner="OwnerCity"&gt;
  7. &lt;Expression&gt;&lt;![CDATA[[TileYieldEssence] * 5]]&gt;&lt;/Expression&gt;
  8. &lt;/Calculate&gt;
  9. &lt;Provides&gt;+5 Spell Resist per Essence&lt;/Provides&gt;
  10. &lt;/GameModifier&gt;

Secondly, anyone have any good tips how to remove the old "Tower of Magi" building. All my prereqs so far have failed for some reason, and trying to mess with the activation ability has failed too. 

Edit: Tried making an additional calculation for just value, still didn't work... 

Reply #294 Top

Quoting abob101, reply 291

Anyone know if <UnitStat_Intelligence> against a (Monster) UnitType actually has any effect..... and if so how it works?

I am pretty sure Frogboy replied to one of my threads back at the beginning of FE that it controls the aggressiveness level of a monster in its likelihood to attack units nearby as well as cities.

Reply #296 Top

To test out modifications, how do you get a Quest Hero to join you without doing the quest?  I've tried making a Random Event with an auto-fulfilled success condition and giving that hero, on a random map with no quests and More Often random events and a definite trigger for the RandomEventQuest, but it doesn't work.

Reply #297 Top

Quoting StevenAus, reply 296
To test out modifications, how do you get a Quest Hero to join you without doing the quest?

If all you want is to see the Hero in action, can't you just add this to the Sov you want to test with...

 

<GameModifier>
  <ModType>Map</ModType>
  <Attribute>SummonUnit</Attribute>
  <UnitClass>NameOfYourTestChampionOrUnit</UnitClass>
  <Value>1.0000</Value>
  <Multiplier>1.0000</Multiplier>
</GameModifier>

 

So what I do is have a "Test" sov... and I go and add stuff like this to the xml definition for that Sov... when use that guy for testing stuff.

Fairly sure that will work.

Reply #298 Top

Do you have a suggestion for how to remove the first champion reward as well then? (skipping right to the lvl 3 one) Making some funny sovereign/champion pairs from scratch could be interesting. And as a bonus, it would be easier to make them not share experience ;)

Edit: While I am at that thread of thinking, is it possible to make a Sovereign and Champion share xp? So they both level at the same time?

 

Reply #299 Top

Quoting abob101, reply 297



Quoting StevenAus,
reply 296
To test out modifications, how do you get a Quest Hero to join you without doing the quest?


If all you want is to see the Hero in action, can't you just add this to the Sov you want to test with...

 

<GameModifier>
  <ModType>Map</ModType>
  <Attribute>SummonUnit</Attribute>
  <UnitClass>NameOfYourTestChampionOrUnit</UnitClass>
  <Value>1.0000</Value>
  <Multiplier>1.0000</Multiplier>
</GameModifier>

 

So what I do is have a "Test" sov... and I go and add stuff like this to the xml definition for that Sov... when use that guy for testing stuff.

Fairly sure that will work.

This will not ensure that the unit is a champion if you do it this way. You need to create a spell that will summon a champion unit. The answer already lies within this thread.

As to the random event, you need a city in order for a random event to trigger via a turn.

+1 Loading…
Reply #300 Top

Quoting sjaminei, reply 298

Do you have a suggestion for how to remove the first champion reward as well then? (skipping right to the lvl 3 one) Making some funny sovereign/champion pairs from scratch could be interesting. And as a bonus, it would be easier to make them not share experience

CoreGameEvents.xml ?

Code: xml
  1.     &lt;QuestDef InternalName="GameEvent_Champion_1"&gt;
  2.         &lt;DisplayName&gt;Champions Available&lt;/DisplayName&gt;
  3.         &lt;QuestClass&gt;Minor&lt;/QuestClass&gt;
  4.         &lt;Repeatable&gt;0&lt;/Repeatable&gt;
  5.         &lt;TriggerType&gt;FactionResourceLevel&lt;/TriggerType&gt;
  6.         &lt;TriggerStringData&gt;Fame&lt;/TriggerStringData&gt;
  7.         &lt;TriggerData&gt;3&lt;/TriggerData&gt;
  8.         &lt;DoNotDisplayStartPopup&gt;1&lt;/DoNotDisplayStartPopup&gt;
  9.         &lt;!--&lt;Description&gt;Your fame has grown far and wide, attracting Legendary Heroes to your cause.  But only one will join your service.&lt;/Description&gt;--&gt;
  10.         &lt;!--&lt;FullscreenMovie&gt;Movies\Minicut_Event_TheRevelry.bik&lt;/FullscreenMovie&gt;--&gt;
  11.         &lt;Treasure&gt;
  12.             &lt;GameModifier InternalName="Reward1"&gt;
  13.                 &lt;ModType&gt;Player&lt;/ModType&gt;
  14.                 &lt;Attribute&gt;RecruitFreeChampion&lt;/Attribute&gt;
  15.                 &lt;Value&gt;1&lt;/Value&gt;
  16.             &lt;/GameModifier&gt;
  17.         &lt;/Treasure&gt;
  18.         &lt;QuestObjectiveDef&gt;
  19.             &lt;ObjectiveID&gt;0&lt;/ObjectiveID&gt;
  20.             &lt;QuestEnd&gt;1&lt;/QuestEnd&gt;
  21.         &lt;/QuestObjectiveDef&gt;
  22.     &lt;/QuestDef&gt;

Over-write " TriggerData" value to -1?