How to make new items?

I found this guide that I though was very helpful,only that it doesn't work. How do I need to modify it?

forums.elementalgame.com/392476

9,761 views 5 replies
Reply #1 Top
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
- <GameItemTypes>
  -
- <GameItemType InternalName="DarkBread">
  <DisplayName>Dark Bread</DisplayName>
  <Description>It sinks in water. Unlike apples, very small rocks, cider, gravy, cherries, mud and churches. Eat it to heal 25 damage.</Description>
  <HideInHiergamenon>1</HideInHiergamenon>
  <ShopValue>40</ShopValue>
  -
- <GameModifier>
  <ModType>Unit</ModType>
  <Attribute>CurHealth</Attribute>
  <Value>25</Value>
  <Provides>Heals 25 Hit Points</Provides>
  </GameModifier>
  <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
  <RarityDisplay>Common</RarityDisplay>
  <IsUsable>1</IsUsable>
  <UsableInBattle>1</UsableInBattle>
  <ArtDef>Bread_ArtDef</ArtDef>
  -
- <GameItemTypeArtDef InternalName="Bread_ArtDef">
  -
- <GameItemTypeModelPack InternalName="Bread_Default">
  <IconFile>Bread_Item2.png</IconFile>
  <MapParticle>T_Heal_Particle</MapParticle>
  <TintR>79</TintR>
  <TintG>48</TintG>
  <TintB>20</TintB>
  <SFX>Eating</SFX>
  <GameItemTypeModel />
  </GameItemTypeModelPack>
  </GameItemTypeArtDef>
  </GameItemType>
  </GameItemTypes>
Reply #2 Top

By far the easiest way to create a new item is to think about an item that is currently in-game. A weapon, a piece of armor, a piece of bread or a scroll.

Then, you go to the installation directory, into the data/English/ folder and find the item. If it's a weapon you'll find it in CoreWeapons.xml. If it's an armorpiece you'll find it in CoreArmor.xml. If it's an item such as a scroll or an accessory, you'll find it in CoreItems.xml.

Then, copy the XML for the item you have chosen.

Paste it into a new file that you create in documents/my games/Fallen Enchantress/mods/yournewfolder/yournewfile.xml

Change the internalname to something completely unique. If you keep the same internalname, you'll change the item in-game instead of creating a new item.

Also, remove the <GameItemTypeArtDef> and all its children (unless you are creating new graphics). The <GameItemTypeArtDef> is already defined in the installation directory, there is no need to repeat it (in fact, you shouldn't, because the game will have to render two weapons instead of one for example).

 

 

Prerequisites determine how an item becomes available to the player for the shop and unit designs.  For example shortbow has this

        <Prereq>
            <Type>Tech</Type>
            <Attribute>Archery</Attribute>
        </Prereq>

which means it will unlock when you have researched Archery.

It also has this

       <Prereq>
            <Type>RestrictedAbilityBonusOption</Type>
            <Attribute>Archers</Attribute>
            <Target>Player</Target>
        </Prereq>

which means a faction with the "Archers" faction ability never gets this shortbow.

Instead of the shortbow, there's also "Shortbow_Tarth" which has these tags:

        <Prereq>
            <Type>AbilityBonusOption</Type>
            <Attribute>Archers</Attribute>
            <Target>Player</Target>
        </Prereq>
        <Prereq>
            <Type>Tech</Type>
            <Attribute>Archery</Attribute>
        </Prereq>

meaning the player has to have the Archers faction ability and then research Archery to get access to that particular item.

 

 

By default, all weapons and armorpieces are available for unit designs and custom sovereign creation.

To disable an item in custom sovereign creation add <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>

To disable an item for unit designs add <IsAvailableForUnitDesign>0</IsAvailableForUnitDesign>

 If you copied an item, those tags may already exist. In that case you should not have duplicate tags.

 

If you wish to make an item drop randomly for heroes looting goodiehuts or doing quests, make sure the item has these tags too:

        <Likelihood>200</Likelihood>
        <RarityDisplay>Uncommon</RarityDisplay>

The likelihood determines how common it is compared to other items in the same category. The RarityDisplay is the category. There's Common, Uncommon and Rare, which roughly represents the game progress (common = early, Uncommon = first magical items, rare = good magical items). There are also higher quality categories, but they do not drop randomly.

Reply #3 Top

Here is a simple amulet added by Frogboy: https://www.wincustomize.com/explore/elemental_fallen_enchantress/1/

The XML in full:

<GameItemType InternalName="AmuletOfLightning">
        <DisplayName>Amulet of Flames</DisplayName>
        <Description>When worn, attacks do +3 lightning damage to enemies.</Description>
        <Type>Accessory</Type>
        <CanBeEquipped>1</CanBeEquipped>
        <AdditionalTrainingTurns>8</AdditionalTrainingTurns>
        <ShopValue>180</ShopValue>
        <ProductionRequirement>
            <Type>Resource</Type>
            <Attribute>RefinedCrystal</Attribute>
            <Value>4</Value>
        </ProductionRequirement>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Attack_Lightning</StrVal>
            <Value>3</Value>
        </GameModifier>
        <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
        <Likelihood>200</Likelihood>
        <RarityDisplay>Uncommon</RarityDisplay>
        <IsUsable>0</IsUsable>
        <Prereq>
            <Type>Tech</Type>
            <Attribute>Glyph_Stones</Attribute>
        </Prereq>
        <ArtDef>AmuletOfFlames_ArtDef</ArtDef>
        <GameItemTypeArtDef InternalName="AmuletOfFlames_ArtDef">
            <GameItemTypeModelPack InternalName="AmuletOfFlames_Default">
                <IconFile>AmuletofFlame_Item.png</IconFile>
                <TintR>240</TintR>
                <TintG>210</TintG>
                <TintB>210</TintB>
                <GameItemTypeModel>
                </GameItemTypeModel>
            </GameItemTypeModelPack>
        </GameItemTypeArtDef>
    </GameItemType>
End of quote

The internalname is new, it doesn't exist in the installation directory. So he is creating a new item.

The item is available for the player after researching Glyph Stones (see the prereq). The item is available for unit designs (it is not blocked for it, see above). It can also randomly drop in the world in the Uncommon category. It is not available for designing custom sovereigns.

Note that Frogboy actually included the whole <GameItemTypeArtDef> which was a mistake. The <GameItemTypeArtDef InternalName="AmuletOfFlames_ArtDef"> already exists, so there was no need to include it again.

Reply #4 Top

So the <ArtDef>AmuletOfFlames_ArtDef</ArtDef> is the only necessary information to assign a model to an item, correct?

Could I change its color using the <TintR/G/B> tag? In that case would including the rest of the <GameItemTypeArtDef stuff be necessary? I haven't seen a change of the icon when fiddling with the Tint values, so I guess it changes the color of the 3D model...?

Reply #5 Top

Yes, the <ArtDef> assigns a <GameItemTypeArtDef> to an item.

It is easier to think of <GameItemType> and <GameItemTypeArtDef> as separated, the first is not parent node to the second. That's why you see in CoreArmor.xml the <GameItemTypeArtDef> are completely separated into another file mostly.

The Tint stuff changes the colouring of icons, nothing else. But not all icons support it. I never explored which does.