In the map I'm working on, Sniper Wars, I currently have a 0.0 recurring trigger running to move my missiles and deal damage. I want to make my map run faster, so I'm looking to get rid of this trigger and create the missile in the data editor. I've been staring at and messing with this data editor for two days now, and I can't figure out how to do what I want to do:
Create a missile at the unit that travels in the direction the unit cast the ability
Travel the same distance regardless of how far away the user clicked. ie, The player clicks directly in front of himself but it continues moving the full 30 meters
Deal damage when it collides with a unit, but continue moving for the full 30 meters
Only deal damage to each unit once
I have looked through other unit abilities and have tried just about everything I can think of, and I'm pulling my hair out trying to get what I would consider a simple effect to work. I created this effect in under 30 minutes in triggers. Are there any data gurus out there who can achieve this effect? If not, I'm probably just going to abandon the data editor and stick with the trigger. It might lag, but at least it works...
I suggest you take a look at this map: http:www.sc2mapster.com/maps/big-blue/, it features a nice missile setup that should get you started.
Thanks for the link, but the missiles in this game explode on contact. I have no problem setting up a missile that travels forward and explodes on impact. I am having trouble setting up a missile matching the conditions I stated in my original post.
ive done something like this, i take it you want the missile or 'bulelt' to move fast, probably very fast, that is the trick
1) make a basic 'launch missile effect'
2) give the missile unit a 'behavior' with -1 duration and .1 or .01 recurring time
3) make behavior do a search
4) add a dmg effect to the search
viola
now, if you are having it as a simple 'bullet' that goes REALLY fast then youll need to do some 'fun' things to make it so it wont 'skip' over any units and still the radius of the search from the missile isnt so wide where it still seems really accurate, to do this;
3)on the missile, dont make it do a search, but a persistent (say like 3 to 5 de[pending on how fast you bullet moves / big the search radius for dmg is)
4)the search from each persistent on the bullet must do a 'set' not just a 'dmg'
5)make a 'buff' to apply to a unit so it wont dmg it in more than one persistent
6)in the search from the persistent on the bullet make it apply the 'bummy buff' for .01 duration (just long enough to fool the other searchs ran from the persistant, and make it validate that it only applys the 'set' from the search if it validates the unit doesnt have the buff
that should be it
it will in essence search an area from the bullet to an area in front of it, so you can make the bullet travel at up to 50 (pretty much instant) and it will not skip over a unit, then when it 'dmgs' a unit it applies the buff so it wont dmg it more than just the once from any of the persistants. now if your missile moves at slower speeds (around 10ish) you wont need to do the 'apply behavior, persistent' things. there is a SMALL room for error if 2 players hit someone at the EXACT same time then the .01 dummy buff would fool it into not doing dmg, but .01 seconds is so fast, its nothing to worry about IMO as a trade off for an insanely fast missile.
here is an example of a map with basic wasd 'WoW' right click straffe and the missile effect, its just a basic, press space to fire for this example, and the animations arent there, but the functionality is. this example does a 'suicide kill' (so the bullet is used after it hits 1 unit, and i made the maximum for the search as 1, instead of -1 so the bullet can only hit 1 unit at a time. but, this example should be a framework for you to make your own. when are you going to post an update video of your game? it looks sweet-
You can also try the following combination of trigger and data editor:
make a missile but give it the move ability (and a proper mover and allow it to be commandeable) then you just order the missile to move from firing point to target point 30 meters away. I don't know what type of land you're going over, so this may not work / require some tinkering. But this is a single trigger, certainly not a massive loop, so it should cause little lag.
As for preventing the missile from blowing itself up, you'll want to follow ezbeats somewhat confusing explanation :P Basically you want to give the missile a behavior that periodically searches the area around it and deals damage to units (or create a chain of effects that searches the area and deals damage).
Lastly you'll want to give the missile a duration that causes it to vanish after the 30 meters have been traveled. This can be done with a behavior timer or through an effect giving it a behavior timer.
Thanks for the post, ezbeats. Most of the stuff you suggested I have explored on my own, though it is good to hear it suggested by somebody else. The problem I'm having implementing it this way is my projectiles don't travel lightning fast, they're maybe 2 or 3 times faster than normal unit speed. There doesn't seem to be any way to check for a Marker without using a Persistent effect, and using periodic persistent effects means any time I change the projectile distance or speed, I also have to change my persistent offsets and timings.
I don't feel that I can use the short debuff duration because this game seats up to 14 players, and more than likely at the very least once or twice during the game a player will get hit by more than one projectile at the same time, and they should take damage from both.
Even still, these solutions just seem very "hacky" to me. I feel the best solution would be to check the {No Marker} validator, but there doesn't seem to be a way to set a marker that it will pick up unless I use Persistent Effect to set the marker.
I already have this system set up similar to the way you're describing in triggers. With 14 players firing projectiles at an average of most likely more than once per second meaning an average of 15-20 projectiles will be in the air at the same time in a 1/32 interval loop, I'm fairly certain it can cause some considerable lag. Even if it's an average of +20ms it's a detriment to the twitchy skill game-type. I'm trying to stuff it all into the data editor.
What do you mean a 1/32 interval loop? Because I wasn't suggesting using a loop to instant move your missiles, I was suggesting you give them a move command (as in use the Move ability) - once, when they are created. After you give them that single command, it's all up to the data editor then. Giving a missile a periodic search area effect (and dealing damage to units found in that area) is not difficult to do. However, using the move command / ability may not give you the movement you want.
I find it hard to believe that giving move commands is causing lag - that should be no laggier than selecting a group of 30 units and sending them to another place. Unless you're sending a move command every 1/32rd second.
fair enough, though i dont feel .01 buff duration would come into play but maybe 1 every 50 or 100 games with 14 people. .01 seconds is just so fast the odds of it happeneing are extremely slim to negligible IMO. but gl! when you decide on something post it here so maybe we can learn an alternative method plz
Ah, I misread your suggestion then. I can make the missile move with the data editor, and do damage periodically, and continue moving after hitting a unit. The only thing I can't figure out is how to make the missile only hit each target a maximum of once. I solved this by setting a custom unit value on the missile in triggers, but I can't figure out a way in data.
Maybe make it so that when it "hits" a target, it also applies a damaging effect on itself (the missile) that kills it (the missile)?
I don't have the editor open at this time, but I believe that's possible without too much effort :)
If not - make a trigger that checks for the "missile impact" effect, and then kills the caster (the missile) ?
I think I found a way to do this. If you notice, behaviors can have a limit on "Maximum Stack Count per Caster". So what you want is to have the missiles periodically apply an damage indicator buff that has the limit set to 1. Then as the expire effect add the damage effect. This works well from my testing, with the only problem being that there is a delay on the damage.
As far as the going through the target, I did this by moving the target offset back that distance. Then for the mover I made it first go 30meters, and then 'instantly' (i.e. at very high speed) go to the target to die. This is unfortunately less clean, but it seems to work.
I attached a map demonstrating this with everything pretty slow.
In the map I'm working on, Sniper Wars, I currently have a 0.0 recurring trigger running to move my missiles and deal damage. I want to make my map run faster, so I'm looking to get rid of this trigger and create the missile in the data editor. I've been staring at and messing with this data editor for two days now, and I can't figure out how to do what I want to do:
I have looked through other unit abilities and have tried just about everything I can think of, and I'm pulling my hair out trying to get what I would consider a simple effect to work. I created this effect in under 30 minutes in triggers. Are there any data gurus out there who can achieve this effect? If not, I'm probably just going to abandon the data editor and stick with the trigger. It might lag, but at least it works...
@rrowland: Go
Heeeeelp meeeeeee!
Can't check the editor atm, but what you're trying to do is definitely doable.
There's loads of information here.
@rrowland: Go
I suggest you take a look at this map: http:www.sc2mapster.com/maps/big-blue/, it features a nice missile setup that should get you started.
I've already looked through all of the search results for "missile".
Thanks for the link, but the missiles in this game explode on contact. I have no problem setting up a missile that travels forward and explodes on impact. I am having trouble setting up a missile matching the conditions I stated in my original post.
ive done something like this, i take it you want the missile or 'bulelt' to move fast, probably very fast, that is the trick
1) make a basic 'launch missile effect'
2) give the missile unit a 'behavior' with -1 duration and .1 or .01 recurring time
3) make behavior do a search
4) add a dmg effect to the search
viola
now, if you are having it as a simple 'bullet' that goes REALLY fast then youll need to do some 'fun' things to make it so it wont 'skip' over any units and still the radius of the search from the missile isnt so wide where it still seems really accurate, to do this;
3)on the missile, dont make it do a search, but a persistent (say like 3 to 5 de[pending on how fast you bullet moves / big the search radius for dmg is)
4)the search from each persistent on the bullet must do a 'set' not just a 'dmg'
5)make a 'buff' to apply to a unit so it wont dmg it in more than one persistent
6)in the search from the persistent on the bullet make it apply the 'bummy buff' for .01 duration (just long enough to fool the other searchs ran from the persistant, and make it validate that it only applys the 'set' from the search if it validates the unit doesnt have the buff
that should be it
it will in essence search an area from the bullet to an area in front of it, so you can make the bullet travel at up to 50 (pretty much instant) and it will not skip over a unit, then when it 'dmgs' a unit it applies the buff so it wont dmg it more than just the once from any of the persistants. now if your missile moves at slower speeds (around 10ish) you wont need to do the 'apply behavior, persistent' things. there is a SMALL room for error if 2 players hit someone at the EXACT same time then the .01 dummy buff would fool it into not doing dmg, but .01 seconds is so fast, its nothing to worry about IMO as a trade off for an insanely fast missile.
here is an example of a map with basic wasd 'WoW' right click straffe and the missile effect, its just a basic, press space to fire for this example, and the animations arent there, but the functionality is. this example does a 'suicide kill' (so the bullet is used after it hits 1 unit, and i made the maximum for the search as 1, instead of -1 so the bullet can only hit 1 unit at a time. but, this example should be a framework for you to make your own. when are you going to post an update video of your game? it looks sweet-
@rrowland: Go
You can also try the following combination of trigger and data editor:
make a missile but give it the move ability (and a proper mover and allow it to be commandeable) then you just order the missile to move from firing point to target point 30 meters away. I don't know what type of land you're going over, so this may not work / require some tinkering. But this is a single trigger, certainly not a massive loop, so it should cause little lag.
As for preventing the missile from blowing itself up, you'll want to follow ezbeats somewhat confusing explanation :P Basically you want to give the missile a behavior that periodically searches the area around it and deals damage to units (or create a chain of effects that searches the area and deals damage).
Lastly you'll want to give the missile a duration that causes it to vanish after the 30 meters have been traveled. This can be done with a behavior timer or through an effect giving it a behavior timer.
Hope this points you in the right direction :>
@ezbeats: Go
Thanks for the post, ezbeats. Most of the stuff you suggested I have explored on my own, though it is good to hear it suggested by somebody else. The problem I'm having implementing it this way is my projectiles don't travel lightning fast, they're maybe 2 or 3 times faster than normal unit speed. There doesn't seem to be any way to check for a Marker without using a Persistent effect, and using periodic persistent effects means any time I change the projectile distance or speed, I also have to change my persistent offsets and timings.
I don't feel that I can use the short debuff duration because this game seats up to 14 players, and more than likely at the very least once or twice during the game a player will get hit by more than one projectile at the same time, and they should take damage from both.
Even still, these solutions just seem very "hacky" to me. I feel the best solution would be to check the {No Marker} validator, but there doesn't seem to be a way to set a marker that it will pick up unless I use Persistent Effect to set the marker.
@xenrathe: Go
I already have this system set up similar to the way you're describing in triggers. With 14 players firing projectiles at an average of most likely more than once per second meaning an average of 15-20 projectiles will be in the air at the same time in a 1/32 interval loop, I'm fairly certain it can cause some considerable lag. Even if it's an average of +20ms it's a detriment to the twitchy skill game-type. I'm trying to stuff it all into the data editor.
@rrowland: Go
What do you mean a 1/32 interval loop? Because I wasn't suggesting using a loop to instant move your missiles, I was suggesting you give them a move command (as in use the Move ability) - once, when they are created. After you give them that single command, it's all up to the data editor then. Giving a missile a periodic search area effect (and dealing damage to units found in that area) is not difficult to do. However, using the move command / ability may not give you the movement you want.
I find it hard to believe that giving move commands is causing lag - that should be no laggier than selecting a group of 30 units and sending them to another place. Unless you're sending a move command every 1/32rd second.
fair enough, though i dont feel .01 buff duration would come into play but maybe 1 every 50 or 100 games with 14 people. .01 seconds is just so fast the odds of it happeneing are extremely slim to negligible IMO. but gl! when you decide on something post it here so maybe we can learn an alternative method plz
@xenrathe: Go
Ah, I misread your suggestion then. I can make the missile move with the data editor, and do damage periodically, and continue moving after hitting a unit. The only thing I can't figure out is how to make the missile only hit each target a maximum of once. I solved this by setting a custom unit value on the missile in triggers, but I can't figure out a way in data.
@rrowland: Go
Maybe make it so that when it "hits" a target, it also applies a damaging effect on itself (the missile) that kills it (the missile)? I don't have the editor open at this time, but I believe that's possible without too much effort :)
If not - make a trigger that checks for the "missile impact" effect, and then kills the caster (the missile) ?
I think I found a way to do this. If you notice, behaviors can have a limit on "Maximum Stack Count per Caster". So what you want is to have the missiles periodically apply an damage indicator buff that has the limit set to 1. Then as the expire effect add the damage effect. This works well from my testing, with the only problem being that there is a delay on the damage.
As far as the going through the target, I did this by moving the target offset back that distance. Then for the mover I made it first go 30meters, and then 'instantly' (i.e. at very high speed) go to the target to die. This is unfortunately less clean, but it seems to work.
I attached a map demonstrating this with everything pretty slow.
@rrowland: Go
What do you mean by check the Marker? I am afraid that part of the data editor eludes me.