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,011 views 844 replies
Reply #101 Top

@Xethros - It would really make it easier if you fix up the formatting of the code you pasted in so that each tag is on it's own line, not sure what you've done there but it's really hard to read with it all wrapping like that.

Reply #102 Top

So, I get the spell to show up for me in my game. How are you implementing the spell in your game?

I copied your code put it in an xml file, stuck that in my mods folder with mods enabled from the in-game options. Spell shows Up and I can cast it.

Edit: I even get the unit to join the army, and so the spell is working as intended. Not sure I see a problem with your code beyond your implementation of where you are putting the xml files. I created two xml files one to hold the spell and the other the unit and placed these in the mods directory (really the items directory) in the legendary heroes documents folder and it showed up just fine.

Reply #103 Top


Ah yes I see... I'm an idiot. I kept putting the text files I was editing with notpad directly into the notepad files I had opened for the CoreSpells and CoreUnits xmls. I didn't realize you had to put them in xml format in the Mods folder.  That would have been nice to know three days ago when I started doing this. Would have saved myself some headache >_>.

 

Oh well. Thanks for your help parrottmath, abob101, heavenfall, and anyone else who helped me.

 

Now onto my next question:

 

Is it possible to make some of the in game items buyable from the character item shop. I mean the rarer items. I want a little more variety when I'm outfitting any heroes or champions I have.  But I want to make the items really expensive.

Reply #104 Top

Yes, you can make them available.

First, their cost is identical to the value found in <ShopValue> tag. A portion of that is also used when selling the item, so keep that in mind (you want to avoid a situation where a player finds an item then sells it for huge cash in start of game).

Second, how is an item unlocked? There are two ways to unlock items in the shops. The first is that they are always there, you can see examples in CoreImprovements.xml with xml like this

<UnlocksShopItem>SaltedPork</UnlocksShopItem>

the second way is to have them unlocked from a technology. For example in Burning Axe we see this

        <Prereq>
            <Type>Tech</Type>
            <Attribute>Enchantment</Attribute>
        </Prereq>

meaning the item is unlocked by that technology (note it is the internalname of the techdef, not always identical to what you see in-game; see Techs_Amarian.xml).

The simplest way would be to take an existing gameitemtype and just insert a prereq for a technology like above. You can further limit the item if, for example, you want it to be only available to certain races or factions with certain faction abilities.

 

 

Reply #105 Top


Cool thanks.  I'll have to give that a try. *goes to make his character faction overpowered cackling evilly*

Reply #106 Top

When customizing things (in this case a path)

<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
</AIData>

 

Am i correct to assume the higher the better?  So that the AI will more likely choose a particular trait when it is available?

Do these work like %'s or index values? 

 

 

 

Reply #107 Top

Posting this here since it gets more visibility, if anyone is interested in adding destructible walls for city fights here is how it can be done.  I don't have time to do it or I would.

Quoting halmal242, reply 3

Well, there is a way to create this but its a bit convoluted right now.  If you make a unit that has very high melee attack and defense and then use a post model for the graphics it will spawn at the front of the line.  You then create a spell that auto-summons directly ahead of the unit at the beginning of combat 3 units similar to the area covered by an axe sweep.  You set it up to summon 3 wall units that have a debuff applied to them called wall stun, you would have to make this such that they are immovable and can not attack as well as 100% prone resistant.  You then have destructible walls that the defending units can pass through but offensive units can't.  Set the wall structure improvements within the city to auto-summon the post units or hub units for a better name at the beginning of combat such that they would cover the front row.  Hope this makes sense.  I have been messing around with this idea for a while but I just don't have the time to build it.

Once this is done you just put the tactical city battle maps from FE into FE:LH and it should work for outer destructible walls.  Enjoy.

Reply #109 Top

Polish question, where do I fix the tooltip for the customizing Faction traits? I removed Scrying pool from Enchanters and gave them a Warding Kite Shield instead, since picking enchanters was a no brainer every time. 

It works fine but the tooltip when hovering still says the old line instead of the new I made. (made a duplicate of the old in a new XML file btw if that matters)

 

Reply #110 Top

It is what you see in the <Provides> tag in the gamemodifier.

Reply #111 Top

Hmm. No way to remove the old lines there? I thought it wasn't working because I still saw the old messages (my modification comes after).

As I mentioned I copied the entrance from enchanters in CoreAbilities.xml, and put it into my own file. (I want it to be easier to see what I do etc. without having to look at the source all the time)

I did a workaround with the Scrying Pool building (made the old building impossible to make first and made a new), do I need to do something similar for descriptions too?

Reply #112 Top

There's no way to remove a <Provides> tag from an existing abilitybonusoption from the /mods/ folder. As you say, you'll need to make the old one unavailable and come up with a new one.

Reply #113 Top

Quoting Heavenfall, reply 112
There's no way to remove a <Provides> tag from an existing abilitybonusoption from the /mods/ folder. As you say, you'll need to make the old one unavailable and come up with a new one.

That's turning out to be my beef.

As you look at the 1.2 changelog, I've got a whole bunch of balance changes that I'm aiming to make a mod out of. Currently I've just been replacing code in the game directory. However, if I restore that to original and impliment a mod to those effects, I'm going to get duplicate information popping up all over the place.

With additions, it can be managible. My +25 Fame Wonder can provide +10 Fame from the original and +15 Fame from the mod. But what do I do if I want to overwrite information? What if I wanted that +10 Fame to be a +2 Fame ? Do I have to add a -8 Fame ?

Those provides tags are another problem. How do I cancel out an original provides tag so that I can add my own updated one in the mod?

Reply #114 Top

Well, the situation doesn't change from one post to the next. See my previous reply. You can also overwrite the install file instead of doing it from /mods/.

Reply #115 Top

Quoting Heavenfall, reply 114
Well, the situation doesn't change from one post to the next. See my previous reply. You can also overwrite the install file instead of doing it from /mods/.

x_x

yeah...that's what I've been doing to date. Just wanted to make installing the mod very easy to undo...should players want to undo it.

 

Reply #117 Top

I'm trying to make a mod that adds an ability similar to Beast Lord, but that only works on Shrills. I've made a new UnitStat for Shrills and applied it to the existing Shrill enemies in the game, and i've attempted to make the spell only work on Shrills, but I've just guessed at how I would do this, and it currently doesn't work, they always resist.

 

Here's what i've got:

Code: xml
  1. &lt;SpellDef InternalName="TameShrill"&gt;
  2. &lt;DisplayName&gt;Tame Shrill&lt;/DisplayName&gt;
  3. &lt;Description&gt;Take control of the targeted Shrill unless it resists.&lt;/Description&gt;
  4. &lt;Image&gt;S_Domination_Painting.png&lt;/Image&gt;
  5. &lt;IconFG&gt;T_Tame_Icon.png&lt;/IconFG&gt;
  6. &lt;AutoUnlock&gt;1&lt;/AutoUnlock&gt;
  7. &lt;CanStack&gt;0&lt;/CanStack&gt;
  8. &lt;Cooldown&gt;10&lt;/Cooldown&gt;
  9. &lt;SpellBookSortCategory&gt;Unit&lt;/SpellBookSortCategory&gt;
  10. &lt;SpellBookSortSubCategory&gt;Charm&lt;/SpellBookSortSubCategory&gt;
  11. &lt;SpellType&gt;Tactical&lt;/SpellType&gt;
  12. &lt;SpellClass&gt;Offensive&lt;/SpellClass&gt;
  13. &lt;SpellSubClass&gt;Other&lt;/SpellSubClass&gt;
  14. &lt;SpellTargetType&gt;EnemyUnit&lt;/SpellTargetType&gt;
  15. &lt;SpellTargetCreatureType&gt;Elemental&lt;/SpellTargetCreatureType&gt;
  16. &lt;IsResistable&gt;1&lt;/IsResistable&gt;
  17. &lt;Range&gt;1&lt;/Range&gt;
  18. &lt;Prereq&gt;
  19. &lt;Type&gt;AbilityBonusOption&lt;/Type&gt;
  20. &lt;Attribute&gt;TrainShrills&lt;/Attribute&gt;
  21. &lt;Target&gt;Player&lt;/Target&gt;
  22. &lt;/Prereq&gt;
  23. &lt;SpellResourceCost&gt;
  24. &lt;Resource&gt;Mana&lt;/Resource&gt;
  25. &lt;Amount&gt;40&lt;/Amount&gt;
  26. &lt;/SpellResourceCost&gt;
  27. &lt;GameModifier&gt;
  28. &lt;ModType&gt;Unit&lt;/ModType&gt;
  29. &lt;Attribute&gt;CharmTarget&lt;/Attribute&gt;
  30. &lt;Calculate InternalName="Value"&gt;
  31. &lt;Expression&gt;&lt;![CDATA[[Calc] - 100]]&gt;&lt;/Expression&gt;
  32. &lt;/Calculate&gt;
  33. &lt;Calculate InternalName="Calc" ValueOwner="TargetUnit"&gt;
  34. &lt;Expression&gt;&lt;![CDATA[[UnitStat_IsShrill]*100]]&gt;&lt;/Expression&gt;
  35. &lt;/Calculate&gt;
  36. &lt;/GameModifier&gt;
  37. &lt;AIData AIPersonality="AI_General"&gt;
  38. &lt;AIPriority&gt;5&lt;/AIPriority&gt;
  39. &lt;/AIData&gt;
  40. &lt;HitSoundFX&gt;Spell_SilverTongue_01&lt;/HitSoundFX&gt;
  41. &lt;SpellDefEffect&gt;
  42. &lt;EffectName&gt;T_Tame_Particle&lt;/EffectName&gt;
  43. &lt;LocalPosition&gt;0,0,0&lt;/LocalPosition&gt;
  44. &lt;EffectScale&gt;1&lt;/EffectScale&gt;
  45. &lt;EffectDelay&gt;0&lt;/EffectDelay&gt;
  46. &lt;SnapToTerrain&gt;1&lt;/SnapToTerrain&gt;
  47. &lt;/SpellDefEffect&gt;
  48. &lt;/SpellDef&gt;

Reply #118 Top

Did you remember to create the unitstat like they do in CoreUnitStats.xml?

Are you getting a RESIST or is it just not working? Because if it is being resisted that's spell mastery vs spell resist issue.

 

Also you need to get the calculations right

<Calculate InternalName="Value" ValueOwner="TargetUnit">
<Expression><![CDATA[[UnitStat_IsShrill]*100]]></Expression>
</Calculate>

is all you need (if shrills have 1 in that unitstat). The charm spell is a chance from 1 to 100, but you add +100 if they are shrill (good) and then remove 100 anyway (bad).

Reply #119 Top

I was getting resists until I took away <IsResistable>, and then it just wasn't working, they wouldn't come over.

 

This is the unistat:

 

Code: xml
  1. &lt;PlayerAbilityTypes&gt;
  2. &lt;UnitStatType InternalName="UnitStat_IsShrill"&gt;
  3. &lt;DisplayName&gt;Hidden&lt;/DisplayName&gt;
  4. &lt;DisplayNameShort&gt;Hidden&lt;/DisplayNameShort&gt;
  5. &lt;Description&gt;Hidden&lt;/Description&gt;
  6. &lt;Icon&gt;Piercing_Stat_Icon.png&lt;/Icon&gt;
  7. &lt;Hidden&gt;1&lt;/Hidden&gt;
  8. &lt;UnitStatGrouping&gt;CombatStat&lt;/UnitStatGrouping&gt;
  9. &lt;UnitStatGrouping&gt;UnitDetailsCombatStat&lt;/UnitStatGrouping&gt;
  10. &lt;/UnitStatType&gt;
  11. &lt;/PlayerAbilityTypes&gt;

 

Hang on i'll change the calculations and see what happens

Reply #120 Top

Okay, it works on Shrills now but will it also work on other Elementals? Because I don't want that to happen :/

Reply #121 Top

It shouldn't if they don't have the unitstat.

Reply #123 Top

I really like how the Frost Giants are set up in Children of Storm, and I think i'd like to do something similar for the Wildland Units in my Wildland Alliance mod, namely the Trolls and Ogres. I think I could do this using a <Prereq> with a Unitstat as the prerequisite but I have no idea on the format for it.

 

This seems logically how it would work to me but i'm not sure:

Code: xml
  1. &lt;Prereq&gt;
  2. &lt;Type&gt;UnitStat&lt;/Type&gt;
  3. &lt;Attribute&gt;UnitStat_BG_IsOversized&lt;/Attribute&gt;
  4. &lt;Value&gt;1&lt;/Value&gt;
  5. &lt;/Prereq&gt;

Reply #124 Top

What exactly are you trying to do? What has the prerequisite of oversized?

Reply #125 Top

Trying to increase the stats of the Trolls and Ogres when you have the techs that increase possible group sizes, like the cloaks for the Frost Giants, I should have made that clear XD I'm also wondering if it's possible to have a cloak without an art def, will it just apply the stats without showing on the model or will it cause errors?