Game needs more event hooks...

So I've been trying to spice up the otherwise lacklustre supply of items, particularly weapons in the game.  i was surprised to see so few event hooks for melee in the available XML (although maybe I shouldn't be, since really there aren't that many in the game)

 

For example, the Tear of Cyndrum has this hook:

Code: xml
  1. <Attribute>AdjustUnitStat</Attribute>
  2. <StrVal>UnitStat_HPFromKills</StrVal>

I expected it to be a little more robust.  For example, I would have expected something like

Code: xml
  1. <Attribute>AdjustUnitStat</Attribute>
  2. <StrVal>OnKill</StrVal>
  3. <Stat>HP</Stat>
  4. <Value>3</Value>

This would allow for hooking into all kinds of on kill effects.  But apparently, you can only either get mana or hp from kills, since these are the only hooks I see on kills.

For Melee, there is at least a way to specifiy an on hit event.  The vial of poison for example has:

Code: xml
  1. <Attribute>MeleeAppliesSpell</Attribute>
  2. <StrVal>Poisoned1</StrVal>

This is good - it means that if you can make a spell do something, you can hook it into a Melee event.  But you can't specify a target as near as I can tell. The melee always has to target whatever object is getting hit. 

 

So let's say I want to make a sword that when it hits (not kills), gives the wielder 1 life (Vampiric sword)  I'm pretty sure using the given hooks, from what I can see this is not possible.

 

10,131 views 6 replies
Reply #1 Top

You can actually do that sword thing, any modifier can be boinked back to the "caster" using <ApplyToCaster>1.

In general I agree that more hooks would be cool, but I feel the game is at a point where it needs to go full-on event-based scripting instead of depending on XML hooks.

+1 Loading…
Reply #2 Top

Ah!  I missed that.  I should have looked at Barbs, which does damage to the target and the caster and figured that out - I just see that spell so rarely used - it's hard guessing at tags!

While a full on event-based scripting would be good for extreme modders, I think if you really want to sell the game on it's moddabiilty, you either make it decidedly easy with XML or you include really fantastic tools like Bioware did with Neverwinter Nights, because the casual modder (or non programmers) is going to get pretty frustrated if they had to do practically anything in a C-style syntax. XML is at least a big step down in terms of level of comprehension.

Considering how the tools are with FE, I think they'd better stick with XML.

Reply #3 Top

I think it's a discussion of whether they should go for a high-cost very flexible system, or a low-cost inflexible system. If they keep adding different XML tags (not that they have added any requested by modders btw) then each new tag has a certain base cost in manhours needed to implement it. If they do a proper scripting system instead, it's a big cost but they unlock all those small opportunities as well without needing a small base cost for every extra bit of XML.

Reply #4 Top

All I can say is that I have the same problems and totally agree with you.

Reply #5 Top

Quoting Heavenfall, reply 3
I think it's a discussion of whether they should go for a high-cost very flexible system, or a low-cost inflexible system. If they keep adding different XML tags (not that they have added any requested by modders btw) then each new tag has a certain base cost in manhours needed to implement it. If they do a proper scripting system instead, it's a big cost but they unlock all those small opportunities as well without needing a small base cost for every extra bit of XML.
End of Heavenfall's quote

Yes, but the shorten the modding base with a proper scripting system.  Don't get me wrong, I'd probably like it, but I think it's a forgone conclusion less people would be able to get into a proper scripting system.

 

PS - here is what I put in for the Vampiric Short Sword - does this look correct? (Heh - I can't test at work but having XML on my screen looks like work to everyone else :)

New Weapon file

Code: xml
  1. &lt;GameItemTypes&gt;
  2.     &lt;GameItemType InternalName="Shortsword_Vampiric"&gt;
  3.         &lt;DisplayName&gt;Vampiric Short Sword&lt;/DisplayName&gt;
  4.         &lt;Description&gt;A standard blade with quillons made from the elongated teeth of a vampire. It will suck one hit point for every hit&lt;/Description&gt;
  5.         &lt;Type&gt;Weapon&lt;/Type&gt;
  6.         &lt;WeaponType&gt;OneHanded&lt;/WeaponType&gt;
  7.         &lt;CanBeEquipped&gt;1&lt;/CanBeEquipped&gt;
  8.         &lt;ShopValue&gt;200&lt;/ShopValue&gt;
  9.         &lt;GameModifier&gt;
  10.             &lt;ModType&gt;Unit&lt;/ModType&gt;
  11.             &lt;Attribute&gt;AdjustUnitStat&lt;/Attribute&gt;
  12.             &lt;StrVal&gt;UnitStat_Attack_Cutting&lt;/StrVal&gt;
  13.             &lt;Value&gt;10&lt;/Value&gt;
  14.         &lt;/GameModifier&gt;
  15.         &lt;GameModifier&gt;
  16.             &lt;ModType&gt;Unit&lt;/ModType&gt;
  17.             &lt;Attribute&gt;AdjustUnitStat&lt;/Attribute&gt;
  18.             &lt;StrVal&gt;UnitStat_CombatSpeed&lt;/StrVal&gt;
  19.             &lt;Value&gt;2&lt;/Value&gt;
  20.         &lt;/GameModifier&gt;
  21.         &lt;GameModifier&gt;
  22.             &lt;ModType&gt;Unit&lt;/ModType&gt;
  23.             &lt;Attribute&gt;AdjustUnitStat&lt;/Attribute&gt;
  24.             &lt;StrVal&gt;UnitStat_CurrentWeight&lt;/StrVal&gt;
  25.             &lt;Value&gt;5&lt;/Value&gt;
  26.         &lt;/GameModifier&gt;
  27.         &lt;GameModifier&gt;
  28.             &lt;ModType&gt;Unit&lt;/ModType&gt;
  29.             &lt;Attribute&gt;AdjustUnitStat&lt;/Attribute&gt;
  30.             &lt;StrVal&gt;UnitStat_MaxCounterAttack&lt;/StrVal&gt;
  31.             &lt;Value&gt;1&lt;/Value&gt;
  32.             &lt;Provides&gt;+1 Counterattack per round&lt;/Provides&gt;
  33.         &lt;/GameModifier&gt;
  34.         &lt;GameModifier&gt;
  35.             &lt;ModType&gt;Unit&lt;/ModType&gt;
  36.             &lt;Attribute&gt;MeleeAppliesSpell&lt;/Attribute&gt;
  37.             &lt;StrVal&gt;Vampire_Effect&lt;/StrVal&gt;
  38.             &lt;Provides&gt;Wielder gains 1 HP on successful attack&lt;/Provides&gt;
  39.         &lt;/GameModifier&gt;
  40.         &lt;IsAvailableForSovereignCustomization&gt;0&lt;/IsAvailableForSovereignCustomization&gt;
  41.             &lt;Likelihood&gt;200&lt;/Likelihood&gt;
  42.         &lt;RarityDisplay&gt;Uncommon&lt;/RarityDisplay&gt;
  43.         &lt;AIData AIPersonality="AI_General"&gt;
  44.             &lt;AIPrefType&gt;AIPrefType_CUTTING&lt;/AIPrefType&gt;
  45.             &lt;AIPriority&gt;300&lt;/AIPriority&gt;
  46.         &lt;/AIData&gt;
  47.         &lt;ArtDef&gt;Shortsword_Hunters_ArtDef&lt;/ArtDef&gt;
  48.         &lt;GameItemTypeArtDef InternalName="Shortsword_Hunters_ArtDef"&gt;
  49.             &lt;GameItemTypeModelPack InternalName="Shortsword_Hunters_Default"&gt;
  50.                 &lt;IconFile&gt;W_Shortsword_Hunters_Icon_01.png&lt;/IconFile&gt;
  51.                 &lt;TintR&gt;15&lt;/TintR&gt;
  52.                 &lt;TintG&gt;53&lt;/TintG&gt;
  53.                 &lt;TintB&gt;230&lt;/TintB&gt;
  54.                 &lt;AttackSFX&gt;Hit_Sword1&lt;/AttackSFX&gt;
  55.                 &lt;AttackSFX&gt;Hit_Sword2&lt;/AttackSFX&gt;
  56.                 &lt;AttackSFX&gt;Hit_Sword3&lt;/AttackSFX&gt;
  57.                 &lt;AttackSFX&gt;Hit_Sword4&lt;/AttackSFX&gt;
  58.                 &lt;EquipSFX&gt;Equip_Sword_01&lt;/EquipSFX&gt;
  59.                 &lt;EquipSFX&gt;Equip_Sword_02&lt;/EquipSFX&gt;
  60.                 &lt;EquipSFX&gt;Equip_Sword_03&lt;/EquipSFX&gt;
  61.                 &lt;GameItemTypeModel&gt;
  62.                     &lt;ModelFile&gt;gfx/hkb/Weapons/W_Shortsword_Hunters_01.hkb&lt;/ModelFile&gt;
  63.                     &lt;Texture_All&gt;gfx/hkb/Weapons/FE_Weapons_01.png&lt;/Texture_All&gt;
  64.                     &lt;Attachment&gt;hand_right_Lcf&lt;/Attachment&gt;
  65.                     &lt;Color_Metal&gt;75,50,50&lt;/Color_Metal&gt;
  66.                 &lt;/GameItemTypeModel&gt;
  67.             &lt;/GameItemTypeModelPack&gt;
  68.         &lt;/GameItemTypeArtDef&gt;
  69.     &lt;/GameItemType&gt;
  70. &lt;/GameItemTypes&gt;
  71.  

New Weapon FX file

Code: xml
  1. &lt;Spells&gt;
  2.     &lt;SpellDef InternalName="Vampire_Effect"&gt;
  3.         &lt;DisplayName&gt;Vampiric&lt;/DisplayName&gt;
  4.         &lt;Description&gt;Wielder gains 1 HP on each successful strike.&lt;/Description&gt;
  5.         &lt;Image&gt;T_Slow_Painting.png&lt;/Image&gt; &lt;!-- Fix this --&gt;
  6.         &lt;IconFG&gt;T_Slow_Icon.png&lt;/IconFG&gt;&lt;!-- Fix this --&gt;
  7.         &lt;IconBG&gt;T_Slow_Icon_BG.png&lt;/IconBG&gt;&lt;!-- Fix this --&gt;
  8.         &lt;IconColor&gt;139,243,255&lt;/IconColor&gt;&lt;!-- Fix this --&gt;
  9.         &lt;CanStack&gt;1&lt;/CanStack&gt;
  10.         &lt;SpellBookSortCategory&gt;Unit&lt;/SpellBookSortCategory&gt;
  11.         &lt;SpellBookSortSubCategory&gt;UnitCurse&lt;/SpellBookSortSubCategory&gt;
  12.         &lt;SpellType&gt;Tactical&lt;/SpellType&gt;
  13.         &lt;SpellClass&gt;Offensive&lt;/SpellClass&gt;
  14.         &lt;SpellSubClass&gt;Buff&lt;/SpellSubClass&gt;
  15.         &lt;SpellTargetType&gt;EnemyUnit&lt;/SpellTargetType&gt;
  16.         &lt;HideInHiergamenon&gt;1&lt;/HideInHiergamenon&gt;
  17.         &lt;IsCastable&gt;0&lt;/IsCastable&gt;
  18.         &lt;GameModifier&gt;
  19.             &lt;ModType&gt;Unit&lt;/ModType&gt;
  20.             &lt;Attribute&gt;CurHealth&lt;/Attribute&gt;
  21.             &lt;ApplyToCaster&gt;1&lt;/ApplyToCaster&gt;
  22.             &lt;Value&gt;1&lt;/Value&gt;
  23.         &lt;/GameModifier&gt;
  24.         &lt;AIData AIPersonality="AI_General"&gt;
  25.             &lt;AIPriority&gt;5&lt;/AIPriority&gt;
  26.         &lt;/AIData&gt;
  27.         &lt;HitSoundFX&gt;Spell_Barbs_01&lt;/HitSoundFX&gt;
  28.         &lt;SpellDefEffect&gt;
  29.             &lt;EffectName&gt;T_Barbs_Particle&lt;/EffectName&gt;
  30.             &lt;LocalPosition&gt;0,35,0&lt;/LocalPosition&gt;
  31.             &lt;EffectScale&gt;0.65&lt;/EffectScale&gt;
  32.             &lt;EffectDelay&gt;0&lt;/EffectDelay&gt;
  33.             &lt;SnapToTerrain&gt;1&lt;/SnapToTerrain&gt;
  34.             &lt;PlayOnAllTargets&gt;1&lt;/PlayOnAllTargets&gt;
  35.         &lt;/SpellDefEffect&gt;
  36.     &lt;/SpellDef&gt;
  37. &lt;/Spells&gt;

Reply #6 Top

Yep, although that effect might be a bit much if played every hit.

For effects that proc off MeleeAppliesSpell or MeleeDefenseAppliesSpell, you only really need to worry about icons and descriptions if the effect has a duration. For anything that happens instantly you can just ignore them. Do set up a proper name of the effect though, because it gets displayed in the after-combat report (combat details) text.