Triggers have the potential to lag your map; data does not. Do it in data if possible. I doubt this would be laggy at all, but....I suppose data is technically more efficient. It's going to be a bit harder to make in data though.
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
By the way, if you're wondering, and maybe because it could help you help me solve this, the purpose of this field is to protect an area of the map so a team can't enter it without paying hard for doing so.
Triggers have the potential to lag your map; data does not. Do it in
data if possible. I doubt this would be laggy at all, but....I suppose
data is technically more efficient. It's going to be a bit harder to
make in data though.
Yeah, in W3 you could afford doing stuff with triggers since data was very limited, but with SC2 going the trigger way is just going the lazy way; and I'm obsessed with every single line being perfect, lol.
Well, why not just use the stuff from the Maw of the Void mission?
You'd just have to tune it so that it doesn't spare shielded units.
That was my original idea, but I don't know how to change it so it's a rectangle instead of a circle. I don't even know how to make it be squares, lol.
Another option I realized yesterday looking at this again, is that I could make the exact opposite: instead of having a damage field, have a protective field, and once the generator is killed, have it disappear. In this case, units outside the field would get the damage.
Rectangle field? Use triggers. Damage or search effects in data only support circular shapes (and cut circles if you use angles); you could try to emulate a rectangle, but its not worth the effort imo.
Also its not, that damaging a bunch of units via trigger causes any performance issues.
Rectangle field? Use triggers. Damage or search effects in data only support circular shapes (and cut circles if you use angles); you could try to emulate a rectangle, but its not worth the effort imo.
Also its not, that damaging a bunch of units via trigger causes any performance issues.
So that pretty much confirms it. Doing it the normal way (enter field, suffer damage) isn't possible, and I'm not adding 6-8 circular shapes to make it look like a rectangle.
Two options left, then:
Make it with data, the reversed way (exit field, suffer damage)
Create a behavior with no duration and a periodic event. In the Effects tab, link your periodic event effect to a damage effect. Adjust the period/damage to have the desired "dps". You'll have to use triggers if you intend to use regions more complex than circles, and it's as simple as applying the behavior on units when they enter the region, and removing it when they exit.
Create a behavior with no duration and a periodic event. In the Effects tab, link your periodic event effect to a damage effect. Adjust the period/damage to have the desired "dps". You'll have to use triggers if you intend to use regions more complex than circles, and it's as simple as applying the behavior on units when they enter the region, and removing it when they exit.
Looks good, will look at it your way. Expect tons of stupid questions in this very thread, though, since I'm awful with the data editor xD (if you explain the basics I'll thank you even more :P).
If I'm not wrong, the advantage of using a behavior instead of pure triggers is that you can make an icon show on your units displaying what they're suffering for being inside that region.
If I'm not wrong, the advantage of using a behavior instead of pure triggers is that you can make an icon show on your units displaying what they're suffering for being inside that region.
That, and you switch from periodically executing damage effects on all units in the area to unit enter/leave events only (add behavior when entering, remove when leaving), which will most likely be more performant (but again, wouldn't be much of an issue, if you use the other method).
That, and you switch from periodically executing damage effects on all units in the area to unit enter/leave events only (add behavior when entering, remove when leaving), which will most likely be more performant (but again, wouldn't be much of an issue, if you use the other method).
Well, I don't know how better it will perform, but its muuuch more better than having a "every 1 second pick units in region and set life = life - x". It's pretty good, indeed.
Now I just need to know how behaviors work properly >_< xDDD.
There is an actor type called Region (Rectangle), maybe that's what you're looking for?
Good luck trying to figure out how it works, maybe you can ask the people from this thread, I'm sure they understand the data editor fully and will be glad to help with such a trivial task.
The advantage of using a behavior is efficiency, yes, but also the ability to easily modify your ability with actors. For instance, you could easily add sounds & visual FX when your units take damage by simply adding actors without modifying your existing setup.
Now, as for what you need:
1 Damage Effect.
1 Behavior.
In the data editor, open the effects tab and create a new one.
Set its type to "Damage" and give it a name
Next, you want to change its damage in the "Combat" tab of your damage effect (under the label Amount). There's plenty of other fields to customize your damage effect which you can freely explore.
The next step is creating a behavior that uses this effect. Go to the behaviors tab and create a new one.
Set its type to "Buff" and give it a name
There's 4 values you need to make sure are setup properly. Duration, Period, Period Count, and periodic effect.
In the stats tab of your behavior, make sure the duration is set to 0 (meaning infinite).
Also in the stats tab, make sure the period count is set to -1 (a period that repeats for as long as the behavior is active)
Last thing in that same tab, set the period value to the desired delay between each application of your damage effect (i.e.: setting it to 43 would trigger your periodic effect every 43 seconds. Chances are you'll want a value of 1 or so)
Now that you have a behavior of infinite duration with a periodic event looping every X second, all you need is to setup what effect will be fired. Go to the effects tab of your behavior and link the "effect - periodic" to the damage effect you previously created.
And that's it for your behavior. The trigger part is a lot easier and would probably look similar to this (those being 2 triggers)
Any unit enters <your region here>
Apply 1 <your behavior here> to triggering unit
Any unit exits <your region here>
Remove 1 <your behavior here> from triggering unit
There is an actor type called Region (Rectangle), maybe that's what
you're looking for?
Good luck trying to figure out how it works, maybe you can ask the
people from this thread, I'm sure they understand the data editor fully
and will be glad to help with such a trivial task.
I don't want to derail others' threads, I fear I would end being annoying or something, lol. I'll be right with bumping my own (at least for now). By the way, I'll link these other 2 threads of mine here:
It's working fine (thx again Kyreth, I never worked with behaviors before, and you gave me a good introduction to them), but I have a small doubt.
There's a field named "behavior-alignment". I left it positive, the default value, but later, I discovered an already existing behavior that works just like mines. It's solar combustion, and it's used in Outbreak, when the zombies start to burn with the sunlight. There, it's negative. Any explanation of how this field works and for what is it?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I want to make a damage field, that is, a zone of the map where units of x player suffer damage over time. I know some possibilities:
And I guess there's more out there, but my question is, which is the best and the most efficient?
Particularly, my zone is a rectangle with inconsistent terrain.
edit nvm
@PSGMud: Go
Triggers have the potential to lag your map; data does not. Do it in data if possible. I doubt this would be laggy at all, but....I suppose data is technically more efficient. It's going to be a bit harder to make in data though.
@zeldarules28: Go
I bet I could whip up laggy data. I've done it before. I'll do it again.
Well, why not just use the stuff from the Maw of the Void mission?
You'd just have to tune it so that it doesn't spare shielded units.
By the way, if you're wondering, and maybe because it could help you help me solve this, the purpose of this field is to protect an area of the map so a team can't enter it without paying hard for doing so.
Yeah, in W3 you could afford doing stuff with triggers since data was very limited, but with SC2 going the trigger way is just going the lazy way; and I'm obsessed with every single line being perfect, lol.
That was my original idea, but I don't know how to change it so it's a rectangle instead of a circle. I don't even know how to make it be squares, lol.
Another option I realized yesterday looking at this again, is that I could make the exact opposite: instead of having a damage field, have a protective field, and once the generator is killed, have it disappear. In this case, units outside the field would get the damage.
But that's even more harder to do xD.
Rectangle field? Use triggers. Damage or search effects in data only support circular shapes (and cut circles if you use angles); you could try to emulate a rectangle, but its not worth the effort imo.
Also its not, that damaging a bunch of units via trigger causes any performance issues.
So that pretty much confirms it. Doing it the normal way (enter field, suffer damage) isn't possible, and I'm not adding 6-8 circular shapes to make it look like a rectangle.
Two options left, then:
@Lonami: Go
Create a behavior with no duration and a periodic event. In the Effects tab, link your periodic event effect to a damage effect. Adjust the period/damage to have the desired "dps". You'll have to use triggers if you intend to use regions more complex than circles, and it's as simple as applying the behavior on units when they enter the region, and removing it when they exit.
Looks good, will look at it your way. Expect tons of stupid questions in this very thread, though, since I'm awful with the data editor xD (if you explain the basics I'll thank you even more :P).
If I'm not wrong, the advantage of using a behavior instead of pure triggers is that you can make an icon show on your units displaying what they're suffering for being inside that region.
That, and you switch from periodically executing damage effects on all units in the area to unit enter/leave events only (add behavior when entering, remove when leaving), which will most likely be more performant (but again, wouldn't be much of an issue, if you use the other method).
Well, I don't know how better it will perform, but its muuuch more better than having a "every 1 second pick units in region and set life = life - x". It's pretty good, indeed.
Now I just need to know how behaviors work properly >_< xDDD.
There is an actor type called Region (Rectangle), maybe that's what you're looking for?
Good luck trying to figure out how it works, maybe you can ask the people from this thread, I'm sure they understand the data editor fully and will be glad to help with such a trivial task.
The advantage of using a behavior is efficiency, yes, but also the ability to easily modify your ability with actors. For instance, you could easily add sounds & visual FX when your units take damage by simply adding actors without modifying your existing setup.
Now, as for what you need:
And that's it for your behavior. The trigger part is a lot easier and would probably look similar to this (those being 2 triggers)
Whoa, thanks a lot, Kyreth. I don't know if I'll have time with what's left of today to try it, but I'll try to anyway. Thanks again :).
I don't want to derail others' threads, I fear I would end being annoying or something, lol. I'll be right with bumping my own (at least for now). By the way, I'll link these other 2 threads of mine here:
I always ask weird stuff, I know xDDD.
It's working fine (thx again Kyreth, I never worked with behaviors before, and you gave me a good introduction to them), but I have a small doubt.
There's a field named "behavior-alignment". I left it positive, the default value, but later, I discovered an already existing behavior that works just like mines. It's solar combustion, and it's used in Outbreak, when the zombies start to burn with the sunlight. There, it's negative. Any explanation of how this field works and for what is it?