(If you see typos, please point them out so that I can fix them)
To the best of my knowledge, there isn't any kind of "go into a frenzy" or "run around screaming" setting or object that you can readily apply to units. Instead, we are going to be making a system of Effect - Issue Order's that will tell the affected units what to do.
Panic Unit State
Effects Tab
Create a new Effect named Panic (Stop) with Effect Type: Issue Order
set Ability: Stop
set Player +: Target
set Target +: Source Unit
set Unit +: Source
This will tell the unit to stop whatever it is doing. This will signify the "end" of the panic state.
Create a new Effect named Panic (Run) with Effect Type: Issue Order
set Ability: Move
set Player +: Source
set Target +: Target Point
set Unit +: Source
This is the "panic" part of the ability. This tells the unit to run to each of the offset points we will create.
Create a new Effect named Panic (Offsets) with Effect Type: Create Persistent
This will randomly select an offset (direction) to tell the unit to run to based on its current location.
Create a new Effect named Panic (Panic) with Effect Type: Apply Behavior
set Unit +: Target
This is a placeholder in the effect chain until you have created the actual behavior.
Create a new Effect named Panic (Search) with Effect Type: Search Area
set Areas: (Arc: 360; Effect: Panic (Panic)); Maximum Count: -1; Radius: 5)
set Search Filters: Exclude [Dead/Hidden/Invulnerable/Missile/Self/Stasis]
set Impact Location +: Target Unit/Point
set Launch Location +: Source Unit
This effect is optional, but we will use this to apply the affect to units in a given blast area.
Behaviors Tab
Create a new Behavior named Panic with Behavior Type: Buff
set Alignment: Negative
set Categories: Temporary
open Modification +:
Behavior > State Flags: Enable Uncommandable
Movement > Movement Speed Multiplier: 1.5
set Effect - Final:Panic (Stop)
set Effect - Initial:Panic (Offsets)
set Effect - Periodic:Panic (Offsets)
set Duration: 10
set Period: 0.5
link the Effect - Apply Behavior:Panic (Panic)
This behavior increases the speed of the panicked unit, prevents player control and determines how long the unit flees and how frequently it changes directions.
Buttons Tab
Create a new Button named Panic
set Hotkey: D
set Icon: btn-ability-zerg-infestation.dds
Abilities Tab
Create a new Ability named Panic with Ability Type: Effect - Target
open Commands + and set the Default Button for Execute to Panic
set Target Filters: Exclude [Dead/Hidden/Invulnerable/Missile/Self/Stasis], Require [Visible] and Uncheck [Ally]
open Cost + and set Cooldown > Time Use: 1
set Effect:Panic (Search)
set Range: 6
Models Tab
Create a new Model named Panic (Blast)
set Model: PredatorImpactShockwave.m3
Create a new Model named Panic (Icon)
set Model: PingBoss.m3
Actors Tab
Create a new Actor named Panic (Blast) with Actor Type: Model Animation Style One Shot
set Model:Panic (Blast)
set Scale: 3.0
open Host +: Subject > clear value
open Events and create the following events:
Actor Creation
Animation Play (Name: Impact; Animation Properties: Death)
Animation Done
Destroy
Effect - Panic (Search) - Start
Create
This is the visual blast that represents the initial search area. It's important that you remove the Host + subject or the blast might end up attaching itself to a unit near the target point. While not game breaking, it can misalign the model so that it doesn't accurately represent where the search is actually created.
Create a new Actor named Panic (Icon) with Actor Type: Model Animation Style Continuous
set Model:Panic (Icon)
set Scale: 3.0
set Host +: Subject > _Unit (Alias)
set Host Site Operations +: Alias > SOpAttachOverhead
open Events and create the following events:
Actor Creation
Animation Play (Name: Attach; Animation Properties: Stand; Flags: Play Forever)
Behavior - Panic - Create
Create
Behavior - Panic - Destroy
Destroy
This will create the "panicked" model and attach it to each unit affected by the given behavior. The current setup will allow you to change the behavior's duration without needed to modify the actor. It will play for as long as the behavior is active.
Berserk Unit State
Effects Tab
Create a new Effect named Berserk (Stop) with Effect Type: Issue Order
set Ability: Stop
set Player +: Target
set Target +: Source Unit
set Unit +: Source
This will tell the unit to stop whatever it is doing. This will signify the "end" of the berserk state.
Create a new Effect named Berserk (Attack) with Effect Type: Issue Order
set Ability: Attack
set Player +: Target
set Target +: Target Unit
set Unit +: Source
This is the "berserk" part of the ability. This tells the unit the target found by the search area..
Create a new Effect named Berserk (Search) with Effect Type: Search Area
set Areas: (Arc: 360; Effect: Berserk (Attack)); Maximum Count: -1; Radius: 8 )
set Search Filters: Exclude [Dead/Hidden/Invulnerable/Missile/Self/Stasis]
set Impact Location +: Source Unit
set Launch Location +: Source Unit
set Target Sorts +: (Request Percentage: 1; Sorts: TSDistanceToTarget)
This effect is how the unit will find targets to attack, but we will use this to apply the affect to units in a given blast area.
Create a new Effect named Berserk (Berserk) with Effect Type: Apply Behavior
set Unit +: Target
This is a placeholder in the effect chain until you have created the actual behavior.
Behaviors Tab
Create a new Behavior named Berserk with Behavior Type: Buff
link the Effect - Apply Behavior:Berserk (Berserk)
This behavior increases the speed and damage of the berserking unit, shifts control to the neutral AI (an alternate method of preventing player control) and determines how long/frequently the unit rages and selects targets. It also causes negative life gain, degenerating 3 hit points per second to represent the self-destruction nature of rage.
Buttons Tab
Create a new Button named Berserk
set Hotkey: F
set Icon: btn-ability-zerg-corruption-multi.dds
Abilities Tab
Create a new Ability named Berserk with Ability Type: Effect - Target
open Commands + and set the Default Button for Execute to Berserk
set Target Filters: Exclude [Dead/Hidden/Invulnerable/Missile/Self/Stasis] and Require [Visible]
open Cost + and set Cooldown > Time Use: 1
set Effect:Berserk (Berserk)
set Range: 6
Models Tab
Create a new Model named Berserk (Rage)
set Model: ZergResearchPickUp.m3
Actors Tab
Create a new Actor named Berserk (Rage) with Actor Type: Model Animation Style Continuous
set Model:Berserk (Rage)
set Host +: Subject > _Unit (Alias)
set Host Site Operations +: SOpAttachOrigin
open Events and create the following events:
Actor Creation
Animation Play (Name: Attach; Animation Properties: Stand; Flags: Play Forever)
Behavior - Berserk - Create
Create
Behavior - Berserk - Destroy
Destroy
Actor Creation
Set Tint Color (Color: 255, 128, 128)
Actor Creation
Set Tint Color (Color: [255, 128, 128, HDR: 0.5]; Label: Enrage) - [Target: "::Host"]
There is a lot going on with this actor, but it's actually quite simple when broken down. The actor creates a model, increases the unit's size and tints both red. Then when the actor is destroyed after the behavior ends, it returns the unit back to normal. Perhaps the most important part of the events is the Target field on each event action. This is how you tell the actor to change its host rather than itself.
Caster Test Unit
We're going to use an Observer for our abilities, so you won't need to do anything other than add abilities. I duplicated the Observer and its actor for the text map while renaming it Provocateur.
Feel free to use the attached Test Map or contact me via forum post/IRC if you encounter problems. Keep in mind that I'm a busy person so I may not reply right away, but I'll do my best to answer all questions/concerns that I am aware of :)
Just fyi, as I have tested, if no ways of disable control of the unit is used, player order will always override the spell's Issue Order effect so the it was not really practical in multiplayer. (though setting the period smaller can challenge the player's spam apm)
@progammer - if you're talking about the Berserk ability, the unit is actually being changed to the Neutral Computer Player so you can't give it commands.
Well i'm saying that if you don't do that, then you can overdrive the command easily with just 1 click. The periodic effect can be negated by order to move repeatedly
Hey, first off, your guides are awesome. I was actually going to make a "How to:" involving AoE stuff but you've done it better than I ever could (between this and your "force events" guide). But Im basically working on a new custom ability parts of which involve some things from your guides. It took me a little while to figure this out but if anyone plans to use the model you use in this (•set Model: ZergResearchPickUp.m3 ) they need to add either "Liberty Story (Campaign) or Liberty (Campaign) as a dependency (I'm not sure which, I just added both). Without doing so the model will just show up as a pink hued blob.
@Wild Pickles - this is a simpler alternative, but you don't have control over elements like run distance, direction etc. It's also more likely to seem awkward as the unit will sometimes pick a really short run distance to move to and then wait until the next move order. By using random offsets at specific points you know the unit will never reach, you guarantee the unit will move continuously.
I might remake the test map and vid when I have free time to include this alternative though so that those not caring about the side-effects can see it :)
The only difference I really see is a finer control over the direction of the movement with the random offsets method (say, moving only to the left). Keeping the delay on the Wander behavior at 0 makes the wander continuous, even on short distances, and to keep the unit within the set range, you can always turn on the leash flag. I've attached a copy of your demo map with the panic behavior replaced.
Sidenotes: the last patch seems to have broken both our panic techniques when disable abilities is enabled on the panic behavior. I swapped it out for uncommandable. I also added a stop order to the initial effect of the behavior, since the wander doesn't kick in until the command queue is cleared.
First of all thanks a lot for this tutorial, it helps me a lot to understand how behaviors and effects are working !
I'm trying to add something more to the "panic effect" but I haven't found out yet how to do it ...
You might have noticed that the unit stops everything after a panic, even if she was executing an order before.
Since I'm working on a Tower Defense, the unit must continue its move after the panic.
So my question is : have you found a way to resume the existing order after the panic ?
Any idea would be really appreciated :)
Thanks alot...
This ability suitable for Ultralisk, Uberlisk or even my Zutralisk. Because they has the "Victory" animation.
I tried it myself and finally make the panic stage different on every units, each unit move at different time.
My English is bad ><.
I also create many events, actors and dummy effect to create an awesome casting animation and effect when my Zutralisk is casting "Howl of Terror".
Take a look from my map if you want to.
Could this be used to create a fleeing behavior? I supose I could have an event trigger the behavior instead than an ability - so that when you kill another unit of the same player close by (search area when a unit is killed and trigger the behavior on the ones close by?) - and have the unit wander on and off away from the killing unit.
I can see how this could be done by triggers, I think, but I don't know enough about events.
Also, how do you make the points dynamic, so that the paniced moves away from the killing unit? Is it even possible?
You could make it somewhat dynamic by running 4 Issue Orders on the unit at a time. You would use Validator Enumerate Area to check for a unit in a given direction. Basic diagram:
<- - O< X
O = Fleeing unit
v = Validator's Search Arc
X = Unit Found
<- - = Direction of Issue Order
Simply put you'd have 4 or more of these that check each of the directions for the unit and whichever arc finds a unit determines the direction of flight.
What about triggering the behavior when a unit dies? I supose you could run a trigger when a unit dies, pick units owned by the triggering player in a reagion ceated around the killed unit (destroy the region) and and add a buff that starts the behavior .. kindof?
Or can you do that with the data editor also?
Creating regions with every kill might slow the game, I supose.
Edit: sorry if I'm getting off-topic, but it's a valid pursue, taking that it's about incorporating the effect this topic is about.
i'm working on a variant of the bersek state and would need a little help
do you think it would be possible to make a berseked unit still controlled by the player but making the player's allies seem like foes
(i.e. changing the alliance and the model for ally units but only for the targeted player)
i know it could be done with triggers but i'd rather use behaviors
i don't want it done for me i would just like to know if you would have a tip for me
I have implemented the Berserk behaviour and it works nicely.
What I'm having trouble with is the actor: The actor model shows up, but the units size/color is not changed. To be honest I couldnt figure out where to set the Label to Enrage or Grow.
...Also I might be wrong but I think you're not destroying the actor once the behaviour is removed.
And one thing that goes without saying, but can't be said nearly enough: Thanks for all the great tutorials!
What about triggering the behavior when a unit dies? I supose you could
run a trigger when a unit dies, pick units owned by the triggering
player in a reagion ceated around the killed unit (destroy the region)
and and add a buff that starts the behavior .. kindof?
Or can you do that with the data editor also?
Creating regions with every kill might slow the game, I supose.
Edit: sorry if I'm getting off-topic, but it's a valid pursue, taking
that it's about incorporating the effect this topic is about.
Damage Response + on Behaviors allows you to create death effects. One of the fields is called death chance. Set this to 1 (100%) and then link the effect that will occur upon death later down the window.
do you think it would be possible to make a berseked unit still
controlled by the player but making the player's allies seem like foes
(i.e. changing the alliance and the model for ally units but only for
the targeted player)
This is somewhat similar to the changeling, but it actually model swaps. You would want to use the same settings it has that prevent you from attacking it unless force attacking. As for changing the model for only one player, I haven't experimented with that. It might be possible though.
I have implemented the Berserk behaviour and it works nicely.
What I'm having trouble with is the actor: The actor model shows up, but
the units size/color is not changed. To be honest I couldnt figure out
where to set the Label to Enrage or Grow.
...Also I might be wrong but I think you're not destroying the actor
once the behaviour is removed.
You set the labels in the actor events. It's exactly like "Name:" for Animation Play
Both actors are destroying at the appropriate times. Both have a Behavior.[Name].Destroy > Destroy event and the matching Create events.
And thank yeh kindly :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
(If you see typos, please point them out so that I can fix them)
To the best of my knowledge, there isn't any kind of "go into a frenzy" or "run around screaming" setting or object that you can readily apply to units. Instead, we are going to be making a system of Effect - Issue Order's that will tell the affected units what to do.
Panic Unit State
Effects Tab
This will tell the unit to stop whatever it is doing. This will signify the "end" of the panic state.
This is the "panic" part of the ability. This tells the unit to run to each of the offset points we will create.
This will randomly select an offset (direction) to tell the unit to run to based on its current location.
This is a placeholder in the effect chain until you have created the actual behavior.
This effect is optional, but we will use this to apply the affect to units in a given blast area.
Behaviors Tab
This behavior increases the speed of the panicked unit, prevents player control and determines how long the unit flees and how frequently it changes directions.
Buttons Tab
Abilities Tab
Models Tab
Actors Tab
This is the visual blast that represents the initial search area. It's important that you remove the Host + subject or the blast might end up attaching itself to a unit near the target point. While not game breaking, it can misalign the model so that it doesn't accurately represent where the search is actually created.
This will create the "panicked" model and attach it to each unit affected by the given behavior. The current setup will allow you to change the behavior's duration without needed to modify the actor. It will play for as long as the behavior is active.
Berserk Unit State
Effects Tab
This will tell the unit to stop whatever it is doing. This will signify the "end" of the berserk state.
This is the "berserk" part of the ability. This tells the unit the target found by the search area..
This effect is how the unit will find targets to attack, but we will use this to apply the affect to units in a given blast area.
This is a placeholder in the effect chain until you have created the actual behavior.
Behaviors Tab
This behavior increases the speed and damage of the berserking unit, shifts control to the neutral AI (an alternate method of preventing player control) and determines how long/frequently the unit rages and selects targets. It also causes negative life gain, degenerating 3 hit points per second to represent the self-destruction nature of rage.
Buttons Tab
Abilities Tab
Models Tab
Actors Tab
There is a lot going on with this actor, but it's actually quite simple when broken down. The actor creates a model, increases the unit's size and tints both red. Then when the actor is destroyed after the behavior ends, it returns the unit back to normal. Perhaps the most important part of the events is the Target field on each event action. This is how you tell the actor to change its host rather than itself.
Caster Test Unit
We're going to use an Observer for our abilities, so you won't need to do anything other than add abilities. I duplicated the Observer and its actor for the text map while renaming it Provocateur.
Units Tab
Feel free to use the attached Test Map or contact me via forum post/IRC if you encounter problems. Keep in mind that I'm a busy person so I may not reply right away, but I'll do my best to answer all questions/concerns that I am aware of :)
If this different than the suicide trigger? For the berserk effect at least.
Edit: Ah, I see some damage multipliers in there.
Just fyi, as I have tested, if no ways of disable control of the unit is used, player order will always override the spell's Issue Order effect so the it was not really practical in multiplayer. (though setting the period smaller can challenge the player's spam apm)
@progammer - if you're talking about the Berserk ability, the unit is actually being changed to the Neutral Computer Player so you can't give it commands.
@ProzaicMuze: Go
Well i'm saying that if you don't do that, then you can overdrive the command easily with just 1 click. The periodic effect can be negated by order to move repeatedly
Hey, first off, your guides are awesome. I was actually going to make a "How to:" involving AoE stuff but you've done it better than I ever could (between this and your "force events" guide). But Im basically working on a new custom ability parts of which involve some things from your guides. It took me a little while to figure this out but if anyone plans to use the model you use in this (•set Model: ZergResearchPickUp.m3 ) they need to add either "Liberty Story (Campaign) or Liberty (Campaign) as a dependency (I'm not sure which, I just added both). Without doing so the model will just show up as a pink hued blob.
I think I've found a cleaner way to implement the Panic behavior using the Wander behavior type that eliminates the need for random offsets:
P.S. I love your guides, and have learned a lot from them. Thanks for all your hard work!
@Wild Pickles - this is a simpler alternative, but you don't have control over elements like run distance, direction etc. It's also more likely to seem awkward as the unit will sometimes pick a really short run distance to move to and then wait until the next move order. By using random offsets at specific points you know the unit will never reach, you guarantee the unit will move continuously.
I might remake the test map and vid when I have free time to include this alternative though so that those not caring about the side-effects can see it :)
@ProzaicMuze: Go
The only difference I really see is a finer control over the direction of the movement with the random offsets method (say, moving only to the left). Keeping the delay on the Wander behavior at 0 makes the wander continuous, even on short distances, and to keep the unit within the set range, you can always turn on the leash flag. I've attached a copy of your demo map with the panic behavior replaced.
Sidenotes: the last patch seems to have broken both our panic techniques when disable abilities is enabled on the panic behavior. I swapped it out for uncommandable. I also added a stop order to the initial effect of the behavior, since the wander doesn't kick in until the command queue is cleared.
Hi everyone !
First of all thanks a lot for this tutorial, it helps me a lot to understand how behaviors and effects are working !
I'm trying to add something more to the "panic effect" but I haven't found out yet how to do it ... You might have noticed that the unit stops everything after a panic, even if she was executing an order before. Since I'm working on a Tower Defense, the unit must continue its move after the panic.
So my question is : have you found a way to resume the existing order after the panic ? Any idea would be really appreciated :)
Thanks by advance. Pierre
Thanks alot... This ability suitable for Ultralisk, Uberlisk or even my Zutralisk. Because they has the "Victory" animation. I tried it myself and finally make the panic stage different on every units, each unit move at different time.
My English is bad ><.
I also create many events, actors and dummy effect to create an awesome casting animation and effect when my Zutralisk is casting "Howl of Terror". Take a look from my map if you want to.
@pierrehaderer - One of the flags allows you to "queue" the issued order.
@TheOvermind92 - Looks cool :) I added the map to my stash of reference maps :D
Thanks for the tutorial.
Could this be used to create a fleeing behavior? I supose I could have an event trigger the behavior instead than an ability - so that when you kill another unit of the same player close by (search area when a unit is killed and trigger the behavior on the ones close by?) - and have the unit wander on and off away from the killing unit.
I can see how this could be done by triggers, I think, but I don't know enough about events.
Also, how do you make the points dynamic, so that the paniced moves away from the killing unit? Is it even possible?
You could make it somewhat dynamic by running 4 Issue Orders on the unit at a time. You would use Validator Enumerate Area to check for a unit in a given direction. Basic diagram:
<- - O< X
O = Fleeing unit
v = Validator's Search Arc
X = Unit Found
<- - = Direction of Issue Order
Simply put you'd have 4 or more of these that check each of the directions for the unit and whichever arc finds a unit determines the direction of flight.
Cool, thanks.
What about triggering the behavior when a unit dies? I supose you could run a trigger when a unit dies, pick units owned by the triggering player in a reagion ceated around the killed unit (destroy the region) and and add a buff that starts the behavior .. kindof?
Or can you do that with the data editor also?
Creating regions with every kill might slow the game, I supose.
Edit: sorry if I'm getting off-topic, but it's a valid pursue, taking that it's about incorporating the effect this topic is about.
thanks for the tutorial
i'm working on a variant of the bersek state and would need a little help
do you think it would be possible to make a berseked unit still controlled by the player but making the player's allies seem like foes (i.e. changing the alliance and the model for ally units but only for the targeted player)
i know it could be done with triggers but i'd rather use behaviors
i don't want it done for me i would just like to know if you would have a tip for me
thanks in advance
About what programmer said about players overriding orders.... cant you add to the behavior that the units command card is disabled?
@ProzaicMuce
Thanks..... I took about 3 hours to make the sonic wave effect and the buff on the head... Wasted many time on thinking what model should be use...
Now learning your Force Effects tutorial, will use the Zutralisk's "Stand Cover" animation to cast...
I have implemented the Berserk behaviour and it works nicely.
What I'm having trouble with is the actor: The actor model shows up, but the units size/color is not changed. To be honest I couldnt figure out where to set the Label to Enrage or Grow.
...Also I might be wrong but I think you're not destroying the actor once the behaviour is removed.
And one thing that goes without saying, but can't be said nearly enough: Thanks for all the great tutorials!
Greetings
Damage Response + on Behaviors allows you to create death effects. One of the fields is called death chance. Set this to 1 (100%) and then link the effect that will occur upon death later down the window.
This is somewhat similar to the changeling, but it actually model swaps. You would want to use the same settings it has that prevent you from attacking it unless force attacking. As for changing the model for only one player, I haven't experimented with that. It might be possible though.
You set the labels in the actor events. It's exactly like "Name:" for Animation Play
Both actors are destroying at the appropriate times. Both have a Behavior.[Name].Destroy > Destroy event and the matching Create events.
And thank yeh kindly :)