Modding Question

New Champion System

Hi, I've gotten a bit into modding lately and I'm trying to redo the Champion system into something with a bit more choices.

Archer, Knight, Barbarian, Guardian, Berserker

Wizard, Battlemage, Warlock, Necromancer, Enchanter

Ranger, Rogue, Druid, Bard, Shadow

Prophet, Paladin, Ritualist, Priest, Monk

Seeker, General, Alchemist, Sage, Bounty Hunter

Something like that.

I've run into a few questions that I was hopening that I could get help with.

1) Is there any problems that will arise with limiting casters to cloth armor only by setting their UnitStat_WeightCapacity to 0 and changing mounts and items that adds to it not to do so anymore? Only want them to use staffs also which are no weight if i remember correctly.

2) For the druid I was thinking about some shapeshifting is it possible to change graphics into a wolf for a few tactical combat turns? Or will it bug with the items the druid is using?

3) The Monk will focus on counter-attacks with abilities boosting them like adding dodge and attack until the next turn. The problem that I've run into is that when I set the duration to 1 is that it expires imidiately and when I set it two 2 it expires after two turns. Any work-arounds?

<!-- WaspStance -->
<!-- WaspStance increases dodge and provides poison damage to the monk.  -->
    <SpellDef InternalName="WaspStance">
        <DisplayName>Wasp Stance</DisplayName>
        <Description>The Monk meditates and enters Wasp Stance, with improved dodge and poison attack until their next action.</Description>
        <Image>Wasp_Stance.png</Image>
        <IconFG>Wasp_Stance.png</IconFG>
        <IconColor>32,45,243</IconColor>
        <CanStack>0</CanStack>
        <SpellBookSortCategory>Unit</SpellBookSortCategory>
        <SpellBookSortSubCategory>UnitEnchantment</SpellBookSortSubCategory>
        <SpellType>Tactical</SpellType>
        <SpellClass>Defensive</SpellClass>
        <SpellSubClass>Buff</SpellSubClass>
        <SpellTargetType>Self</SpellTargetType>
        <IsCastable>0</IsCastable>
        <IsSpecialAbility>1</IsSpecialAbility>
        <PreventStackingWith>WaspStance</PreventStackingWith>
    <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Attack_Poison</StrVal>
            <IsForFormattedDescription>1</IsForFormattedDescription>
            <DisplayName>Wasp Stance</DisplayName>
            <Duration>2</Duration>
            <Effect>E_Berserk_Particle</Effect>
            <Value>5</Value>
        </GameModifier>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Dodge</StrVal>
            <IsForFormattedDescription>1</IsForFormattedDescription>
            <Duration>2</Duration>
            <Value>15</Value>
        </GameModifier>
        <AIData AIPersonality="AI_General">
            <AIPriority>10</AIPriority>
        </AIData>
        <HitSoundFX>Spell_Beserk_01</HitSoundFX>
        <SpellDefEffect>
            <EffectName>T_Berserk_Particle</EffectName>
            <LocalPosition>0,35,0</LocalPosition>
            <EffectScale>0.7</EffectScale>
            <EffectDelay>0</EffectDelay>
            <SnapToTerrain>1</SnapToTerrain>
        </SpellDefEffect>
    </SpellDef>

I'm sure I'll have many more questions later but let's start with those, thanks in advance!

7,581 views 14 replies
Reply #1 Top

1) No.

2) No. Not possible to change the the graphics of an existing unit.  No polymorphing or shapeshifting possible atm.

3) 2 is the only thing that will work for what you are trying to do.  You can't both activate the ability and make a melee attack during the same combat round.

You also don't need this line:

<PreventStackingWith>WaspStance</PreventStackingWith>

Setting <CanStack> to 0 is enough.

Also remove <IsForFormattedDescription> from your GameModifiers.  You have no formatted description, nor do you need one, because you are not using any variables in this spell.

 

Reply #2 Top

Like AutoDefend in Corespells.xml try

            <Duration>1</Duration>
            <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>

Reply #3 Top

Thanks HF works perfectly and mqpiffle for cleaning my code a bit, I thought <IsForFormattedDescription> was for the combat text that appears but I realized it is not needed now. The monk is not supposed to attack it has a built in counter-attack no matter what weapon it is using (will be using staff only once i get question 1 done.) The Styles are there to boost the counter-attacks.

And some more :)

4) The prophet realizing his own potential is supposed to gain extra level-ups at certain intervals every 5 level or so. So I thought about setting the units level one level higher when a trait is unlocked and picked at at say level 10, with this, borrowed from Paragon, however it doesn't seem to work as planned perhaps there is no UnitLevelUp and only a TargetUnitLevelUp?

        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>UnitLevelUp</Attribute>
        </GameModifier>

5) The Bounty Hunter gains extra gold from combat, by using the:           

            <StrVal>UnitStat_GoldFromCombat</StrVal>
            <Value>2</Value>

Which I assume increases the gold gain with +100% since the default value is 1?

6) I tried to do something similar to the mana/heal from kill with the gold but have not been able to find and gold from kill UnitStat. Is it somehow possible to add more UnitStats? Or are they part of the game engine code?

7) I also made a Pinning Shot ability for the Archer which is basicly the same as hobble only that it decreases the move by 2, I figured that SD might have picked 1 because they didn't want move to ever become negative. In general is there any problem with values becoming negativ? Would a negative attack value heal the target for example?

 

Reply #4 Top

4) Not sure if that works, you'll have to try it out. If it does it does.

5) I don't think that unitstat works, sorry.

6) While you can add new unitstats, they cannot do what you want (gold per kill).

7) I don't think moves can become negative. However a unit with 0 moves will pass its action if the AI is playing it (even an archer unit). The only case where a negative damage turns into healing is when you use CurHealth modifier.

Reply #5 Top

4) Doesn't work as of now, what I can figure out.

5) Doesn't work either I think, like you said, put the value to 100 but still only got 3 gold after combat with butcher.

6) What type of new unitstats is it possible to add? Only things that defines units such as demon and so on or other things that makes for more interesting abilities?

7) I see thanks, I'll have to think about something to do with that then. Since I also wanted to add some sort of bear trap ability to the ranger.

Reply #6 Top

8) Also since I got your attention HF I wanted to ask you where you got that wonderful skeleton model (undead) that you use in your stormworld mod, and if I could get permision to use it for Necromancer summons.

Reply #7 Top

6) You can use them in a few different ways. The first way is to provide new attack and defense values. For example Stormworld has Arcane attack, which is defended by Spell Resist. The second way is to use it as markers, like I do, for a "demon" or something. This allows you to do special things to those marked with that unitstat, from abilities and spells ("spell deals X extra damage if target is demon"). You can also use unitstats as a way to unlock spells, or limit what traits units gain at level-up (ie "Unit must have at least 10 charisma or will not have option of Bard Path"). For an example of a bit more complex use: The Earthshakers: http://stormworld.wikidot.com/reliquary#Earthshakers which give you +1 unitstat every time you are hit, and when you have 5 or more you can use 5 to cast Shockwave.

8) Unfortunately I cannot allow it, it was licensed only for Stormworld. Purchased here http://www.turbosquid.com/3d-models/3ds-max-human-skeleton/599775

Reply #8 Top

6) Adding new types of attack does open up a few new options, I'll look into that. And I like the idea of charge-up abilities, have you gotten that to function carry over between combats? Because from what I can see in your mod they all expire at the end of combat.

8) Ok, thanks for letting me know where you got it from. I will look into it once I get further in my development.

And thanks for all the good advice!

Reply #9 Top

Quoting Heavenfall, reply 2
Like AutoDefend in Corespells.xml try

            <Duration>1</Duration>
            <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>

So that's what <UpdateDurationAtTurnStart> does.

Reply #10 Top

Quoting Heavenfall, reply 5
However a unit with 0 moves will pass its action if the AI is playing it (even an archer unit).

This isn't always true.  I've used Root and the AI will still attack most (I would say) of the time.  But sometimes it will just pass its turn even though it can act.

Reply #11 Top

6) They intentionally expire at end of combat. It would be no problem to keep the unitstats after combat, just remove the <Duration>.

Reply #12 Top

9) How would one go about to summon items with spells and traits? Is it possible?

10) Does some UnitStats only work with traits and not spells and the other way around?

        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_MaxCounterAttack</StrVal>
            <Value>1</Value>
        </GameModifier>

Works in traits,

        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_MaxCounterAttack</StrVal>
            <Value>2</Value>
            <Duration>1</Duration>
            <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>
        </GameModifier>

Doesn't work in spells.

        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Dodge</StrVal>
            <Duration>1</Duration>
            <UpdateDurationAtTurnStart>1</UpdateDurationAtTurnStart>
            <Value>10</Value>
        </GameModifier>

Works in spells.

11) Is there a way to calculate using the value for damage done? I want to give the Warlock health steal based on spell damage, I can do so using expected damage but do not know how to do it with actual damage.

Reply #13 Top

9) You cannot place items in a unit's inventory or equip items with spells.

10) I see no reason this shouldn't work.  For testing purposes I would unhide the UnitStat and make it so it shows up in the unit details screen so you can visually verify whether it's working or not.  Just make an xml file and add this code to it:

<UnitStatType InternalName="UnitStat_MaxCounterAttack">
        <Hidden>0</Hidden>
        <UnitStatGrouping>UnitDetailsCombatStat</UnitStatGrouping>
    </UnitStatType>

11)Lifesteal spells are a special beast that I haven't really tinkered with yet. I looks like you can only heal the caster and damage the target in a 1:1 ratio.

Reply #14 Top

You can give items from spells with

            <GameModifier>
                <ModType>GiveItem</ModType>
                <Attribute>BookOfExperience1</Attribute>
            </GameModifier>

 

All unitstats can be altered from spells and traits, but some unitstats are handled a bit differently. Counter-attack, for example, is saved as a dummy unitstat at the beginning of a unit's turn so that the game can keep count of how many times the unit has already counter-attacked. Therefore, modifying it may be difficult unless it is a permanent bonus.