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!
June 1, 2013 9:13:03 PM from Elemental Forums Elemental Forums

Trying to figure out some basic modding. Can someone post the code to make this work.

Goal: Improve Haste spell to be based on the casters level *2, rather than +3. Also up the mana cost to *2 the caster's level.

Reason for Karma (Optional)
Successfully updated karma reason!
June 1, 2013 9:21:23 PM from Elemental Forums Elemental Forums

 Not sure what you mean by up the mana cost to *2, I'm assuming you want it to be 10 mana vs. 5 mana The following change will do that

        <SpellResourceCost>
            <Resource>Mana</Resource>
            <Amount>10</Amount>
        </SpellResourceCost>

As to the other thing you want the following is what you want to do
         <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_CombatSpeed</StrVal>
            <IsForFormattedDescription>1</IsForFormattedDescription>
            <DisplayName>Hasted</DisplayName>
            <Duration>-1</Duration>
            <Effect>E_Celerity_Particle</Effect>
            <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                <Expression><![CDATA[[Unit_GetLevel] * 2]></Expression>
            </Calculate>
            <Calculate InternalName="Calc2" ValueOwner="CastingUnit">
                <Expression><![CDATA[[Calc] + [UnitOwner_GetNumAirShards]]></Expression>
            </Calculate>
            <Calculate InternalName="Value">
                 <Expression><![CDATA[[Calc2]]></Expression>
             </Calculate>
             <Calculate InternalName="ValueForFormattedDescription">
                <Expression><![CDATA[[Calc2]]]></Expression>
            </Calculate>
        </GameModifier>

These were both copied from the current haste spell. Put this in an xml file along with the other haste stuff, change the internal name and adjust the display name and you should get an improved haste.

Reason for Karma (Optional)
Successfully updated karma reason!
June 1, 2013 9:30:04 PM from Elemental Forums Elemental Forums

Thanks for the help. 

Actually I was looking to inflate the mana cost based on the casters level to offset the big gain in level bonus

  <Amount>10</Amount>

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
June 1, 2013 9:32:38 PM from Elemental Forums Elemental Forums

That is possible, although this could lead to negative mana... There is no dynamic spell casting cost at the current moment, so you will have to deal with negative mana costs in the end.

You would have to do an adjust resource similar to that of the alchemy spell. Use the apply to caster tag and use similar calculations that I used above to remove the correct amount of mana.

Reason for Karma (Optional)
Successfully updated karma reason!
June 1, 2013 10:09:33 PM from Elemental Forums Elemental Forums

Stab in the dark...like this?

<SpellResourceCost>      

<Resource>Mana</Resource>      

<Amount>0</Amount>      

</SpellResourceCost>

 

<GameModifier>           

 <ModType>Unit</ModType>     

  <Attribute>CurMana</Attribute>           

<ApplyToCaster>1</ApplyToCaster>     

   <Value>-[Unit_GetLevel]</Value>       

 </GameModifier>

 

Also how do you paste in code? I've tried everything, well almost.

Reason for Karma (Optional)
Successfully updated karma reason!
June 1, 2013 10:48:45 PM from Elemental Forums Elemental Forums

I literally meant copy the gamemodifier from the Alchemy spell and change Gold to Mana like this, then you would need to do a calculate environment for the rest

        <GameModifier>
            <ModType>Resource</ModType>
            <Attribute>Mana</Attribute>
             <ApplyToCaster>1</ApplyToCaster>
            <Calculate InternalName="Calc" ValueOwner="CastingUnit">
                   <Expression><![CDATA[[Unit_GetLevel] * 2]]</Expression>
            </Calculate>
            <Calculate InternalName="Value">
                    <Expression><![CDATA[[Calc] * -1]]</Expression>
            </Calculate>
         </GameModifier>

 

Then you can drop the spell resource cost altogether.

(I use shift+enter to make the spacing closer together)

Reason for Karma (Optional)
Successfully updated karma reason!
June 4, 2013 12:47:56 AM from Elemental Forums Elemental Forums

Is there a way to mod the number of perk points champions get when leveling up?

Reason for Karma (Optional)
Successfully updated karma reason!
June 4, 2013 12:54:32 AM from Elemental Forums Elemental Forums

Quoting Dekent,

Is there a way to mod the number of perk points champions get when leveling up?

If you mean number of traits a champion selects on the level up screen I don't think this is possible.

Reason for Karma (Optional)
Successfully updated karma reason!
June 7, 2013 3:19:56 PM from Elemental Forums Elemental Forums

Playing with traits tree of the Defender. Trying to create a Taunt Spell, Is there a way to increase the likelihood that the ai will attack someone? Even a workaround clunky way?

 

Second question- What file contains the yellow ring around selected skills? I'd like to change the color to something that stands out a bit more.

Reason for Karma (Optional)
Successfully updated karma reason!
June 7, 2013 4:52:30 PM from Elemental Forums Elemental Forums

I have a question too, in LH 1.0 I could copy the elementaldef.xml to the mods folder and alter it to my liking. In 1.1 this will result in strange behaviour (unable to select a production pace when starting a new game and growth is allways zero in all cities). Is there a solution other than editing the file directly in the install folder?

Edit: Ignore this, I have used a wrong elementaldefs (from FE) for the moded file. It still works the old way...

Reason for Karma (Optional)
Successfully updated karma reason!
June 7, 2013 9:19:22 PM from Elemental Forums Elemental Forums

I'd like to mod some magic items using existing artwork, and just change the color to distinguish it from other items. (e.g. change the  color of a swords hilt).

 

How do I do that? What program would I need?

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
June 7, 2013 11:08:21 PM from Elemental Forums Elemental Forums

Quoting Borg999,

I'd like to mod some magic items using existing artwork, and just change the color to distinguish it from other items. (e.g. change the  color of a swords hilt).

 

How do I do that? What program would I need?

 

GIMP

http://www.gimp.org/

 

 

Reason for Karma (Optional)
Successfully updated karma reason!
June 7, 2013 11:09:43 PM from Elemental Forums Elemental Forums

Quoting abob101,

Quoting Borg999, reply 11What program would I need?

GIMP

http://www.gimp.org/

 

 

Also might need to be able to read .dds files as well

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2013 2:50:02 AM from Elemental Forums Elemental Forums

Current help needed on these topics.

1)Added a Trait that adds 50% to Health, however only his detail screen shows the updated stats. Any idea how to get this to also show on his card?

2)Playing with traits tree of the Defender. Trying to create a Taunt Spell, Is there a way to increase the likelihood that the ai will attack someone? Even a workaround clunky way?

3) What file contains the yellow ring around selected skills? I'd like to change the color to something that stands out a bit more.

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2013 8:36:05 AM from Elemental Forums Elemental Forums

Quoting parrottmath,
Quoting abob101, reply 12

Quoting Borg999, reply 11What program would I need?

GIMP

http://www.gimp.org/

 

 
Also might need to be able to read .dds files as well

 

Good point, forgot about that... get the DDS plugin also and you're good to go:

http://registry.gimp.org/node/70

 

Probably only thing to be aware of is that for some reason that I don't full understand a lot of times (such as with skins) in the XML a file will be referred to as "something.png" but the file it is using is actually "something.dds".  So if you want to reskin weapon A and it uses skin called "weaponAskin.png"... the file it might actually be using could be called "weaponAskin.dds" and is actually a dds rather than a png.  On most occassions you can save a skin as either a png or dds and both will work, but put png for the filename in the xml.

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2013 8:46:27 AM from Elemental Forums Elemental Forums

Quoting cohka,
1)Added a Trait that adds 50% to Health, however only his detail screen shows the updated stats. Any idea how to get this to also show on his card?

To what card do you refer? Is this a level up trait, a unit trait... it is rather difficult to discern what you would like to have happen without pictures

Quoting cohka,
2)Playing with traits tree of the Defender. Trying to create a Taunt Spell, Is there a way to increase the likelihood that the ai will attack someone? Even a workaround clunky way?

The only way I can think of is to create a shield spell that will transfer the damage to another person. But I'm unsure of exactly how to capture the amount of damage an enemy unit just did to transfer that amount to another unit.

You could instead do clumsy and have the unit attack any other unit at random (blind rage) type thing. (Probably easiest to implement)

Quoting cohka,
3) What file contains the yellow ring around selected skills? I'd like to change the color to something that stands out a bit more.

Are you talking about the trait skills from the unit selection screens or the trait skills from the unit level up screen. In either of these cases I don't think we have access to the color highlight through any of the files, it is a hardcoded thing. Unless you search through all the files and find it, but my search has left me empty.

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2013 3:55:27 PM from Elemental Forums Elemental Forums

Hey Parrott. Thanks for your help.

1) The "card" I'm referring to is the one on the left hand side of the screen during tactical combat. The heart icon and number do not reflect the updated health total from a buff. The buff is however seen if you click the details button. I'd like to see the buff/change on the card if possible.

2)I think I have an idea that might work.'

3)I didn't see anything either.

 

Reason for Karma (Optional)
Successfully updated karma reason!
June 8, 2013 6:46:17 PM from Elemental Forums Elemental Forums

Beware that you cannot modify unitstat_hitpoints actively during combat.

Reason for Karma (Optional)
Successfully updated karma reason!
June 9, 2013 2:33:10 AM from Elemental Forums Elemental Forums

Quoting Heavenfall,

Beware that you cannot modify unitstat_hitpoints actively during combat.

 

Hmm.  That is exactly what I was going for. I was doing a 50% bonus to hps for 2 rounds. So the unit details screen updates with the hp bonus but the champion actually doesn't receive a bonus? There goes 3 hours and lots of hair pulling.

Reason for Karma (Optional)
Successfully updated karma reason!
June 9, 2013 11:01:09 AM from Elemental Forums Elemental Forums

Can somebody kindly tell me the needed xml code for a unit to use a 'Dual Axe'?  In the AutoCreateEquipment field.  Can't figure it out for the life of me.

 

Or even better yet, is there a smarter way to find code needed for adding any other existing items and spells etc to units?  I'm sure I'm overlooking something obvious here.

Reason for Karma (Optional)
Successfully updated karma reason!
June 9, 2013 11:27:34 AM from Elemental Forums Elemental Forums

For your first question, a dual weapon is just one item with two models in the artdef.

I don't understand what you mean by your second question.

Reason for Karma (Optional)
Successfully updated karma reason!
June 9, 2013 12:00:34 PM from Elemental Forums Elemental Forums

(really wish this forum allowed deleting your own posts)

Reason for Karma (Optional)
Successfully updated karma reason!
June 9, 2013 12:00:39 PM from Elemental Forums Elemental Forums


I think he's looking for the xml defninitions that say when items a race has access to and what the techs unlock.

Reason for Karma (Optional)
Successfully updated karma reason!
June 9, 2013 12:01:45 PM from Elemental Forums Elemental Forums

I'm trying to make a unit champion that starts the game equipped with a Dual Axe.  But I'm looking for the definition needed for the item.  The part that goes in:  <AutoCreateEquipment>*here*</AutoCreateEquipment>  And I tried putting in "Dual Axe" or "Dual_Axe"; this does not work, heh.

 

 

As for my second question (and I apologize for not wording it better), is there a glossary somewhere or an easy way to look up what the xml code would be if I want to (for example) make a soveriegn who starts the game with chainmail?  I actually do know how to do that one, by using:

<AutoCreateEquipment>ChainBreastpiece</AutoCreateEquipment>

I knew the definition above was "ChainBreastpiece" because I've seen it used in other xml files I have from mods others have made.  But how do I find out the xml names/definitions of other items on my own, without searching other mods and copying available code from them?

Reason for Karma (Optional)
Successfully updated karma reason!
June 9, 2013 12:05:27 PM from Elemental Forums Elemental Forums

So, <AutoCreateEquipment> tag is equipment specifically for champions. Units do not use these tags, you need to use the other tag for units.

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