This tutorial teaches you, how to create basic colliding projectiles with the data editor. We will handle the kill credit correctly and use different target options (like explode on contact or pierce through targets).
Doodad/cliff collision will not be part of this tutorial, but maybe added in the future.
For demonstrating colliding projectiles, we will create 3 different abilities.
The first ability will be a recreation of a Diablo 2 - style Fireball.
The second ability will be some kind of piercing projectile, which collides with units, but does not get destroyed in the process and cannot hit units multiple times.
The third ability will be some kind of boomerang ability, which does the same thing, but returns to the caster and can hit targets multiple times.
General things:
I use the english version of the editor, so everything will be described in english
I usually always enable campaign dependencies, even if they are not required, so I will not mention it.
My data view options are all enabled, except View Raw Data. To see all the fields as I describe them, you need to enable following view options:
Show Table View
Show Default Options
Show Advanced Fields
Show Field Type Names
Combine Structure Values
Unless explicitly specified, do not change the based on - field when creating new objects and always click Suggest for the ID. Be careful about the based on - field, especially for actors. If you forgot to change it, do not try to change it later, but delete the object and create a new one with the correct base, otherwise it might malfunction.
Fireball
Most of you might already know this ability, however, I want to explain shortly, what it does:
The caster releases a fast-moving projectile, which collides with the first unit in its way. It explodes and deals damage in an area around the impact location.
We will use the firebat as the caster unit for this spell, and since the firebat has 2 arms he raises with his animations and a single fireball is boring anyways, we will make him shoot 2 fireballs.
Also, unlike in Diablo 2, we will implement a maximum range for the fireball, when it reaches this, it will simply explode.
The caster releases a projectile, which collides with any enemy unit in its path, dealing damage to them. It does not get destroyed until reaching its destination.
For the sake of variety, another unit will cast this ability, lets take a Tauren Marine ;)
A boomerang - like ability. The saw curves towards a target point and travels back to the caster.
The saw damages everything in its path and should be able to hit units multiple times.
However, it should not hit units multiple times just when passing through them, only, if it hits the units again.
This will be casted by a Prisoner Zealot.
These are detailed instructions for exact recreations of the abilities demonstrated in the video and present in the attached test map.
The first paragraph for all 3 spells contains some basic information, why we are creating the spell the way we do it. It is not needed for the step by step instruction, but might be very helpful, if you do not want to use exact recreations of the spell, but similar ones.
If you are not interested and just want to recreate the spells, you can skip the "Basics" - paragraphs.
Fireball
Basics
We will create a missile, which travels to a point, as usual with a launch missile effect and an impact effect.
For the collision functionality, we will use a persistent effect, which periodically runs a search area at the missile's location.
We will use the missile's Launch Effect - field for this, which starts an effect, when the missile is launched.
For this effect, the caster will be the unit casting the ability and the source will be the missile. This is very useful,this way we have direct access to the missile without having to use a behavior.
There are 2 possibilities to remove the persistent: Either the persistent runs indefinitely, and we use an explicit Destroy Persistent effect to get rid of it, or we simply use a periodic count for the persistent, so the persistent will be finished, after the missile reached the maximum travel distance.
The 2nd possibility works, but since the missile can be destroyed prematurely, the persistent would still try to check for collision for a while, so I prefer an explicit destruction, it "feels" more correct.
Because of this, we can deal the damage directly with the persistant effect, the caster will still be the original unit and never the missile, so kill credit will be automatically correct.
Units
Create a new unit called Fireball Missile, based on Default Settings (Projectile); click suggest for the id and then ok.
Buttons
Create a new button called Fireball.
Change the Icon-field to Assets\Textures\btn-ability-terran-bombardmendstrike-color.dds.
Change Hotkey and Tooltip as you like.
Effects
Create a new Effect, called Fireball Damage, type Damage.
Set the Combat - Amount field to 45.
Set Effect - Death to Blast.
Click the Search - Area + - field and add 3 regions:
Radius : 0.5 , Fraction: 1
Radius : 1.5 , Fraction: 0.5
Radius : 2.5 , Fraction: 0.25
Click the Search - Search Filters - field and uncheck Ally and Player. Also set following fields to excluded:
Dead
Hidden
Invulnerable
Item
Missile
Stasis
Set Target - Impact Location to Target Point
New effect, name Fireball Impact, type Set.
Open Effect - Effects and add following effects:
Fireball Damage
Suicide
New effect, name Fireball Target Check, type Search Area
Open Search - Areas +, add a new entry using Radius: 0.3 and Effect: Fireball Impact
Click the Search - Search Filters - field and uncheck Ally and Player. Also set following fields to excluded:
Dead
Hidden
Invulnerable
Item
Missile
Stasis
New effect, name Fireball Persistent, type Create Persistent
Open Effect - Flags, check Persist until destroyed
Open Effect - Period Durations, add a new entry 0.0625
Open Effect - Periodic Effects, add a new entry Fireball Target Check
Change Target - Location + to Source Unit
New effect, name Fireball Destroy Persistent, type Destroy Persistent
Set Effect - Effect to Fireball Persistent
Set Target - Location + to Source Unit
Go to your Fireball Impact - effect and add Fireball Destroy Persistent to the list of effects.
New effect, name Fireball Launch R, type Launch Missile
Set Effect - Impact Effect to Fireball Impact.
Set Effect - Launch Effect to Fireball Persistent.
Open Movement - Movers, add a new entry: PunisherGrenadesWeapon (unnamed)
Set Target - Impact Location to Target Point
Set Unit - Ammo Unit to Fireball Missile
Copy the last created effect, rename it to Fireball Launch L, click suggest.
New effect, name Fireball Initial, type Create Persistent
Set Effect - Period Count to 2
Open Effect - Period Effects and add Fireball Launch R and Fireball Launch L
Open Effect - Periodic Offsets and add following entries:
x = 0.4 , y =-10, z = 0.5
x =-0.4 , y =-10, z = 0.5
Set Target - Location + to Source Point
Abilities
New ability, name Fireball, type Effect - Target
Open Ability - Commands +, select Execute, set the Default Button to Fireball
Set Effect - Effect to Fireball Initial
Set Stats - Range to 9
Actors
New actor, name Fireball Missile, type Missile, based on GenericAttackMissile
Set Unit Name to Fireball Missile
Set Art - Model to Yamato Weapon
Open Event - Events + and add this event:
Actor creation
Set Tint Color
Set the tint color to the RGB values 255,255,100 and the HDR multiplier to 4.0
New actor, name Fireball Impact, type Model, based on ModelAnimationStyleOneShot
Set Art - Model to 330mmBarrageCannonsImpact (unnamed)
Set Art - Scale to (1.5,1.5,1.5)
Open Event - Events, and create this event:
Effect.FireballImpact.Start
create
Make sure the field Host + only contains something like (implicit, implicit, disabled). If there is a _selectable or something, remove it.
New actor, name Fireball Impact Sound, type Sound, based on SoundOneShot
Open Event - Events, and create this event:
Effect.FireballImpact.Start
create
Set Sound - Sound to Raven_HunterSeekerAttackImpact
New actor, name Fireball R, type Action, based on GenericAttack
Set Impact Effect to Fireball Impact and Launch Effect to Fireball Launch R
Open Attachment - Launch Attachment Query +, change the AMFilterWeapon00 - method to Filter WeaponRight
Open Combat - Launch Assets, set the Sound to Firebat_AttackLaunch
Copy the last created actor, rename it to Fireball L, click suggest
Change the Launch Effect to Fireball Launch L and the attachment method to Filter WeaponLeft.
Select the Firebat - Actor
Open Event - Events + and add the following Event:
Abil.Fireball.SourcePrepStart
AnimPlay Spell Attack
Units
Select the Firebat
Open Ability - Abilities +, add Fireball
Open Ability - Command Card +
Add the Fireball - Button to any free spot
Change the Command Type to Ability Command
Set the Ability to Fireball
For some visual enhancements, you can play around a little, for example add a prepare and finish time to the spell.
The Test Map
Everything related to the Fireball is prefixed with "Fireball -", so if you enter this in the search line, you will get only objects related to the fireball.
Plasma Surge
Basics
Most of the stuff is very similar to the Fireball, except we will not destroy the missile on the first impact.
This means, of course, we will need a way to not affect units multiple times, otherwise units, especially huge ones, might take massive amounts of damage, as the surge travels through them.
Fortunately we are using a persistent effect, so we can easily incorporate markers for this task.
Also, I will not use a Destroy Persistent here, since the missile always travels the full duration. Still, its not that exact, but fine, I guess.
Units
Create a new unit called Plasma Surge Missile, based on Default Settings (Projectile); click suggest for the id and then ok.
Buttons
Create a new button called Plasma Surge.
Change the Icon-field to Assets\Textures\btn-research-terran-ultracapacitors.dds.
Change Hotkey and Tooltip as you like.
Effects
Create a new Effect, called Plasma Surge Damage, type Damage.
Set the Combat - Amount field to 45.
Set Effect - Death to Blast.
Open Effect - Validators and add No Markers
New effect, name Plasma Surge Impact, type Set.
leave it blank (this will be our impact effect for the launch missile effect and an indicator for some actors)
New effect, name Plasma Surge Target Check, type Search Area
Open Search - Areas +, add a new entry using Radius: 0.5 and Effect: Plasma Surge Damage
Click the Search - Search Filters - field and uncheck Ally and Player. Also set following fields to excluded:
Dead
Hidden
Invulnerable
Item
Missile
Stasis
New effect, name Plasma Surge Persistent, type Create Persistent
Set Effect - Period count to 16
Open Effect - Period Durations, add a new entry 0.0625
Open Effect - Periodic Effects, add a new entry Plasma Surge Target Check
Change Target - Location + to Source Unit
Open Target - Marker + and enable Match Flags -> Id
New effect, name Plasma Surge Launch , type Launch Missile
Set Effect - Impact Effect to Plasma Surge Impact.
Set Effect - Launch Effect to Plasma Surge Persistent.
Open Movement - Movers, add a new entry: PunisherGrenadesWeapon (unnamed)
Set Target - Impact Location to Target Point
Set Unit - Ammo Unit to Plasma Surge Missile
New effect, name Plasma Surge Initial, type Create Persistent
Set Effect - Period Count to 1
Open Effect - Period Effects and add Plasma Surge Launch
Open Effect - Periodic Offsets and add the following entry:
x = 0 , y =-10, z = 0.5
Set Target - Location + to Source Point
Abilities
New ability, name Plasma Surge, type Effect - Target
Open Ability - Commands +, select Execute, set the Default Button to Plasma Surge
Set Effect - Effect to Plasma Surge Initial
Set Stats - Range to 9
Actors
New actor, name Plasma Surge Missile, type Missile, based on GenericAttackMissile
Set Unit Name to Plasma Surge Missile
Set Art - Model to Yamato Weapon
New actor, name Plasma Surge Impact, type Model, based on ModelAnimationStyleOneShot
Set Art - Model to Experimental Plasma Gun Impact
Open Event - Events, and create this event:
Effect.PlasmaSurgeImpact.Start
create
Make sure the field Host + only contains something like (implicit, implicit, disabled). If there is a _selectable or something, remove it.
New actor, name Plasma Surge Impact Sound, type Sound, based on SoundOneShot
Open Event - Events, and create this event:
Effect.PlasmaSurgeImpact.Start
create
Set Sound - Sound to Battlecruiser_YamatoAttackImpact
New actor, name Plasma Surge, type Action, based on GenericAttack
Set Impact Effect to Plasma Surge Impact and Launch Effect to Plasma Surge Launch
Open Combat - Launch Assets, set the Sound to Firebat_AttackLaunch
New actor, name Plasma Surge Damage, type Action, based on GenericAttack
Set Attack Effect to Plasma Surge Damage
Open Combat - Impact Map,
Set the Model to Experimental Plasma Gun Impact
set the Sound to Raynor_ExperimentalPlasmaGunImpact
Select the TaurenSpaceMarine (unnamed) - Actor
Open Event - Events + and add the following Event:
Abil.PlasmaSurge.SourcePrepStart
AnimPlay Spell Attack
Units
Select the Tauren Space Marine
Open Ability - Abilities +, add Plasma Surge
Open Ability - Command Card +
Add the Plasma Surge - Button to any free spot
Change the Command Type to Ability Command
Set the Ability to Plasma Surge
The Test Map
Everything related to the Plasma Surge is prefixed with "Plasma Surge -", so if you enter this in the search line, you will get only objects related to the Plasma Surge.
Ion Saw
Basics
Again, a great deal of this will look familiar by now.
However, we will need some additional or a little different objects, because we want the missile to return and a specific movement pattern, so we will use a custom mover this time.
Also the missile should be able to hit units multiple times, but not when its just passing through them. It should only be able to cause damage again, when it moved away and hits the unit on the return again.
The only way I know of to realize this, is by using a buff. Unfortunately, this will make the spell not fully Mui, if 2 saws happen to hit a unit at exactly the same time, one of them might not cause damage properly.
Units
Create a new unit called Ion Saw Missile, based on Default Settings (Projectile); click suggest for the id and then ok.
Buttons
Create a new button called Ion Saw.
Change the Icon-field to Assets\Textures\btn-ability-protoss-blackhole-color.dds.
Change Hotkey and Tooltip as you like.
Models
Create a new model called Ion Saw Missile, type Generic and based on MissileFX
Set Model to Assets\Effects\Terran\ArcadeTerraTronMissileSaw.m3
Behaviors
Create a new behavior called Ion Saw Target, type Buff
Set Stats - Duration to 0.125
Set Stats - Flags to Hidden
Movers
Create a new mover called Ion Saw, type Missile
Open Motion Phases +
Add a new motion phase with the following settings:
Driver = Throw
Outro:
Blend At = 1
Stop At = 11
Speed = 15
Throw Vector:
X = -0.8
Y = -1
Z = 0
Tracking = Actual
Add another mothion phase with the following settings:
Driver = Guidance
Orientation:
Yaw = 5500
Pitch = 5500
Roll = 5500
Tracking: = Actual
Effects
Create a new Effect, called Ion Saw Damage, type Damage.
Set the Combat - Amount field to 30.
Set Effect - Death to Eviscerate.
New effect, name Ion Saw Apply, type Apply Behavior
Set Behavior - Behavior to Ion Saw Target
New effect, name Ion Saw Target Check, type Search Area
Open Search - Areas +, add a new entry using Radius: 0.8 and Effect: Ion Saw Apply
Click the Search - Search Filters - field and uncheck Ally and Player. Also set following fields to excluded:
Dead
Hidden
Invulnerable
Item
Missile
Stasis
New effect, name Ion Saw Persistent, type Create Persistent
Open Effect - Flags, check Persist until destroyed
Open Effect - Period Durations, add a new entry 0.0625
Open Effect - Periodic Effects, add a new entry Ion Saw Target Check
Change Target - Location + to Source Unit
New effect, name Ion Saw Destroy Persistent, type Destroy Persistent
Set Effect - Effect to Ion Saw Persistent
Set Target - Location + to Source Unit
New effect, name Ion Saw Launch , type Launch Missile
Set Effect - Finish Effect to Ion Saw Destroy Persistent.
Open Effect - Flags, check Return
Set Effect - Launch Effect to Ion Saw Persistent.
Open Movement - Movers +, add a new entry: Ion Saw
Open Movement - Return Movers +, add a new entry: Ion Saw
Set Target - Impact Location to Target Point
Set Unit - Ammo Unit to Ion Saw Missile
New effect, name Ion Saw Initial, type Create Persistent
Set Effect - Period Count to 1
Open Effect - Period Effects and add Ion Saw Launch
Open Effect - Periodic Offsets and add the following entry:
x = 0 , y =-10, z = 0
Set Target - Location + to Source Point
Behaviors
Select your Ion Saw Target- behavior
Set Effect - Effect - Initial to Ion Saw Damage
Abilities
New ability, name Ion Saw, type Effect - Target
Open Ability - Commands +, select Execute, set the Default Button to Ion Saw
Set Effect - Effect to Ion Saw Initial
Set Stats - Range to 9
Actors
New actor, name Ion Saw Missile, type Missile, based on ->GenericTentacleMissile<-
Set Unit Name to Ion Saw Missile
Set Art - Model to Ion Saw Missile
Set Art - Scale to (0.5,0.5,0.5)
Open Event - Events +
For the Lifetime animation bracket, change the Content from Stand to Stand (Global Loop)
New actor, name Ion Saw, type Action, based on GenericAttack
Set Launch Effect to Ion Saw Launch
Open Attachment - Launch Attachment Query +
Set Methods - Filter Type to Direct
Select Origin from the list
Open Combat - Launch Assets, set the Sound to Obelisk_WarpJumpStart
New actor, name Ion Saw Damage, type Action, based on GenericAttack
Set Attack Effect to Ion Saw Damage
Open Combat - Impact Map,
Set the Model to Raynor Snipe Big Blood Impact
set the Sound to Ultralisk_AttackLaunch
Select the Prison Zealot - Actor
Open Event - Events + and add the following Event:
Abil.IonSaw.SourcePrepStart
AnimPlay Spell Attack, Variation 01
Units
Select the Zealot (Prisoner)
Open Ability - Abilities +, add Ion Saw
Open Ability - Command Card +
Add the Ion Saw - Button to any free spot
Change the Command Type to Ability Command
Set the Ability to Ion Saw
The Test Map
Everything related to the Ion Saw is prefixed with "Ion Saw -", so if you enter this in the search line, you will get only objects related to the Ion Saw.
Q&A
I will include questions and their answers here.
Hey Kueken531. I just read and made two of the abilitys from your tutorial, and i was wondering, if I could use them in my map.
By all means yes. Feel free to use them as you want.
In the damage effect, you do modify this - Set Target - Impact Location to Target Point. But shouldn't it be - Set Target - Impact Location to Source Point. ( source point = missile position ) And how is it working when the fireball explode before the target point ? It damage the right points but isn't the target point = clicked position which would make the wrong damage position if fireball explode before the target point?
Indeed, for the persistent effect, the target point is the clicked point and the source unit is the missile.
However, the persistent is "targeted" on the source unit, so for every effect further linked from the persistent, the target unit will be the former source unit, the missile, and so the target point is the location of the missile. However, the source unit should be carried through, so using source here should, in theory, work just as well.
Thanks for reading this tutorial. I hope some people will benefit from it.
Feedback of any kind is appreciated.
Please let me know, if you notice any mistakes in the tutorial.
Edit: If there was someway (i havent read the tutorial as i have to go somewhere) for you to explain or show how you could make the projectile also detonate when they hit walls using validators and the such? i spent practically the whole day trying to get these validator cliff level things working and i couldnt.
EditL the periodic offsets for the Fireball (initial) are impossible because there is no option to change the z offsets, or is that because i dont have 1.2patch?
huh, i finished the fireball tutorial using only one fireball instead of both L and R on a stalker, yet when the fireball hits a unit, the game crashes.
Edit: The same happens when i try your map. I guess i DO have to reinstall the game and update. fml
oh ok cool it works. hey, do you think you'd be able to make an ability for the ghost that's an instant straight shot snipe that passes through 1 unit doing full damage and then hits 1 more unit doing 50% damage? And maybe when it hits doodads or walls it kills itself?
or just edit one of your spells to collide with doodads and/or terrain wall layers
An instant straight shot would cover another field, since this would not be done using a projectile (similar to Raynor's penetrator round)
I found out, that colliding when hitting a cliff is pretty easy, most likely I will add this for one of the spells in the future. However, I still don't know a way to check for doodad collision. Even if I do, it will be hard to determine, when to collide and when not to.
The Z offset was indeed introduced with 1.2 and I think it looks a little better, if the fireballs don't just hit the ground. Pre- 1.2, you can use actor site operations to raise the impact for the actor visually.
Well, it could still be a projectile. I could just make the projectile really fast. If you could...i'd like the cliff validator thing :D i need it for my map. :P
Really fast projectiles should be avoided, because of the 0.0625 max interval for persistent effects. The faster the projectile, the more likely it will pass through units without actually colliding with them, due to the method of the periodic search effects.
Ive tried it on my own, and think I understood at least a bit of how these actors, abilities, effects and units are tied together.
So I build the fireball stuff, and attach it to a duplicated Thor.
I load my map, and when fire my fireball SC2 crashes.
When I try your map it works.
So I made screenshots of your data editor fields and compared them to mine, and except for disabled sound and different model it appears to me as it is the same. Oh and I only fire 1 fireball not 2 of em.
When I cast the fireball, my Thor turns around, or moves in position and in the instant the fireball should be appearing it just crashes.
I have no idea why.
Maybe someone has an idea?
Ive attached the map for any friendly helpers!
I downloaded your map, and I changed the AnimationPlay from "Attack Spell" to only "Spell" (thanks for this hint btw, I should formulate this part more exactly, I want the animation name to be "Spell" and the used animation to be "Attack", not "Attack Spell"), then started the map. Nothing crashed. Then I changed it back, no crash again. Then I re-downloaded the map, tried it and it crashed :D. Because I only did one change and then re-changed it, nothing was different theoretically, but one time it crashed, the other it didn't.
No idea what blizzard actually messed up with the actors, but just try changing the animation and see, if it works after that.
BTW you forgot the periodic offset for the initial persistant, so the missile does not work.
My missile always travels just a few meters and then explodes (if it doesnt hit an enemy on its way).
I changed the Lifetime of the fireball actor to 2.0 but it didnt change.
I changed the ability stats range to maximum (500) now my caster unit doesnt walk towards the target point any more (as desired).
And second issue:
I have set a doodad wall, and I would like the projectile to collide with that wall too (without exploding), which it doesnt, it just ignores it and goes through.
The missile's target point is the offset point you specified for the initial persistent. If you want to extend the range, choose a bigger offset. If you want it to travel indefinitely, change the used mover's target checking to never.
I have no idea, how to check for doodad collision right now, but I did not really try it. If I find a way to do this, I will probably adapt the tutorial.
If doodads are not usable is there any invisible wall, which I can use as collision object?
How do I allow only 1 shot at a time (meaning, as long as there is still a projectile present no other shooting is allowed)?
I mean I could probably use a trigger, I would think its possible in the data editor as well.
For an invisible unit, just create a new unit and give it the model "Invisible". You can choose a different model - editor for it, so in the editor it is not invisible.
For 1 shot at a time, you could add a requirement to the ability similar to the Train Mothership requirement, which does not allow casting of the ability as long as a fireball missile unit is on the map for the player, or you add a map-wide search effect when you cast the ability, which destroys all fireballs of the player.
This tutorial teaches you, how to create basic colliding projectiles with the data editor. We will handle the kill credit correctly and use different target options (like explode on contact or pierce through targets).
Doodad/cliff collision will not be part of this tutorial, but maybe added in the future.
For demonstrating colliding projectiles, we will create 3 different abilities.
The first ability will be a recreation of a Diablo 2 - style Fireball.
The second ability will be some kind of piercing projectile, which collides with units, but does not get destroyed in the process and cannot hit units multiple times.
The third ability will be some kind of boomerang ability, which does the same thing, but returns to the caster and can hit targets multiple times.
General things:
Fireball
Most of you might already know this ability, however, I want to explain shortly, what it does:
The caster releases a fast-moving projectile, which collides with the first unit in its way. It explodes and deals damage in an area around the impact location.
We will use the firebat as the caster unit for this spell, and since the firebat has 2 arms he raises with his animations and a single fireball is boring anyways, we will make him shoot 2 fireballs.
Also, unlike in Diablo 2, we will implement a maximum range for the fireball, when it reaches this, it will simply explode.
The final result should look something like this:
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/lr_zoklJZE0?fs=1&amp;hd=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lr_zoklJZE0?fs=1&amp;hd=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
Plasma Surge
This ability should do the following:
The caster releases a projectile, which collides with any enemy unit in its path, dealing damage to them. It does not get destroyed until reaching its destination.
For the sake of variety, another unit will cast this ability, lets take a Tauren Marine ;)
This ability would look similar to this:
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/T-hr0GdurZ4?fs=1&amp;hd=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/T-hr0GdurZ4&amp;hd=1?fs=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
Ion Saw
A boomerang - like ability. The saw curves towards a target point and travels back to the caster.
The saw damages everything in its path and should be able to hit units multiple times.
However, it should not hit units multiple times just when passing through them, only, if it hits the units again.
This will be casted by a Prisoner Zealot.
Like this:
<object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/9OhplFhhyZM?fs=1&amp;hd=1&amp;hl=de_DE"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9OhplFhhyZM&amp;hd=1?fs=1&amp;hl=de_DE" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"></embed></object>
Step by Step Tutorials:
These are detailed instructions for exact recreations of the abilities demonstrated in the video and present in the attached test map.
The first paragraph for all 3 spells contains some basic information, why we are creating the spell the way we do it. It is not needed for the step by step instruction, but might be very helpful, if you do not want to use exact recreations of the spell, but similar ones.
If you are not interested and just want to recreate the spells, you can skip the "Basics" - paragraphs.
Fireball
Basics
We will create a missile, which travels to a point, as usual with a launch missile effect and an impact effect.
For the collision functionality, we will use a persistent effect, which periodically runs a search area at the missile's location.
We will use the missile's Launch Effect - field for this, which starts an effect, when the missile is launched.
For this effect, the caster will be the unit casting the ability and the source will be the missile. This is very useful,this way we have direct access to the missile without having to use a behavior.
There are 2 possibilities to remove the persistent: Either the persistent runs indefinitely, and we use an explicit Destroy Persistent effect to get rid of it, or we simply use a periodic count for the persistent, so the persistent will be finished, after the missile reached the maximum travel distance.
The 2nd possibility works, but since the missile can be destroyed prematurely, the persistent would still try to check for collision for a while, so I prefer an explicit destruction, it "feels" more correct.
Because of this, we can deal the damage directly with the persistant effect, the caster will still be the original unit and never the missile, so kill credit will be automatically correct.
Units
Create a new unit called Fireball Missile, based on Default Settings (Projectile); click suggest for the id and then ok.
Buttons
Create a new button called Fireball.
Effects
Create a new Effect, called Fireball Damage, type Damage.
Click the Search - Area + - field and add 3 regions:
Click the Search - Search Filters - field and uncheck Ally and Player. Also set following fields to excluded:
New effect, name Fireball Impact, type Set.
New effect, name Fireball Target Check, type Search Area
New effect, name Fireball Persistent, type Create Persistent
New effect, name Fireball Destroy Persistent, type Destroy Persistent
Go to your Fireball Impact - effect and add Fireball Destroy Persistent to the list of effects.
New effect, name Fireball Launch R, type Launch Missile
Copy the last created effect, rename it to Fireball Launch L, click suggest.
New effect, name Fireball Initial, type Create Persistent
Abilities
New ability, name Fireball, type Effect - Target
Actors
New actor, name Fireball Missile, type Missile, based on GenericAttackMissile
New actor, name Fireball Impact, type Model, based on ModelAnimationStyleOneShot
New actor, name Fireball Impact Sound, type Sound, based on SoundOneShot
New actor, name Fireball R, type Action, based on GenericAttack
Copy the last created actor, rename it to Fireball L, click suggest
Select the Firebat - Actor
Units
Select the Firebat
For some visual enhancements, you can play around a little, for example add a prepare and finish time to the spell.
The Test Map
Everything related to the Fireball is prefixed with "Fireball -", so if you enter this in the search line, you will get only objects related to the fireball.
Plasma Surge
Basics
Most of the stuff is very similar to the Fireball, except we will not destroy the missile on the first impact.
This means, of course, we will need a way to not affect units multiple times, otherwise units, especially huge ones, might take massive amounts of damage, as the surge travels through them.
Fortunately we are using a persistent effect, so we can easily incorporate markers for this task.
Also, I will not use a Destroy Persistent here, since the missile always travels the full duration. Still, its not that exact, but fine, I guess.
Units
Create a new unit called Plasma Surge Missile, based on Default Settings (Projectile); click suggest for the id and then ok.
Buttons
Create a new button called Plasma Surge.
Effects
Create a new Effect, called Plasma Surge Damage, type Damage.
New effect, name Plasma Surge Impact, type Set.
New effect, name Plasma Surge Target Check, type Search Area
New effect, name Plasma Surge Persistent, type Create Persistent
New effect, name Plasma Surge Launch , type Launch Missile
New effect, name Plasma Surge Initial, type Create Persistent
Abilities
New ability, name Plasma Surge, type Effect - Target
Actors
New actor, name Plasma Surge Missile, type Missile, based on GenericAttackMissile
New actor, name Plasma Surge Impact, type Model, based on ModelAnimationStyleOneShot
New actor, name Plasma Surge Impact Sound, type Sound, based on SoundOneShot
New actor, name Plasma Surge, type Action, based on GenericAttack
New actor, name Plasma Surge Damage, type Action, based on GenericAttack
Select the TaurenSpaceMarine (unnamed) - Actor
Units
Select the Tauren Space Marine
The Test Map
Everything related to the Plasma Surge is prefixed with "Plasma Surge -", so if you enter this in the search line, you will get only objects related to the Plasma Surge.
Ion Saw
Basics
Again, a great deal of this will look familiar by now.
However, we will need some additional or a little different objects, because we want the missile to return and a specific movement pattern, so we will use a custom mover this time.
Also the missile should be able to hit units multiple times, but not when its just passing through them. It should only be able to cause damage again, when it moved away and hits the unit on the return again.
The only way I know of to realize this, is by using a buff. Unfortunately, this will make the spell not fully Mui, if 2 saws happen to hit a unit at exactly the same time, one of them might not cause damage properly.
Units
Create a new unit called Ion Saw Missile, based on Default Settings (Projectile); click suggest for the id and then ok.
Buttons
Create a new button called Ion Saw.
Models
Create a new model called Ion Saw Missile, type Generic and based on MissileFX
Behaviors
Create a new behavior called Ion Saw Target, type Buff
Movers
Create a new mover called Ion Saw, type Missile
Effects
Create a new Effect, called Ion Saw Damage, type Damage.
New effect, name Ion Saw Apply, type Apply Behavior
New effect, name Ion Saw Target Check, type Search Area
New effect, name Ion Saw Persistent, type Create Persistent
New effect, name Ion Saw Destroy Persistent, type Destroy Persistent
New effect, name Ion Saw Launch , type Launch Missile
New effect, name Ion Saw Initial, type Create Persistent
Behaviors
Select your Ion Saw Target- behavior
Abilities
New ability, name Ion Saw, type Effect - Target
Actors
New actor, name Ion Saw Missile, type Missile, based on -> GenericTentacleMissile<-
New actor, name Ion Saw, type Action, based on GenericAttack
New actor, name Ion Saw Damage, type Action, based on GenericAttack
Select the Prison Zealot - Actor
Units
Select the Zealot (Prisoner)
The Test Map
Everything related to the Ion Saw is prefixed with "Ion Saw -", so if you enter this in the search line, you will get only objects related to the Ion Saw.
Q&A
I will include questions and their answers here.
By all means yes. Feel free to use them as you want.
Indeed, for the persistent effect, the target point is the clicked point and the source unit is the missile.
However, the persistent is "targeted" on the source unit, so for every effect further linked from the persistent, the target unit will be the former source unit, the missile, and so the target point is the location of the missile. However, the source unit should be carried through, so using source here should, in theory, work just as well.
Thanks for reading this tutorial. I hope some people will benefit from it.
Feedback of any kind is appreciated.
Please let me know, if you notice any mistakes in the tutorial.
@Kueken531: Go
dude thank you so much for doing this. About time someone did this.
The tutorial is now finished. Thanks to Abion47 for his help with the hidden text.
@Kueken531: Go
Looks very nice. Much better structure than a lot of tutorials nowadays. Glad to be of service.
I think i want somebodies babies..
badly
Edit: If there was someway (i havent read the tutorial as i have to go somewhere) for you to explain or show how you could make the projectile also detonate when they hit walls using validators and the such? i spent practically the whole day trying to get these validator cliff level things working and i couldnt.
Cheers
@RageQit: Go
when i try to download the map it comes up to this weird ass webpage with crazy characters O_o
@ResolveHK: Go
right click save as
EditL the periodic offsets for the Fireball (initial) are impossible because there is no option to change the z offsets, or is that because i dont have 1.2patch?
huh, i finished the fireball tutorial using only one fireball instead of both L and R on a stalker, yet when the fireball hits a unit, the game crashes.
Edit: The same happens when i try your map. I guess i DO have to reinstall the game and update. fml
oh ok cool it works. hey, do you think you'd be able to make an ability for the ghost that's an instant straight shot snipe that passes through 1 unit doing full damage and then hits 1 more unit doing 50% damage? And maybe when it hits doodads or walls it kills itself?
or just edit one of your spells to collide with doodads and/or terrain wall layers
@ResolveHK: Go
An instant straight shot would cover another field, since this would not be done using a projectile (similar to Raynor's penetrator round)
I found out, that colliding when hitting a cliff is pretty easy, most likely I will add this for one of the spells in the future. However, I still don't know a way to check for doodad collision. Even if I do, it will be hard to determine, when to collide and when not to.
@RageQit: Go
The Z offset was indeed introduced with 1.2 and I think it looks a little better, if the fireballs don't just hit the ground. Pre- 1.2, you can use actor site operations to raise the impact for the actor visually.
@Kueken531: Go
Well, it could still be a projectile. I could just make the projectile really fast. If you could...i'd like the cliff validator thing :D i need it for my map. :P
@ResolveHK: Go
Really fast projectiles should be avoided, because of the 0.0625 max interval for persistent effects. The faster the projectile, the more likely it will pass through units without actually colliding with them, due to the method of the periodic search effects.
I will add the cliff validator soon, I think.
@Kueken531: Go
Ah, true. Didn't think of that.
Ok, i could use them greatly :D
Hi Kueken531,
thank you very much for that tutorial.
Ive tried it on my own, and think I understood at least a bit of how these actors, abilities, effects and units are tied together.
So I build the fireball stuff, and attach it to a duplicated Thor. I load my map, and when fire my fireball SC2 crashes.
When I try your map it works. So I made screenshots of your data editor fields and compared them to mine, and except for disabled sound and different model it appears to me as it is the same. Oh and I only fire 1 fireball not 2 of em.
When I cast the fireball, my Thor turns around, or moves in position and in the instant the fireball should be appearing it just crashes.
I have no idea why.
Maybe someone has an idea? Ive attached the map for any friendly helpers!
I downloaded your map, and I changed the AnimationPlay from "Attack Spell" to only "Spell" (thanks for this hint btw, I should formulate this part more exactly, I want the animation name to be "Spell" and the used animation to be "Attack", not "Attack Spell"), then started the map. Nothing crashed. Then I changed it back, no crash again. Then I re-downloaded the map, tried it and it crashed :D. Because I only did one change and then re-changed it, nothing was different theoretically, but one time it crashed, the other it didn't.
No idea what blizzard actually messed up with the actors, but just try changing the animation and see, if it works after that.
BTW you forgot the periodic offset for the initial persistant, so the missile does not work.
Thank you so much, both for the great help and the very fast reply.
It really fixed my issue, thanks alot!
If I ever publish my custom map I will put you in the credits for this nice Fireball!
Ok next issue^^
My missile always travels just a few meters and then explodes (if it doesnt hit an enemy on its way).
I changed the Lifetime of the fireball actor to 2.0 but it didnt change.
I changed the ability stats range to maximum (500) now my caster unit doesnt walk towards the target point any more (as desired).
And second issue: I have set a doodad wall, and I would like the projectile to collide with that wall too (without exploding), which it doesnt, it just ignores it and goes through.
The missile's target point is the offset point you specified for the initial persistent. If you want to extend the range, choose a bigger offset. If you want it to travel indefinitely, change the used mover's target checking to never.
I have no idea, how to check for doodad collision right now, but I did not really try it. If I find a way to do this, I will probably adapt the tutorial.
Ahh, thanks. The offset worked.
If doodads are not usable is there any invisible wall, which I can use as collision object?
How do I allow only 1 shot at a time (meaning, as long as there is still a projectile present no other shooting is allowed)? I mean I could probably use a trigger, I would think its possible in the data editor as well.
For an invisible unit, just create a new unit and give it the model "Invisible". You can choose a different model - editor for it, so in the editor it is not invisible.
For 1 shot at a time, you could add a requirement to the ability similar to the Train Mothership requirement, which does not allow casting of the ability as long as a fireball missile unit is on the map for the player, or you add a map-wide search effect when you cast the ability, which destroys all fireballs of the player.