seanw3 seanw3

XML Questions

XML Questions

What does "Operator" and "BonusValue" do?

They are used as a percent chance modifier for buildings that have a chance to give XP. Does Operator mean there is a 25% chance the value will happen? They are used to do the same thing in the code, which makes me suspect they don't work or are just old code that needs to be deleted. Anyhow, those buildings are doing a 100% chance to give the XP. I am hoping there is a tag for a percent chance to have something apply so that we can use it in other areas. Would be nice to have a percent chance to apply poison for example. 

35,291 views 47 replies
Reply #26 Top

Will -5 to UnitStat_Attack-Boost affect total attack or just the total boosts that unit is getting?

Reply #27 Top


is that coded the same way as the crude short bow, i plan to start looking at the sml closely next week now that my time has freed up.

if its the same, what happens when you give a crude short bow to a unit?

Reply #28 Top

Crude Bow? That uses UnitStat_Attack_Pierce. _Boost adds bonus attack. I checked it as working to debuff as well. Wish we had one for armor too.

Reply #29 Top


i meant the minus to accuracy, but i will be playing with this stuff next week.

actually, never mind, i think im completely wrong lol

Reply #30 Top

seanw3 it affects the base value

Reply #31 Top

The A_UnitStat_Moves is not functioning. Is there a way to do this any other way?

Reply #32 Top

There's no way to provide a base value, A_UnitStat_Moves was hardcoded in E:wom to do that. Now it provides a multiplier instead.

Reply #33 Top

Okay. I will just make a trait for levelup and unit design that gives +1 Moves. I don't want to give out double moves.

Reply #34 Top

What is the difference between elemental defense and elemental resistance. Did they sneak this by me? Does elemental defense work the same as physical defense?

Reply #35 Top

Yes, but there is no use of it ingame because it is confusing as hell. That is my theory anyway.

Reply #36 Top

My turn.

 

I have a question. I've been trying to make the damage from the magic staves for trainable units have a secondary effect, such as ongoing burning damage for fire. From what I understand, it's not possible to do that with just the standard ranged attacks that those staves use, so I made those staves give access to spell-like powers.

But it looks like Unit_GetTroopCount is always 1 for castable powers! Is this normal and is there a way to circumvent it?

Reply #37 Top

No idea.

Reply #38 Top

Alright time to raise new questions... what is the point of <StartingUnitType>?

I noticed that a unit can show up without this tag set in unit creation on the xml, but if you do set the tag <IsStartingUnitType> you must put this unit in the race types. So, what is the point?

Reply #39 Top

I see no point to it now, probably a relic from before when unittypes were defined in the faction instead of the race, and each unittype didn't have a prereq for its own race.

Reply #40 Top

Hey guys!

A couple of questions:

1) Is it possible to lock some ability to a designable unit or at least make it specific for that unit only (some Unit prereq in ability)? For example, like Generic Slaves are designed:

<CanBeDesigned>0</CanBeDesigned>

Does that mean that all abilities defined here are locked, and/or that no other ability can be added to the unit?


2) Is it possible to make the ability used in unit design unlockable by tech (so invisible before a tech is researched)?

For example, if I add something like this:

<Prereq>
            <Type>Tech</Type>
            <Attribute>TECH123</Attribute>
</Prereq>

 to the ability definition, will it work? I want the ability unlocked by TECH123 to become available in the unit design once I research TECH123.

 

So, to combine the first two questions - can I lock the said ability to be mandatory for a certain unit, but at the same time available to be used by other units as optional?


3) Is it possible to set a limit of how many of a certain units can be recruited? Let's say I want to limit the number of recruited Juggernauts to X.


4) What are problems in using monster units as designable (or recruitable)? An example - if I make an Ogre recruitable and designable, will it work? Specifically, I used a Juggernaut and changed the needed stuff - however, Ogre doesn't have something like <UnitModelType>JuggernautMale</UnitMode> in monster design, so will that work?

Furthermore, if this works how can I limit the possible upgrades to such unit to for example Weapon and Defence? Will this be enough (in unit design):

<EquipmentUpgradeDef>
            <EquipmentSlot>Weapon</EquipmentSlot>
            <EquipmentSlot>Defense</EquipmentSlot>

...

 

 

Reply #41 Top

1) This is how Blood traits work. Consider it. You have it from the start, but you can't remove it or change it in the designer. You can basically copy that functionality over to a new trait and give it to a unit.

Another way is to use UnitModelTypes like HenchmanMale for Altar Henchmen, or other traits for Iron Golems or Juggernauts. That way you can get traits that you can pick for just that unitmodeltype. Although adding a new UnitModelType can be a bit tricky.

2) Yes, you can use that XML to make a trait unlock from a tech after researched. But one of the downsides is that any unit with that trait will also only be unlocked from the same tech.

3) Yes, you can set each Juggernaut to cost a resource. The resource can be set so that it is not stored (like elemental shards). Each new juggernaut would drain 1 of this resource while alive.

4) The main problem is that these monsters do not have animations and certain skeleton bind points for weapons, shields and such (you'll have to try what works on your own). If you do that XML it should work, although if you make a new UnitModelType you could still allow the player to design the unit as he sees fit with weapons and such.

For making these monster units, I can show you how to insert new bind points (local frames) in monster skeletons if you want to. It's a pretty cumbersome process but it can be done.

Reply #42 Top

Heavenfall, thank you for very fast answers!

So, if I get it right, it's the <CanBeDesigned>0</CanBeDesigned> tag that makes the traits (usually Blood, Slave and such) defined at that moment permanent and unchangable?

For 2) - there's probably a possible workaround to define more traits for the units that I don't want unlocked at that moment but later (with prereq for some other tech for example)? Not ideal, but ok.

3) Can you be a bit more specific? Or let me see if I get it right - I can define some resource and assign a number to it (let's say for each race or faction?) which would support a number of units. So when the number of units reach the number of stored resources I will not be able to recruit any more. How to prevent the resource from being consumed when recruiting the units?

4) Ok so the limitations are in the skeleton binding points. But if I limit the equipment slots to those that those monsters use, I could theoretically "upgrade" them with additional traits if not armours, weapons etc? What I mean:

<EquipmentUpgradeDef>
            <EquipmentSlot>Weapon</EquipmentSlot>
            <EquipmentSlot>Defense</EquipmentSlot>

 

If I limit the possibility of upgrade for this unit only to Weapon and Defense (or for Ogres only Weapon since they do use it), perhaps it could work?

For example, if I make a Cave Bear recruitable and don't list any <EquipmentUpgradeDef>, then I could "upgrade" bears through traits.

 

Of course, if <EquipmentUpgradeDef> list actually means that listed equipment slots are available for upgrade. :-)

 

 

 

 

 

Reply #43 Top

1) No, look at CoreAbilities.xml and see how the blood traits look and work. CanBeDesigned is a unittype tag, it is not directly related.

3) The resource is "continuous". First an anti-example: Metal. If you have an income of +5 Metal per turn, you'll first have 5, then next turn 10, then 15. But what you are trying to accomplish instead uses a resource that works like the shard powers. If you have +3 Water shard, you have +3 the first turn, then +3 the second turn. It is not stored. So let's say you create a unit that eats 1 water shard each turn. Then you'll only have +2. When you reach 0 you'll be unable to build more.

4) Weapons and Shields currently are "unlimited", they can be worn by anyone because they have no SupportedUnitModelType like Bows do for example. So if you want upgradeable bears you need fill all the weapons and shields with SupportedUnitModelType so they can't be worn by bears.

Reply #44 Top

Ah, I get it now!

Thanks!

Reply #45 Top

Hello, I really enjoy Fred Saberhagen's Swords series and thought it might be fun to bring them into Elemental.

The xml below is my attempt to mod the charm unit (tame/silver tongue) onto an artifact.  I was totally pumped when I got it to work, but then realized i had just modded the spell Mindsword's Call into the spell list of every hero.

The attributes of being available for customization and the cheap cost for charming units will be tweaked.  But I found it an easy way to test stuff.

Can I make the spell have the prereq of the sword or am I doing it backwards and should just add the charm to the sword xml?

The Sword:

- <GameItemType InternalName="Mindsword">
<DisplayName>Mindsword</DisplayName>
<Description>The Mindsword spun in the dawn's gray light, And men and demons knelt down before. The Mindsword flashed in the midday bright, Gods joined the dance, and the march to war.
It spun in the twilight dim as well, And gods and men marched off to hell.</Description>
<Type>Weapon</Type>
<WeaponType>TwoHanded</WeaponType>
<CanBeEquipped>1</CanBeEquipped>
<CustomizationPointCost>1</CustomizationPointCost>
<ShopValue>5080</ShopValue>
- <GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_Attack_Cutting</StrVal>
<Value>14</Value>
</GameModifier>
- <GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_CombatSpeed</StrVal>
<Value>6</Value>
</GameModifier>
- <GameModifier>
<ModType>Unit</ModType>
<Attribute>UseSpell</Attribute>
<StrVal>Mindsword's Call</StrVal>
<Provides>Take control of an opposing unit.</Provides>
</GameModifier>
- <GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_CurrentWeight</StrVal>
<Value>10</Value>
</GameModifier>
- <GameModifier>
<ModType>Unit</ModType>
<Attribute>AdjustUnitStat</Attribute>
<StrVal>UnitStat_MaxCounterAttack</StrVal>
<Value>1</Value>
<Provides>+1 Counterattacks per round</Provides>
</GameModifier>
- <GameModifier>
<ModType>Unit</ModType>
<Attribute>CannotBeCounterattacked</Attribute>
<Provides>Unit never gets Counterattacked</Provides>
</GameModifier>
<IsAvailableForSovereignCustomization>1</IsAvailableForSovereignCustomization>
<RarityDisplay>Unique</RarityDisplay>
<HeroOnly>1</HeroOnly>
<IsAvailableForUnitDesign>0</IsAvailableForUnitDesign>
- <Prereq>
<Type>UnitStat_Level</Type>
<Attribute>1</Attribute>
</Prereq>
- <AIData AIPersonality="AI_General">
<AIPrefType>AIPrefType_CUTTING</AIPrefType>
<AIPriority>404.5</AIPriority>
</AIData>
<ArtDef>Longsword_Altar_ArtDef</ArtDef>
</GameItemType>

 

The Spell:

 

<SpellDef InternalName="Mindsword's Call">
<DisplayName>Mindsword's Call</DisplayName>
<Description>Convert an opposing unit to your cause unless they resist.</Description>
<Image>S_DestinysGift_Painting.png</Image>
<IconFG>T_SilverTongue_Icon.png</IconFG>
<IconColor>139,243,255</IconColor>
<AutoUnlock>0</AutoUnlock>
<Prereq>
<Type>GameItem</Type>
<Attribute>Mindsword</Attribute>
</Prereq>
<Cooldown>3</Cooldown>
<SpellBookSortCategory>Unit</SpellBookSortCategory>
<SpellBookSortSubCategory>Charm</SpellBookSortSubCategory>
<SpellType>Tactical</SpellType>
<SpellClass>Offensive</SpellClass>
<SpellSubClass>Debuff</SpellSubClass>
<SpellTargetType>Unit</SpellTargetType>
<SpellTargetCreatureType>Any</SpellTargetCreatureType>
<IsResistable>1</IsResistable>
<Range>5</Range>
<SpellResourceCost>
<Resource>Mana</Resource>
<Amount>1</Amount>
</SpellResourceCost>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>CharmTarget</Attribute>
<Value>100</Value>
</GameModifier>
<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
</AIData>
<HitSoundFX>Spell_SilverTongue_01</HitSoundFX>
<SpellDefEffect>
<EffectName>T_Tame_Particle</EffectName>
<LocalPosition>0,0,0</LocalPosition>
<EffectScale>1</EffectScale>
<EffectDelay>0</EffectDelay>
<SnapToTerrain>1</SnapToTerrain>
</SpellDefEffect>
</SpellDef>

 

Thanks for your knowledge and insight!

 

 

Reply #46 Top

Remove this

<Prereq>
<Type>GameItem</Type>
<Attribute>Mindsword</Attribute>
</Prereq>

add this to the spell

<IsSpecialAbility>1</IsSpecialAbility>

 

add this to the sword

    <GameModifier>
      <ModType>Unit</ModType>
      <Attribute>UnlockCombatAbility</Attribute>
      <StrVal>Mindsword's Call</StrVal>
      <Provides>description here</Provides>
    </GameModifier>

remove this

<GameModifier>
<ModType>Unit</ModType>
<Attribute>UseSpell</Attribute>
<StrVal>Mindsword's Call</StrVal>
<Provides>Take control of an opposing unit.</Provides>
</GameModifier>

You may have to rename the spell to something without space and '. It's the internalname, it won't show up anywhere but XML.

 

be sure to check out the Reliquary in Stormworld if you want some ideas or a better understanding of item XML

Reply #47 Top

I will, thank you!