There was a request on another thread to allow any unit to create a series of afterimages similar to the Protoss High Templar. With permission from ProzaicMuze to use bits and pieces from his first write up I have written up this tutorial to show how I did it. I'm going to try and explain as much as possible including the simple theory behind how everything works so anyone can tweak it, modify it and learn from it like I did.
The Examples
The Theory
So you've all seen how a High Templar moves around creating those fading afterimages wherever he goes. For him it's easy since he has a custom model for his shadow, but what we're gonna do is almost that easy. We start by making a new model actor and set it to be whatever unit we want, we'll call it UnitShadow for simplicity sake. The next thing we want to do is make sure when this model is activated it starts wherever our unit is at and is facing the right direction so we'll add those features into the Site Operations value. Next we want to add a few events to this model, three of the events are activated when the model is created, it sets the Tint, Opacity and Duration of the model, this is used to give us our fading. The next event is used to destroy the model when the animation has finished fading out the unit.
Now we want to edit our actual unit model so that when the unit moves the afterimages are created. Under the Events section of your unit we add a few new events that may look complicated (at least they did to me at first), but they can be broken down to their most basic form. When the unit is first created we set two variables up, a timer called ShadowTimer and a status called ShadowCreate. I'll explain the status first, think of it simply as True or False, 1 and 0. When we first create the unit it shouldn't be moving (in the first millisecond of the unit being created, so we set it to 0 or False. Now when our unit starts to move we change this status to True or 1. When it stops moving we change it back to False or 0. That timer we created is going to be set to 2/10ths of a second when the unit is first created and is going to count down to 0. When it reaches 0 it's going to check for our status we created, if ShadowCreate is True (or 1) then we create our afterimage, but if it is set to False (or 0) then we don't. After all of this we reset our timer back to 2/10ths of a second and it counts down again, and when it hits 0 it runs that same statement over and over indefinitely.
Might seem complicated, but its not too bad.
The How
I said it before and I want to make sure to say it again, most of this is based off or copied from ProzaicMuze's original idea, I did copy it with permission and then expanded on it.
Open up the Actors tab and right click anywhere on the list and click on Add Object...
Change Name to ZerglingShadow - Change Zergling to whatever the name of the Unit you're using will be ex: Carrier or Zergling
Hit the Suggest button and it will probably set it to ZerglingShadow
Change Actor Type to Model
Change Based On to Model Animation Style One Shot
Click OK
Change the Art - Model to match whatever unit you are using, ex: Zergling
Double-Click on Hosting - Host + and change the Subject at the bottom to _Unit
Click OK
Double-Click on Hosting - Host Site Operations + and check both the Hold Position and Hold Rotation.
Click the Add Value... button and change the dropdown at the bottom to SOpAttachOrigin
Click OK
Double-Click on Properties - Inherited Properties and put a check in Cloak Effect, Team Color and Visibility
This is our Afterimage Model, really the most important things you want from this are the Host + and Host Site Operations + values to be set correctly. This is what sets where our image is created and the facing of the afterimage.
Actor - Events for our newly created ZerglingShadow
Double-Click on Event - Events +
Right-Click and click Add Event for each of the following:
Actor Creation > Animation Play
Name: ShadowAnimation
Animation Properties: Stand
Time Variant: 1.0000
Time Type: Duration
Actor Creation > SetTintColor
Color: (whatever you want)
Blend In Duration: 1.0000
Actor Creation > Set Opacity
Opacity: 0.0000
Blend In Duration: 1.0000
Animation Done
Destroy
Actor - Events for the actual Zergling Unit
Double-Click on Event - Events +
Right-Click and click Add Event for each of the following:
Actor Creation > TimerSet
Duration: 0.2000
Name: ShadowTimer
Actor Creation > StatusSet
Name: ShadowCreate
Value: 0
UnitMovementUpdate.*.Stand > StatusSet
Name: ShadowCreate
Value: 0
UnitMovementUpdate.*.Walk > StatusSet
Name: ShadowCreate
Value: 1
TimerExpired
=> TimerName ShadowTimer
TimerSet Duration: 0.200000 - Name: ShadowTimer
TimerExpired
=> TimerName - Name: ShadowTimer
=> IsStatus - Name: ShadowCreate - Value: 1
Create ZerglingShadow or whatever you used as the Actor name earlier
The Bugs
I have only found a few bugs in the way this works, if you add the effect onto a unit that can cloak such as a Spectre or Ghost it can cause some unexpected errors. If your unit is moving and then cloaks, the afterimages will show the cloaking effect even when they are supposed to have disappeared. You can see an example of this in the Spectre video that I first did. If anyone has a suggestion I am more then willing to try it.
The second thing is on slower units like the Thor or Carrier in the second example do not create a long trail of after images due to the units being so large. I haven't played around with the length of the trail and duration much, I'm sure with a little bit of tweaking it can be made to work great.
this is a great tutorial but i dont understand where to enter the Unit Events part of the code..
is it still in the Actors part which was created at the beginning or at the unit you are trying to make the shadow of.. and if its the unit there is no Event - Events + part in the unit
edit: nvm i figured it out.. once again great tut!
I was just playing around with some units from campaign and I thought of something. Couldn't you just give the units the effect of the Void Seeker when it is in it's fast mode(I forget name of ability) as a buff? I'm still new to the editor so I'm not sure if this will give the wanted result. It might just make the Void Seeker behind the unit but I think it's worth a shot.
You're much better off scripting this. Not only can a single script create trails for every unit in the game (as opposed to editing each unit individually), but you can easily animate them as well.
A few typos that conflict with your screenshot:
• initial timer should be set to .2
• At the end of TimerExpired with the condition, it creates a new actor instead of restarting the timer.
edit: oops, didn't realize when you said Unit's events, you were referring to events in the unit's actor.
What I'd like to be able to do to make it more portable is have the Timer events, currently in the Unit's Events+ be in a separate Events Macro. Then to add this shadow to a new unit or ability, it would just be a matter of duplicating and modifying this macro along with the shadow actor.
I'm not sure what's going wrong with my attempt at that, but I suspect it's something to do with hosting, of which my knowledge is very shakey. If anyone knows what would be required to make that work, let me know.
To everyone sorry about the typos, I went back and fixed a few of them such as the timer with the wrong number and then the conflicting item there where I had TimerSet twice instead of TimerSet and Create. Whoops ... I also tried to be a little more specific with the Event's headers I had to specify which one we are actually editing, the Shadow Actor or the Unit Actor. I hope that makes more sense
@unicassiel: I was mostly just doing this for a single unit effect, you're right scripts could be easier to setup if you are trying to do this for a lot of units. Just for one or two I don't think its too bad myself. The original idea posted was to have this effect be created by a persistent buff ability, so I'm sure you could script that to just change your model of whatever unit you are using the spell on.
@YiffMaster: I'm still playing around with the Hosting myself so I'm afraid I won't be of much help for that yet, sorry
@uncassiel: Go I'd love a dynamic solution that could work for any unit. Any idea how that was done in the video?
Yeah, but I no longer have the code thanks to the wonderful beta uninstaller deleting everything. In short, you use a loop with a 0.0 wait (which actually waits for 0.03125. It's still not great, but it's better than the 0.0625 minimum for timers). On each trip through the loop, you create one or more copies of the unit (or just the unit's model) and send actor messages to control the animation and vertex coloring. From here you can do a lot of different things with the images, depending on the effect you're after.
If you want to remove the shadow open up the Data Editor and click on the Actor's tab Find the High Templar in the list and bring it up. Click on Event - Events + and search the Event list for Timer Expired toward the bottom. If you want a quick and dirty way to do it simply remove the one that has the IsStatus ShadowCreate 1 inside of it, if you want to completely remove all references in the picture below in the red box.
On a separate note there was a question asked on the tutorial request forum to be able to create a fire trail on a Firebat unit. By using the same method it is possible to create a trail of any model you'd like, fire, energy, etc. I'm sure you could even create a creep trail.
If you follow the instructions for the tutorial simply bring up the ZerglingShadow actor in the Data Editor and find the Model value. Change this to whatever you want, like Fire Medium for example. This allows your unit to create a nice fire trail. Doing this I also changed the Blend In Duration on both the SetTintColor and Set Opacity to 5.0000. This makes the trail last longer
hi,
sorry for asking, but i cant find the hosting - host things at data..
i think its because the fullversion editor is another than the beta editor ( i know you know that.. )
i hope somebody can help me..
sorry for bad english, not main speak
greetz
Quick questions that im sure others would be interested in, How would you go about modifying this so that it only appears when a buff is placed on the said unit. This would be great for my "Scout" class's speed boost, when he has that buff activated, having the trail behind would be a super effect.
Rollback Post to RevisionRollBack
Random Information
Tutorials - Map Development - Galaxy wiki
|Issues? PM me|
@mangakac: If you bring up the Actors tab in the Data Editor and select your UnitShadow actor in the middle there should be a section for Hosting. Depending on what options you have set in your Data Editor for views and such it may look different then the screen shot here.
@Molsterr: Its funny you should ask that I was working with someone else to only allow the animation to be used when the unit was preforming a reaper jump, i ended up removing a few events and adding a few more.
Bring up the "Scout" unit under the Actors tab and then bring up the Event - Events+
Here is a picture of what this screen looked like after I made the changes. I haven't tested this, but in theory it should work. I set this on a Reaper unit and just made the ability the Yamato Cannon, which he doesn't have, but it doesn't really matter. This is a pretty crappy ability to use as an example since the unit never moves when firing the cannon, it was just the first one I picked from the list.
Just as a minor side note, the Abil is Ability
I hope that helps, if you need further explanation or any other help just shout here or PM me
EDIT: Just as another refrence for anyone who wants to see it, here are the settings I used for when the unit (Hellbender) does a Reaper Jump, this is the only time you see the afterimage trail on the unit, and for this unit its not even a clone, its just a trail of fire.
For your "Scout" speed buff you could also set it similar to the image directly above using the Behavior instead of the Ability itself. This would apply if say the unit could cast this buff on another, like your "Scout" is buffing your "Soldier" or whatever with this speed buff. You would just want to make it Behavior.SpeedBuff.On and Behavior.SpeedBuff.Off (I am only assuming these are the two you use, I can play around with it tonight if it doesn't work)
That looks perfect! thank you VERY much for your reply. Ill be trying to add this tonight.
if after I get a headache from not being able to do it, ill be sure to send you a pm =P hehe. but it looks like a simple update, thanks again!
IT WORKS, first try, Your going in the credits for this. The scout was just lacking all over... this effect added to its main ability just makes it look great!
Yeah, but I no longer have the code thanks to the wonderful beta uninstaller deleting everything. In short, you use a loop with a 0.0 wait (which actually waits for 0.03125. It's still not great, but it's better than the 0.0625 minimum for timers). On each trip through the loop, you create one or more copies of the unit (or just the unit's model) and send actor messages to control the animation and vertex coloring. From here you can do a lot of different things with the images, depending on the effect you're after.
Hey, how do you turn off the unit collision? Btw there is the high templar effect on units if you use its behavior. =D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
There was a request on another thread to allow any unit to create a series of afterimages similar to the Protoss High Templar. With permission from ProzaicMuze to use bits and pieces from his first write up I have written up this tutorial to show how I did it. I'm going to try and explain as much as possible including the simple theory behind how everything works so anyone can tweak it, modify it and learn from it like I did.
The Examples
The Theory
So you've all seen how a High Templar moves around creating those fading afterimages wherever he goes. For him it's easy since he has a custom model for his shadow, but what we're gonna do is almost that easy. We start by making a new model actor and set it to be whatever unit we want, we'll call it UnitShadow for simplicity sake. The next thing we want to do is make sure when this model is activated it starts wherever our unit is at and is facing the right direction so we'll add those features into the Site Operations value. Next we want to add a few events to this model, three of the events are activated when the model is created, it sets the Tint, Opacity and Duration of the model, this is used to give us our fading. The next event is used to destroy the model when the animation has finished fading out the unit.
Now we want to edit our actual unit model so that when the unit moves the afterimages are created. Under the Events section of your unit we add a few new events that may look complicated (at least they did to me at first), but they can be broken down to their most basic form. When the unit is first created we set two variables up, a timer called ShadowTimer and a status called ShadowCreate. I'll explain the status first, think of it simply as True or False, 1 and 0. When we first create the unit it shouldn't be moving (in the first millisecond of the unit being created, so we set it to 0 or False. Now when our unit starts to move we change this status to True or 1. When it stops moving we change it back to False or 0. That timer we created is going to be set to 2/10ths of a second when the unit is first created and is going to count down to 0. When it reaches 0 it's going to check for our status we created, if ShadowCreate is True (or 1) then we create our afterimage, but if it is set to False (or 0) then we don't. After all of this we reset our timer back to 2/10ths of a second and it counts down again, and when it hits 0 it runs that same statement over and over indefinitely.
Might seem complicated, but its not too bad.
The How
I said it before and I want to make sure to say it again, most of this is based off or copied from ProzaicMuze's original idea, I did copy it with permission and then expanded on it.
Open up the Actors tab and right click anywhere on the list and click on Add Object...
This is our Afterimage Model, really the most important things you want from this are the Host + and Host Site Operations + values to be set correctly. This is what sets where our image is created and the facing of the afterimage.
Actor - Events for our newly created ZerglingShadow
Actor - Events for the actual Zergling Unit
The Bugs
I have only found a few bugs in the way this works, if you add the effect onto a unit that can cloak such as a Spectre or Ghost it can cause some unexpected errors. If your unit is moving and then cloaks, the afterimages will show the cloaking effect even when they are supposed to have disappeared. You can see an example of this in the Spectre video that I first did. If anyone has a suggestion I am more then willing to try it.
The second thing is on slower units like the Thor or Carrier in the second example do not create a long trail of after images due to the units being so large. I haven't played around with the length of the trail and duration much, I'm sure with a little bit of tweaking it can be made to work great.
Somebody has to have a video on ultra in HD.
this is a great tutorial but i dont understand where to enter the Unit Events part of the code.. is it still in the Actors part which was created at the beginning or at the unit you are trying to make the shadow of.. and if its the unit there is no Event - Events + part in the unit
edit: nvm i figured it out.. once again great tut!
I was just playing around with some units from campaign and I thought of something. Couldn't you just give the units the effect of the Void Seeker when it is in it's fast mode(I forget name of ability) as a buff? I'm still new to the editor so I'm not sure if this will give the wanted result. It might just make the Void Seeker behind the unit but I think it's worth a shot.
You're much better off scripting this. Not only can a single script create trails for every unit in the game (as opposed to editing each unit individually), but you can easily animate them as well.
Hey, thanks for the walkthrough.
A few typos that conflict with your screenshot:
• initial timer should be set to .2
• At the end of TimerExpired with the condition, it creates a new actor instead of restarting the timer.
edit: oops, didn't realize when you said Unit's events, you were referring to events in the unit's actor.
What I'd like to be able to do to make it more portable is have the Timer events, currently in the Unit's Events+ be in a separate Events Macro. Then to add this shadow to a new unit or ability, it would just be a matter of duplicating and modifying this macro along with the shadow actor.
I'm not sure what's going wrong with my attempt at that, but I suspect it's something to do with hosting, of which my knowledge is very shakey. If anyone knows what would be required to make that work, let me know.
@uncassiel: Go I'd love a dynamic solution that could work for any unit. Any idea how that was done in the video?
To everyone sorry about the typos, I went back and fixed a few of them such as the timer with the wrong number and then the conflicting item there where I had TimerSet twice instead of TimerSet and Create. Whoops ... I also tried to be a little more specific with the Event's headers I had to specify which one we are actually editing, the Shadow Actor or the Unit Actor. I hope that makes more sense
@unicassiel: I was mostly just doing this for a single unit effect, you're right scripts could be easier to setup if you are trying to do this for a lot of units. Just for one or two I don't think its too bad myself. The original idea posted was to have this effect be created by a persistent buff ability, so I'm sure you could script that to just change your model of whatever unit you are using the spell on.
@YiffMaster: I'm still playing around with the Hosting myself so I'm afraid I won't be of much help for that yet, sorry
Yeah, but I no longer have the code thanks to the wonderful beta uninstaller deleting everything. In short, you use a loop with a 0.0 wait (which actually waits for 0.03125. It's still not great, but it's better than the 0.0625 minimum for timers). On each trip through the loop, you create one or more copies of the unit (or just the unit's model) and send actor messages to control the animation and vertex coloring. From here you can do a lot of different things with the images, depending on the effect you're after.
Then which steps are necessary to remove the afterimage of the ht?
If you want to remove the shadow open up the Data Editor and click on the Actor's tab Find the High Templar in the list and bring it up. Click on Event - Events + and search the Event list for Timer Expired toward the bottom. If you want a quick and dirty way to do it simply remove the one that has the IsStatus ShadowCreate 1 inside of it, if you want to completely remove all references in the picture below in the red box.
On a separate note there was a question asked on the tutorial request forum to be able to create a fire trail on a Firebat unit. By using the same method it is possible to create a trail of any model you'd like, fire, energy, etc. I'm sure you could even create a creep trail.
If you follow the instructions for the tutorial simply bring up the ZerglingShadow actor in the Data Editor and find the Model value. Change this to whatever you want, like Fire Medium for example. This allows your unit to create a nice fire trail. Doing this I also changed the Blend In Duration on both the SetTintColor and Set Opacity to 5.0000. This makes the trail last longer
hi, sorry for asking, but i cant find the hosting - host things at data.. i think its because the fullversion editor is another than the beta editor ( i know you know that.. ) i hope somebody can help me.. sorry for bad english, not main speak greetz
Quick questions that im sure others would be interested in, How would you go about modifying this so that it only appears when a buff is placed on the said unit. This would be great for my "Scout" class's speed boost, when he has that buff activated, having the trail behind would be a super effect.
@mangakac: If you bring up the Actors tab in the Data Editor and select your UnitShadow actor in the middle there should be a section for Hosting. Depending on what options you have set in your Data Editor for views and such it may look different then the screen shot here.
@Molsterr: Its funny you should ask that I was working with someone else to only allow the animation to be used when the unit was preforming a reaper jump, i ended up removing a few events and adding a few more.
Just as a minor side note, the Abil is Ability
I hope that helps, if you need further explanation or any other help just shout here or PM me
EDIT: Just as another refrence for anyone who wants to see it, here are the settings I used for when the unit (Hellbender) does a Reaper Jump, this is the only time you see the afterimage trail on the unit, and for this unit its not even a clone, its just a trail of fire.
For your "Scout" speed buff you could also set it similar to the image directly above using the Behavior instead of the Ability itself. This would apply if say the unit could cast this buff on another, like your "Scout" is buffing your "Soldier" or whatever with this speed buff. You would just want to make it Behavior.SpeedBuff.On and Behavior.SpeedBuff.Off (I am only assuming these are the two you use, I can play around with it tonight if it doesn't work)
That looks perfect! thank you VERY much for your reply. Ill be trying to add this tonight.
if after I get a headache from not being able to do it, ill be sure to send you a pm =P hehe. but it looks like a simple update, thanks again!
IT WORKS, first try, Your going in the credits for this. The scout was just lacking all over... this effect added to its main ability just makes it look great!
Hey, how do you turn off the unit collision? Btw there is the high templar effect on units if you use its behavior. =D