Getting specific items

Hi there,

I have created some new magic items that I would like to test to see if they work in the game.
My problem is I don't know how to definitely get said items to do said testing.
I thought maybe I could have them using

 <CustomizationPointCost>1</CustomizationPointCost>
 <IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>

but items aren't actually selectable when you are customizing your sovereign.
Its somehow related to CoreAbilities but I can't make heads or tails of that.

So can any kind soul offer me any advice on how I can actually get these items that I have made so that I can test them?

Thanks

Dan

8,958 views 18 replies
Reply #1 Top

The quickest fastest way to add an item to a Sov is to edit the unit file for the sov.

Example:  Adding a Token_Best Friend to your Sov (this summons a dog)

      <AutoCreateEquipment>Token_BestFriend</AutoCreateEquipment>

You can add this anywhere in the Unit.xml for your Sov (in the Documents/MyGames/LegendaryHeroes/Units if a custom sov, or in the FE Legendary Heroes/Data/English/CoreUnits.xml.

Substitute your GameItem Internal Name for Token_BestFriend.

 

The item will automatically be added to your sov each game, until you remove this code.

Reply #2 Top

Hi there,

I really appreciate the response.  However I tried this (added three new items) to the CoreUnits.xml for Procipinee.  Then I fired up the game, ensured "Use Mods" option was selected.  And she only had her two standard items.  Thinking that there was some cap on starting items I deleted her standard equipment and fired the game up - and then she had nothing.  Any idea what I might be doing wrong?

Also - moving forward - if you need to modify a core setting is it best to

1)  Just mod the corresponding XML and keep a copy of the original (Yuck!).

2)  Paste the entire contents of an entity in a new file under Mods, knowing that the game will replace the previous settings with this new modded one.

3)  Paste just the name of the original entity  eg.  <UnitType InternalName="Sovereign_Procipinee">.  And then just add the new or modified tags you want eg. <AutoCreateEquipment>Token_BestFriend</AutoCreateEquipment> knowing that the game will just add these extra tags to what was previously read before.

Reply #3 Top

PS- I tried your solution with the Token_BestFriend - and it worked.  So maybe the AutoCreateEquipment only works for game original items?

If so - that still leaves me trying to figure out how to test new magic items that I create for the game.

For what it is worth here is the xml of the 2 new item I was trying to originally add

 

<GameItemType InternalName="DT_Potion_GiantSize">
        <DisplayName>Potion of Giant form</DisplayName>
        <Description>This potion temporarily turns the drinker into a giant doubling their attack</Description>
     <CustomizationPointCost>1</CustomizationPointCost>
        <ShopValue>400</ShopValue>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>UseSpell</Attribute>
            <StrVal>GiantForm_Self</StrVal>
            <Provides>Doubles the drinker's attack</Provides>
        </GameModifier>
        <IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>
    <HeroOnly>1</HeroOnly>
        <IsAvailableForUnitDesign>0</IsAvailableForUnitDesign>
        <Likelihood>400</Likelihood>
        <RarityDisplay>Common</RarityDisplay>
        <IsUsable>0</IsUsable>
        <UsableInBattle>1</UsableInBattle>
        <UsableOnlyOnceInBattle>0</UsableOnlyOnceInBattle>
        <ArtDef>Potion_Growth_ArtDef</ArtDef>      
    </GameItemType>

 <GameItemType InternalName="DT_Titans_Wind">
        <DisplayName>Scroll of Titans Wind</DisplayName>
        <Description>Use this scroll to do conjure a terrible wind that knocks all enemies to the ground unless they resist</Description>
    <CustomizationPointCost>1</CustomizationPointCost>
        <ShopValue>90</ShopValue>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>UseSpell</Attribute>
            <StrVal>TitansBreath_Ability</StrVal>
            <Provides>Allows the unit to create a terrible wind that knocks all enemies to the ground unless they resist</Provides>
        </GameModifier>
        <IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>
        <Likelihood>200</Likelihood>
        <RarityDisplay>Common</RarityDisplay>
        <HeroOnly>1</HeroOnly>
        <IsAvailableForUnitDesign>0</IsAvailableForUnitDesign>
        <IsUsable>0</IsUsable>
        <UsableInBattle>1</UsableInBattle>
        <UsableOnlyOnceInBattle>0</UsableOnlyOnceInBattle>
        <ArtDef>Scroll_Blizzard_ArtDef</ArtDef>       
    </GameItemType>

Reply #4 Top

I've been able to use the <AutoCreateEquipment> with Custom Sovs without too much problem, but I'll do some quick testing with the core sovs, and let you know how that goes.

I'm a huge fan of creating a new file, using the InternalName and just adding the new variables, as you suggested.  I've done this with a few things now, for example to add +1 XP to monuments without copying the whole file.  In this case, you'd have a file that hasToken_BestFriend

Code: xml
  1. &lt;!-- This file adds new stuff for Porcipinee --&gt;
  2. &lt;UnitTypes&gt;
  3. &lt;UnitType InternalName="Sovereign_Procipinee"&gt;
  4. &lt;AutoCreateEquipment&gt;Token_BestFriend&lt;/AutoCreateEquipment&gt;
  5. &lt;/UnitType&gt;
  6. &lt;/UnitTypes&gt;

I do know for a fact that my Token_Sirius and Token_Bacco items are working fine, and I've been able to add said Token directly to the custom sov.  I'll try adding those to Porcipinee now and let you know how it goes shortly...

 

What I'm wondering is if your DT prefix is weirding out the game in some way?  Have you tried Scroll_Titan'sWind and Potion_GiantSize as your internal names?

Reply #5 Top

OK, quick followup:

Using the code detailed in the post above, and placing it into a .xml file in the mods folder did NOT work.  Procipinee simply disappeared entirely as an option to pick r.e. Sovs to play with.

Placing the new items (found in the Mods folder) into Sovereign_Procipinee's.xml in the CoreUnits.xml file in the /English folder did NOT work.

 

What DID work was:

Copying the entire CoreUnits.xml entry for Procipinee to a new file, placed in the mods folder, with the <AutoCreateEquipment>Token_Bacco</AutoCreateEquipment> tags added to her .xml.  The items showed up in Procipinee's description, and were usable ingame.

 

SOOOO, what do I think I've learned from this little experiment?

If you are going to customize a core Sovereign, you need to copy the ENTIRE code for said sov over to the Mods folder.  Note that I didn't try to delete or change any of her other values yet (will do so now, if issue arises I'll post again).

 

So, TempleDan, I still suggest that you NOT use your DT prefix, and go with Potions_ and Scrolls_ instead and see if that works.  Also, Copy all of Procipinee's code over to the Mods folder.  Let us know if it works out.

 

The Potions_ thing might explain a little thing I've seen ingame... Have you ever wondered, looking at the .xml, why say the Potion of Healing disappears when used, but Bread and Tilda Herbs don't, which lets you use those items once each combat?

  The .xml for these files are almost exactly identical, so what tells the game to consume the potion bot not the bread? Well, looking at the .xml, Internal Name="Bread" does not have a Potion_ prefix, but pretty much all of the consumable potions do...

Reply #6 Top

Wow - thanks for the awesome response tjashen!  You rock

Indeed - copying the entire sovereign entry into mods allowed me to add custom items to start.

The Scroll worked fine.

I removed the DT prefix from the Potion of Growth and added a DT suffix.  But when I used it the game crashed.
I only assumed that all spells could be made into potions by adding a _Self suffix to the <strVal tag.  i.e.

<StrVal>GiantForm_Self</StrVal>

That is obviously not the case.

Anyway I wouldn't have discovered that without your post on how to get ahold of these items - so thanks again!

Reply #7 Top

One interesting thing that I discovered

If you add an item to a Sovereign to start, then it is autoequipped, even if there is no slot for it - so you could have two crowns equipped for example.

In addition the bonuses that the item provides become permanently associated with the Sovereign, even if the item is later unequipped.

For example, the substantial bonuses I get for this powerful artifact became permanently grafted to the Sovereign.

A couple of questions - for Likelihood, does a higher number mean more common, or less common?
Also - does anyone know what the AIPriority and AIPersonality tags do?


 <GameItemType InternalName="DT_Robe_Archmage_Supreme">
        <DisplayName>Robe of the Supreme Archmage</DisplayName>
        <Description>The powerful artifact made by Tensor, one of the most powerful archmages in history</Description>
        <Type>Torso</Type>
        <Type>Surcoat</Type>
        <Type>Lowerbody</Type>
        <CanBeEquipped>1</CanBeEquipped>
        <ShopValue>1800</ShopValue>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Defense_Pierce</StrVal>
            <Value>10</Value>
        </GameModifier>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_MagicPower</StrVal>
            <Value>18</Value>
        </GameModifier>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_TacticalSpellManaCost_Multiplier</StrVal>
            <Value>-0.5</Value>
            <Provides>-50% mana cost for tactical spells</Provides>
        </GameModifier>
     <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_MagicResist</StrVal>
            <Value>18</Value>
        </GameModifier>
     <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_ResistFire</StrVal>
            <Value>50</Value>
            <Provides>+50% Fire resistance</Provides>
        </GameModifier>
     <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_ResistCold</StrVal>
            <Value>50</Value>
            <Provides>+50% Cold resistance</Provides>
        </GameModifier>
      <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_ResistLightning</StrVal>
            <Value>50</Value>
            <Provides>+50% Lightning resistance</Provides>
        </GameModifier>
      <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_ResistPoison</StrVal>
            <Value>50</Value>
            <Provides>+50% Poison Resistance</Provides>
        </GameModifier>
        <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
        <IsAvailableForUnitDesign>0</IsAvailableForUnitDesign>
        <Likelihood>200</Likelihood>
        <RarityDisplay>Common</RarityDisplay>
        <HeroOnly>1</HeroOnly>
    <IsAvailableForUnitDesign>0</IsAvailableForUnitDesign>
            <AIData AIPersonality="AI_General">
                <AIPriority>16</AIPriority>
            </AIData>
        <ArtDef>Art_Robe_Archmage</ArtDef>
    </GameItemType>

Reply #8 Top

Quoting tjashen, reply 5
The .xml for these files are almost exactly identical, so what tells the game to consume the potion bot not the bread? Well, looking at the .xml, Internal Name="Bread" does not have a Potion_ prefix, but pretty much all of the consumable potions do...

Let us revisit this and say the difference is the tag

<UsableOnlyOnceInBattle>0</UsableOnlyOnceInBattle>

If this tag is there then the item will be consumed and if you had multiple copies of the item, you can still consume them during battle

If this tag is NOT there then the item will not be consumed and you see it greyed out. It has NOTHING to do with the internal name.

As to the other, if you are overwriting units the game will remove all data from the previous entry and use your new unit data. In effect, you need to copy over the entire unit entry and make your change appropriately when modifying units.

Reply #9 Top

OK, so riddle me this?

Sure, Healing Nectar (which is a single use item) has <UsableOnlyOnceInBattle>1</UsableOnlyOnceInBattle>.

But Potion_Growth (which is also a single use item last I checked) has <UsableOnlyONceInBattle>0</UsableOnlyOnceInBattle>.  Same for Potion_Healing, Potion_HealingStrong, Potion_FireResistance, Potion_Prismatic, Potion_QuendarWine, and Potion_Restoration. 

Potion_DarkConcoction, Potion_IroneerAle,  Potion_ParidenWine, Potion_TrogBlood do not even have the <UsableOnlyOnceInBattle> tag.  Probably because these items are 'strategic use' items, not tactical items.

All of the above have the <IsUsable>1</IsUsable> Tag.  Bread and Tilda Herbs, as well as the First Aid Kit, also have this tag.

The <UsableInBattle> tag appears for some of these, but not all.

Scrolls seem to follow this same pattern, btw. (value 0 in tactical, no value at all if strategic)

So, how does the game know about all of the above potions being single use?  Again, I'm thinking the Potion_ prefix is the trigger in this case.  Same for the Scroll_ prefix.

So, by my reckoning, I'm thinking that the <UsableOnlyOnceInBattle>1</UsableOnlyOnceInBattle> tag seems to apply to non potion/scroll items that you want 'destroyed in battle situations' when used.

Reply #10 Top

TempleDan,

That's an interesting observation.  I'll have to try to trade Procipinee's Crown the next time I get the chance, to see if the Enchantment Cost 0 ability remains in play.  If so, this is probably something that needs to get fixed on the back end.

Ereog's Token comes into play during tactical combat, as do the special bracers.  So I'm guessing that it's ability will move with the item.  That being said, I'll check it as well.

Reply #11 Top

Quoting tjashen, reply 9
OK, so riddle me this?

So I added the tag to the mushrooms

<UsableOnlyOnceInBattle>0</UsableOnlyOnceInBattle>

and when I used them in battle the mushrooms disappeared. I also, for fun changed the internal name tags of the potions to something else and it still used the item the way it always used the item. The internal name is just an identifier and the functionality comes from within the item block code.

As to how the game knows to use the item is the tag

<IsUsable>1</IsUsable> - strategic level

or

<UsableInBattle>1</UsableInBattle> - tactical level

this tells the game that the item is consumable.

Reply #12 Top

Except that Bread has both the <IsUsable> tag and the <UsableInBattle> tag, but doesn't disappear when used, other than from the tactical display.  Consumable might not be the right word in this case. 

Potion_IroneerAle also has the <IsUsable> tag, but the <UsableInBattle> tag is set to 0.  Neither Bread nor Ironeer Ale have the <UsableOnlyOnceInBattle> tag.  So what's the difference between these two?

Reply #13 Top

Since bread doesn't have the tag

<UsableOnlyOnceInBattle>0<UsableOnlyOnceInBattle>

It then implies that it will not go away when used in battle and can only be used once in battle.

Because Ironeer Ale can only be used on the strategic map and not the tactical map. Notice it doesn't show up in the items when you go into battle.

Like I posted before the

<IsUsable> tag is for consumable on the strategic map. If it is set to 1 you can use it on the strategic map if set to 0 it cannot be used on the strategic map.

<UsableInBattle> tag is for consumables only in the tactical map. Where on uses that tag <UsableOnlyOnceInBattle> - set this to 1 to allow the item to not go away (or leave it empty), set this to 0 to allow the item to go away.

It appears that to make it consumable on the tactical battle one needs the following two tags

<UsableInBattle>1</UsableInBattle>
<UsableOnlyOnceInBattle>0</UsableOnlyOnceInBattle>

 

Reply #14 Top

Assuming that I accept your premise here, <UsableOnlyOnceInBattle> would make more sense if you think of the tag as actually saying <UsableOncePerBattle>.  In this context, a '0' means no, you don't get to use it once per battle, so it goes away.  So setting it to 1 would mean 'yes, you get to use this item once every battle'.  But Bread does not have this value at all...

This could mean that the 'default' is 1 on this value, for those items that do not list this value.  I'm not comfortable with that premise, though, as you get to use weapons and such every turn, and they have no such values listed.  Of course, Bread does have <IsUsable> AND <IsUsableInBattle>, so either/both of those values could set the '1' default in the background.

Again, whether or not an item gets used tactically or strategically doesn't have any direct bearing as to whether you use the item up when it is used or not.  Again, you can use Bread Strategically apparently, and you can also use Potion_IroneerAle strategically.  I'm not seeing a tag here that says one gets used up on the strategic map, but the other doesn't...

 There's a quick way to check this.  Off to do some testing...

Reply #15 Top

I hope your tests are successful I'd be interested in what you conclude. It's alright if you don't accept my premise at the moment, but if you look at the studded collar it has <IsUsable>0</IsUsable> and has the tag <UsableInBattle>1</UsableInBattle> and has the tag <UsableOnlyOnceInBattle>0</UsableOnlyOnceInBattle>

Reply #16 Top

(snip) still testing...

Reply #17 Top

So, it appears I was incorrect, it is just the tag <UsableInBattle>1</UsableInbattle> makes the item consumable in combat.

Similar to <IsUsable>1</IsUsable> makes the item consumable in strategic.

Reply #18 Top

Quoting temple_dan, reply 7
A couple of questions - for Likelihood, does a higher number mean more common, or less common?

Also - does anyone know what the AIPriority and AIPersonality tags do?

The higher the number the more common the item is likely to appear. But the rarity display also is also used to establish which random item group the item resides.

The AIPriority tag I speculate that implies the likelihood the AI personality will use this tag or its the weight it will use this tag.

The AIPersonality is the type of personality that gets that weight. There currently is only one AIPersonality at the moment that I see used and that is "General".