Hey all, I'm looking at making an ability that consumes all energy (but doesn't require 100%), then does damages based on how much energy it's consumed.
Using the default cost screen from the abilities, I can't seem to figure out a way to say "cost : all available energy". I don't want to us 1 for vital fraction, as that would force energy to be full, i want the ability to be usable at say, half energy, but only do half as much damage. Even better yet, would be that the ability requires a minimum of 10 energy, but every point OVER 10 gives a boost.
Looking at the damage effect, i'm assuming i'm going to have to have multiple "pulses" of damage, or use some horrible switch system. I'd really love to be able to just keep it as 1 damage effect that does the damage based on how much energy was spent. But if that's not possible, then i'll survive.
I tried searching around, but couldn't find the specific answer i needed. :(
The best approach probably is to make a persistent effect that deals damage and reduces caster energy with every tick, with a periodic validator to check that the caster still has energy. Or use triggers.
You can also do damage directly based on target vitals (check the high templar's feedback ability), but I don't think you can use caster vitals too.
Looking at the damage effect, i'm assuming i'm going to have to have multiple "pulses" of damage, or use some horrible switch system. I'd really love to be able to just keep it as 1 damage effect that does the damage based on how much energy was spent.
Exactly as you say. It is not possible in data with just 1 effect, and the possible workarounds are clumsy and inefficient. I recommend using triggers.
Be easier to directly do the damage through triggers instead. No need to do all that. Just have it do a damage effect of 0 or something on the unit, then use triggering effect: NewDamageEffect.
I'm not at the editor either, but to me it would be more like:
Click Button, pick target, use NewDamageEffect on target.
Trigger Catches NewDamageEffect being used as an event.
set basedam 10;
set energyleft = whateverunithasleft;
basedam + energyleft;//Or use some algorithm to do your boost possibly
Then some apply damage + amount or something like that in triggers, there is no need for a behavior here. I forget the exact function call but it is something like apply damage from unit to unit.
Hey all, I'm looking at making an ability that consumes all energy (but doesn't require 100%), then does damages based on how much energy it's consumed.
Using the default cost screen from the abilities, I can't seem to figure out a way to say "cost : all available energy". I don't want to us 1 for vital fraction, as that would force energy to be full, i want the ability to be usable at say, half energy, but only do half as much damage. Even better yet, would be that the ability requires a minimum of 10 energy, but every point OVER 10 gives a boost.
Looking at the damage effect, i'm assuming i'm going to have to have multiple "pulses" of damage, or use some horrible switch system. I'd really love to be able to just keep it as 1 damage effect that does the damage based on how much energy was spent. But if that's not possible, then i'll survive.
I tried searching around, but couldn't find the specific answer i needed. :(
Thanks in advance.
Use a Modify Unit effect to reduce energy.
The best approach probably is to make a persistent effect that deals damage and reduces caster energy with every tick, with a periodic validator to check that the caster still has energy. Or use triggers.
You can also do damage directly based on target vitals (check the high templar's feedback ability), but I don't think you can use caster vitals too.
Exactly as you say. It is not possible in data with just 1 effect, and the possible workarounds are clumsy and inefficient. I recommend using triggers.
Yeah, looks like triggers are going to be my only option. Even with a trigger though, I feel like I'm over-complicating this. lol
(I'm at work right now, so I can't test this first hand)
So right now I'm thinking something like this :
This sounds like it would work in my head, but seems excessively complex.
Maybe there's some better ways to do this that I'm not familiar with?
@CeejEngine: Go
Be easier to directly do the damage through triggers instead. No need to do all that. Just have it do a damage effect of 0 or something on the unit, then use triggering effect: NewDamageEffect.
I'm not at the editor either, but to me it would be more like:
Then some apply damage + amount or something like that in triggers, there is no need for a behavior here. I forget the exact function call but it is something like apply damage from unit to unit.
@Deadzergling: Go
That sounds *WAY* easier. :P
Work needs to hurry up and end so I can go home and get this going.
Thanks so much.
@Deadzergling: Go
Worked like a charm! Thank you so much everyone. :)
@CeejEngine: Go
Glad to hear it, if I may inquire, what kind of project are you working on? :)