Author Topic: Composite Skills  (Read 16376 times)

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Composite Skills
« on: April 19, 2014, 01:24:31 PM »
The composite AI typ can have several different skills used by monsters, most of them are active skills but there's also a few passive ones.
Active skills goes inside the <array name="skills"></array> tags and passive ones goes under <array name="pskills"></array>. Various different enemy types can be made from using these skills, like towers, archers, casters etc.



These are all the active ones (I think).


Level Event
Calls upon an event in a level, an event is specified in the GlobalEventTrigger, just type something there and it will execute when this skill triggers.

Code: XML
  1. <dictionary>
  2.         <string name="conditional">hp lt 0.5</string>                                  
  3.         <string name="type">event</string>
  4.         <int name="cooldown">5000</int>
  5.         <float name="range">25</float>
  6.         <string name="event">eventname</string>
  7. </dictionary>                                  


Summon
When you want the enemy to spawn other monsters or other units, two examples below, the first one is used as a skill by lich_3 (black liches that summons fast skeletons in Act 4). The other example is a lich that summons item/bombs in an arc in front of him, used in the not yet released desert campaign. Prefabs can not be spawned.

Code: XML
  1. <dictionary name="summon">
  2.         <entry name="actor"><string>actors/skeleton_3.xml</string></entry>
  3.         <entry name="timer"><int>2000</int></entry>
  4.         <entry name="parts"><int>3</int></entry>
  5.         <entry name="effect"><string>effects/particles.xml:flash_summon</string></entry>
  6.         <entry name="sound"><string>sound/monsters.xml:lich_summon</string></entry>
  7. </dictionary>
  8.  
  9. <dictionary>
  10.         <string name="type">summon</string>
  11.         <string name="anim-set">attack</string>
  12.         <int name="cooldown">1500</int>
  13.         <float name="range">100</float>
  14.         <float name="dist">4</float>
  15.         <string name="sound">sound/monsters.xml:lich_summon</string>
  16.         <int name="num">10</int>
  17.         <int name="arc">150</int>
  18.         <string name="actor">items/bomb_lich_desert_1.xml</string>
  19.         <bool name="safety-raycast">false</bool>                                       
  20. </dictionary>


Heal
Heals other enemies, used on lich_2 in Act4

Code: XML
  1. <dictionary>
  2.         <string name="type">heal</string>
  3.         <string name="anim-set">attack</string>
  4.         <int name="cooldown">500</int>
  5.         <float name="range">40</float>
  6.         <string name="sound">sound/monsters.xml:lich_heal</string>
  7.         <int name="heal">20</int>
  8.         <float name="cast-range">10</float>
  9.         <string name="particle">effects/particles.xml:player_heal</string>
  10. </dictionary>


Blink
Teleports an enemy a certain distance, if negative it will blink towards the player.

Code: XML
  1. <dictionary>
  2.         <string name="type">blink</string>
  3.         <string name="anim-set">attack</string>
  4.         <int name="cooldown">1500</int>
  5.         <float name="range">2.5</float>
  6.         <string name="sound">sound/misc.xml:spawn_tele</string>
  7.         <float name="dist">5</float>
  8.         <string name="effect">effects/particles.xml:flash</string>
  9. </dictionary>


Hit
A normal hit attack, this is skeleton_2_elite. If cooldown is above "0", that will be the delay in milliseconds between each attack animation.

Code: XML
  1. <dictionary>
  2.         <string name="type">hit</string>
  3.         <string name="anim-set">attack</string>
  4.         <int name="cooldown">0</int>
  5.         <float name="range">2</float>
  6.         <int name="dmg">25</int>
  7. </dictionary>


Buff
Applies a buff on enemies or players, the first example is the red bloodlust effect cast by several minibosses, like the large tick in act 1 (tick_1_mb). The other example is a banner that drains mana from players close by. Results is heavily dependent on how the buff is constructed in itself, this just allows enemies to apply them.



Code: XML
  1. <dictionary>
  2.         <string name="type">buff</string>
  3.         <int name="cooldown">1000</int>
  4.         <float name="range">13</float>
  5.         <float name="cast-range">13</float>
  6.         <string name="category">Enemy</string>
  7.         <string name="buff">buffs/bloodlust.xml</string>                                       
  8. </dictionary>  
  9.  
  10. <dictionary>
  11.         <string name="type">buff</string>
  12.         <int name="cooldown">100</int>
  13.         <float name="range">100</float>
  14.         <float name="cast-range">5</float>
  15.         <string name="category">Player</string>
  16.         <string name="buff">buffs/banner_drain.xml</string>                                    
  17. </dictionary>


Whirlnova
A nova that can be set to shoot several projectiles with an attack animation AND an animation that plays while the nova is active. This example is from the miniboss lich (lich_1_mb) on Act 4.



Code: XML
  1. <dictionary>
  2.         <string name="type">whirlnova</string>
  3.         <string name="anim-set">attack</string>
  4.         <int name="cooldown">2000</int>
  5.         <float name="range">15</float>
  6.         <float name="min-range">2</float>
  7.         <int name="duration">2500</int>
  8.         <string name="chnl-anim">whirlwind</string>
  9.         <string name="projectile">projectiles/enemy_lich_1_mb.xml</string>
  10.         <int name="proj-delay">33</int>
  11.         <int name="per-revolution">8</int>
  12. </dictionary>



Spew
Shoots projectiles in a organized or random fashion, can be controlled, first example is from the Lich boss in the survival level (lich_boss_small), the second one is a tracking tower in the yet to be released desert campaign (tower_tracking_3) and the last one is the healing frost lich on Act 4. All these attacks are very different and are also heavily affected by what kind or projectile that is used and their behavior.



Code: XML
  1. <dictionary>
  2.         <string name="conditional">hp lt 0.25</string>
  3.  
  4.         <string name="type">spew</string>
  5.         <string name="anim-set">attack</string>
  6.         <int name="cooldown">4000</int>
  7.         <float name="range">14</float>
  8.         <string name="sound">sound/misc.xml:spawn_tele</string>
  9.         <string name="chnl-anim-set">attack</string>
  10.         <string name="proj">projectiles/enemy_lich_boss_small2.xml</string>
  11.         <float name="spread">0.5</float>
  12.         <int name="rate">33</int>
  13.         <int name="duration">2500</int>
  14.         <int name="ang-offset">180</int>
  15. </dictionary>
  16.  
  17. <dictionary>
  18.         <string name="sound">sound/monsters.xml:tower_shoot_beam</string>                                                      
  19.         <string name="type">spew</string>
  20.         <int name="cooldown">750</int>
  21.         <float name="range">100</float>
  22.         <string name="chnl-anim-set">attackstatic</string>                             
  23.         <string name="anim-set">attack</string>                                                
  24.         <bool name="static-dir">true</bool>
  25.         <string name="proj">projectiles/enemy_tower_drainbeam.xml</string>
  26.         <float name="spread">0</float>
  27.         <int name="rate">10</int>
  28.         <int name="duration">300</int>
  29. </dictionary>
  30.  
  31. <dictionary>
  32.         <string name="type">spew</string>
  33.         <string name="anim-set">attack</string>
  34.         <int name="cooldown">3000</int>
  35.         <float name="range">3</float>
  36.         <string name="chnl-anim-set">attack</string>
  37.         <string name="proj">projectiles/enemy_lich_frostspray.xml</string>
  38.         <float name="spread">0.33</float>
  39.         <int name="rate">45</int>
  40.         <int name="duration">2500</int>
  41. </dictionary>


Shoot
Used to shoot a single projectile, like an arrow or such.

Code: XML
  1. <dictionary>
  2.         <string name="type">shoot</string>
  3.         <string name="anim-set">attack</string>
  4.         <int name="cooldown">3000</int>
  5.         <float name="min-range">2.5</float>
  6.         <float name="range">20</float>
  7.         <string name="sound">sound/monsters.xml:lich_seeker</string>
  8.         <string name="proj">projectiles/enemy_arrow_1.xml</string>
  9. </dictionary>


Teleport
Teleports to destinations, a destination is any PathNode in a level, used by the Survival lich boss (lich_boss_small).

Code: XML
  1. <dictionary>
  2.         <string name="conditional">hp lt 0.5</string>
  3.  
  4.         <string name="type">teleport</string>
  5.         <float name="range">15</float>
  6.         <int name="usages">1</int>
  7.         <string name="sound">sound/misc.xml:spawn_tele</string>
  8.         <float name="min-dist">15</float>
  9.         <float name="max-dist">60</float>
  10.         <bool name="trail">true</bool>
  11. </dictionary>


Ground Hit
Same as the attack used by flowers (but not by the flowers, since they are not composite units), a spike launched up from the ground, or it's more an attack that spawns under the player, the graphics could be whatever.

Code: XML
  1. <dictionary>
  2.         <string name="type">ground-hit</string>
  3.         <string name="anim-set">attack</string>
  4.         <string name="chnl-anim-set">hold</string>
  5.         <int name="cooldown">1000</int>
  6.         <float name="range">5</float>
  7.         <string name="sound">sound/monsters.xml:hit_flower_1</string>
  8.         <string name="attack-effect">actors/guard_desert_1.xml:attack-effect</string>
  9.         <int name="dmg">10</int>
  10.         <int name="max-targets">1</int>
  11.         <int name="dmg-delay">400</int>
  12.         <float name="dmg-range">0.125</float>
  13. </dictionary>
  14. </array>



These are all the passive skills.

Drop
When you struck the monster, it can drop things, just like loot, this is a tick (tick_2) that drops money when hit. It can be monsters or something else too, but not prefabs.

Code: XML
  1. <dictionary>                           
  2.         <string name="type">drop</string>
  3.         <string name="sound">sound/monsters.xml:death_tick_golden</string>
  4.         <int name="hp">14</int>
  5.                 <dictionary name="loot">
  6.                         <string name="origin">0 0</string>
  7.                         <float name="spread">0.5</float>
  8.                                 <array name="loot">
  9.                                         <array>
  10.                                                 <int>50</int><string>items/valuable_9.xml</string>
  11.                                                 <int>450</int><string>items/valuable_8.xml</string>
  12.                                                 <int>500</int><string>items/valuable_7.xml</string>
  13.                                         </array>                                       
  14.                                 </array>
  15.                 </dictionary>                                  
  16. </dictionary>


Retaliate
If you strike a monster, there's a chance it will reflect some damage back and also it can apply a buff doing so. It can be compared to the Wizard Frost Armor skill.

Code: XML
  1. <dictionary>
  2.         <string name="type">retaliate</string>
  3.         <string name="sound">sound/monsters.xml:lich_summon</string>
  4.         <string name="effect">effects/particles.xml:flash</string>
  5.         <int name="chance">50</int>
  6.         <int name="dmg">5</int>
  7.         <string name="buff">buffs/enemy_tower_icebeam.xml</string>
  8. </dictionary>


Armor
Give the monster armor, that can block a certain number or percentage of the damage you deal to it.

Code: XML
  1. <dictionary>
  2.         <string name="type">armor</string>
  3.         <string name="sound">sound/monsters.xml:lich_summon</string>
  4.         <string name="effect">effects/particles.xml:flash</string>
  5.         <int name="chance">100</int>
  6.         <int name="dmg-sub">2</int>
  7.         <float name="dmg-mul">0.5</float>
  8. </dictionary>


I think that's all....
« Last Edit: May 31, 2014, 02:48:41 PM by Hipshot »

Heretic

  • Moderator
  • Posts: 305
  • Castle Runner
    • View Profile
Re: Composite Skills
« Reply #1 on: April 19, 2014, 02:03:12 PM »
This is awesome thanks!

Amran

  • Posts: 20
  • Maggot Crusher.
    • View Profile
Re: Composite Skills
« Reply #2 on: April 19, 2014, 05:36:05 PM »
Thanks for taking the time to document this, definitely handy to know!

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Composite Skills
« Reply #3 on: April 20, 2014, 10:49:22 AM »
Added heal, that is present only on lich_2  =)

Kashlavor

  • Posts: 79
  • Spike Dodger.
    • View Profile
Re: Composite Skills
« Reply #4 on: April 28, 2014, 06:16:59 PM »
Just got back into Hammerwatch editor, very cool!

I decided to try remixing ranger by making his bomb spawn an enemy which applies a speed/damage debuff to all other enemies using this.  Just trying to see how far the classes can be stretched.

Edit: Also, what is the syntax for the composite explode skill?  Any other skills to know about?  And what is the full list of movement types?

Final query: is launching seeker projectiles and healing something the composite type can do, or is that restricted to casters?

As for explosions I found the answer mere moments after asking - adding it here in case anyone else is curious.

Code: [Select]
<array name="skills">
<dictionary>
<string name="type">explode</string>
<string name="anim-set">attack</string>
<int name="cooldown">0</int>
<float name="range">2</float>

<string name="sound">sound/monsters.xml:lich_summon</string>
<string name="effect">effects/particles.xml:flash</string>

<string name="particle">effects/particles.xml:ice-particle</string>
<dictionary name="light">
<float name="add-range">8</float>
<string name="add-color1">10 100 150</string>
<string name="add-color2">0 50 100</string>
<string name="add-color3">0 50 75</string>
</dictionary>

<float name="splash">5</float>
<int name="dmg">25</int>
<string name="buff">buffs/frost.xml</string>
<bool name="suicide">true</bool>
</dictionary>
</array>
« Last Edit: April 28, 2014, 06:23:28 PM by Kashlavor »
Starting work on the Lair of the Archnecromantrix, a Hammerwatch campaign!

Myran

  • Developer
  • Posts: 183
    • View Profile
Re: Composite Skills
« Reply #5 on: April 29, 2014, 11:36:57 AM »
Healing is available for composite actors, and they can shoot seeking projectiles by applying the seeking behavior to the projectile itself:
Code: [Select]
<projectile directions="8" collision="0.75" behavior="seeker" damage="5" speed="0.85">
<behavior>
<dictionary>
<float name="ang-speed">0.15</float>
<float name="ttl">5000</float>
<string name="buff">buffs/spider_1.xml</string>
</dictionary>
</behavior>
....

The movement types are just melee, ranged and passive.

Kashlavor

  • Posts: 79
  • Spike Dodger.
    • View Profile
Re: Composite Skills
« Reply #6 on: April 29, 2014, 12:04:48 PM »
The tracking tower looks very cool.  And thanks for the feedback.

Yep, figured it out.

« Last Edit: April 29, 2014, 01:17:49 PM by Kashlavor »
Starting work on the Lair of the Archnecromantrix, a Hammerwatch campaign!

Kashlavor

  • Posts: 79
  • Spike Dodger.
    • View Profile
Re: Composite Skills
« Reply #7 on: May 01, 2014, 09:46:45 AM »
Should also add in Whirlwind, like from the skeleton miniboss.

Code: [Select]
<dictionary>
<string name="type">whirlwind</string>
<string name="anim-set">attack</string>
<int name="cooldown">5500</int>
<float name="range">4</float>

<int name="duration">2500</int>
<string name="chnl-anim">whirlwind</string>
<int name="dmg">10</int>
<float name="dist">1.25</float>
</dictionary>

How does the ranged movement type work?  whenever I just put in <string name="type">ranged</string> the game crashes.
« Last Edit: May 01, 2014, 09:48:31 AM by Kashlavor »
Starting work on the Lair of the Archnecromantrix, a Hammerwatch campaign!

Myran

  • Developer
  • Posts: 183
    • View Profile
Re: Composite Skills
« Reply #8 on: May 01, 2014, 03:33:10 PM »
Ah sorry, the ranged movement needs both the speed parameter and a range parameter (also a float), the range is how far away from the player he wants to be. You can look at lich_2.

Kashlavor

  • Posts: 79
  • Spike Dodger.
    • View Profile
Re: Composite Skills
« Reply #9 on: May 20, 2014, 02:22:47 AM »
What are the valid pieces of syntax for "conditional" abilities?  I mean "hp lt 0.5" seems fairly obvious but what else can you test against?  Could there be like "atackspeed gt 2" or whatnot?
Starting work on the Lair of the Archnecromantrix, a Hammerwatch campaign!

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Composite Skills
« Reply #10 on: May 20, 2014, 09:42:39 AM »
This is it:

Code: [Select]
<string name="conditional">hp lt 0.75 and hp gt 0.5</string>
You can also have a skill only work for a specific number of times:

Code: [Select]
<int name="usages">1</int>
I think there's also a skill that calls an event in a level, but it was never used, I'm gonna do that in the desert however, so I'll add it later here when I know how it works.

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Composite Skills
« Reply #11 on: May 26, 2014, 10:43:05 AM »
Added the event skill to the top of the page.
« Last Edit: May 26, 2014, 08:02:02 PM by Hipshot »

Kashlavor

  • Posts: 79
  • Spike Dodger.
    • View Profile
Re: Composite Skills
« Reply #12 on: May 26, 2014, 05:46:41 PM »
...huh.  I feel like that is a super useful addition but I have no idea how I'd actually use it.

Maybe a miniboss could be super awesome and throw up his own parallax layer?  Or make enemies spawn all over a room in set places?

Or...something.  What are you using it for?

Edit: Best I cold think of was to have a room full of traps/shooters which monsters can activate intermittently. 
« Last Edit: May 26, 2014, 05:49:52 PM by Kashlavor »
Starting work on the Lair of the Archnecromantrix, a Hammerwatch campaign!

Hipshot

  • Developer
  • Posts: 453
  • Level Designer
    • View Profile
Re: Composite Skills
« Reply #13 on: May 26, 2014, 08:01:45 PM »
Read at the top of the page, maybe you understand that better =)

Kashlavor

  • Posts: 79
  • Spike Dodger.
    • View Profile
Re: Composite Skills
« Reply #14 on: May 26, 2014, 11:56:53 PM »
Oh sure I see the syntax, I was just curious what you were doing with it.
Starting work on the Lair of the Archnecromantrix, a Hammerwatch campaign!