For WC3-like abilities, do I have to create a distinct abilities for each level? For example, if I had a Fireball ability, would I have to create 3 separate abilities Fireball Lvl 1, Fireball Lvl 2, and Fireball Lvl 3 in order for the level-up system to work correctly?
This seems a little heavy-handed to me. Is there something where I could, say, just add damage to an ability I already have for each level point invested in that ability?
Well, when I have a complex ability with multiple levels and only want to change the damage on lvlup, I usually use a damage effect with 0 damage and use a trigger, which triggers for this damage effect. Then I cause the damage dependant on the skill level per trigger.
Other than that, there is no possibility I know of.
This seems a little heavy-handed to me. Is there something where I could, say, just add damage to an ability I already have for each level point invested in that ability?
Well, when I have a complex ability with multiple levels and only want to change the damage on lvlup, I usually use a damage effect with 0 damage and use a trigger, which triggers for this damage effect. Then I cause the damage dependant on the skill level per trigger.
Other than that, there is no possibility I know of.
You use a damage effect, which causes 0 damage. Then you create a trigger with the event: Any unit takes damage with (your effect). Then you use the UnitDamage- Function to cause the desired amount of damage to your target. You can get the ability level of the ability (note that level 1 will be detected as 0, level 2 is 1 and so on).
The UnitDamage- Function uses a damage effect to cause the damage, you can either take the 0 damage effect (in this case, make sure it has no AoE, cover AoE-damage with search effects. Also add a condition: damage caused==0 to prevent an infinite loop and you should carefully handle actors, dont use the damage effect as impact effect for actors, it will trigger the actor event multiple times), or use another damage effect dedicated for the triggered damage.
Dunno if the UnitDamage- Function is available in Gui, I use Galaxy script. You could easily use a custom script if not.
This would be a simple spell (or a complex one, does not really matter as long as all damage is caused by a single damage effect), named Electrocute. It has the id "Electrocute" and uses a 0 damage effect "ElectrocuteDamage". The damage caused is set up in the function EC_Damage, the passed integer is the ability level -1, like stated above.
So this function would return 50 + 25*lvl as damage, which is then caused by the UnitDamage- function. My ability has 5 levels, which cause 50/75/100/125/150 damage this way.
Note that this way should be fairly performant, since your trigger is reactin only on a single damage effect (unlike for example a wc3 damage detection, which needed to check all damage events at once and filter the correct ones to modify)
In the "Effects" field, just add more of the same effect. Should work with Cost or Range fields as well. Each value in any of those fields corresponds to a level, so first value means level 1, second value level 2, etc. so if you add values to any of those fields, itll increase the level cap.
From your posts today i see youre trying to learn to make abilities through data (partially at least)... Ive got MSN and skype, PM me if you want to add me and i can answer your questions quicker :)
Done :) Works exactly as I need it to. Thanks for the help and the offer. Though I don't think I'll be touching on data much :P I mainly need to use it because there is no way to dynamically created buttons/effects (That I know of) through pure script.
You should be careful when linking triggers with spells. It's not guaranteed that a trigger will fire when it's supposed to if too many events fire at the same time.
Got one last question. Does anyone know how to extract the level of an ability and use it to create a dynamic tooltip? Some arithmetic required here.
Use another dummy effect that isnt used by the spell at all, have the tooltip refer to a value you need from that effect (If your tooltip says the ability does X damage, have "X" be a reference to the Damage - Amount field in the unused effect), then use catalogs to change that value every time the ability is leveled up :)
You should be careful when linking triggers with spells. It's not guaranteed that a trigger will fire when it's supposed to if too many events fire at the same time.
Still needs to be determined. For my tests, thousands of events simultaneously fired work perfectly fine.
Use another dummy effect that isnt used by the spell at all, have the tooltip refer to a value you need from that effect (If your tooltip says the ability does X damage, have "X" be a reference to the Damage - Amount field in the unused effect), then use catalogs to change that value every time the ability is leveled up :)
In this case, you might want to use catalogs to change the ability effects directly :)
If you use the proper ref links in the tooltip, it will update automatically. Also its easier to change other things than just damage (like AoE or something)
Hm.. Heres the raw text for one of the existing campaign abilities
Quote:
Stuns all enemies in a small area. Deals <d ref="Effect,330mmBarrageCannonsPersistent,PeriodCount * Effect,330mmBarrageCannonsDamage,Amount"/> damage over <d ref="Effect,330mmBarrageCannonsPersistent,PeriodCount * Effect,330mmBarrageCannonsPersistent,PeriodicPeriodArray[0]"/> seconds in a larger area.
I'm pretty sure this is the string that performs dynamic damage calculation. If there is some sort of reference I can point to to directly get level with this method, Then it should be possible to avoid having to create a new effect at all. I just need a field or array of sorts it seems.. Will update later, Gonna try this out.
You should be careful when linking triggers with spells. It's not guaranteed that a trigger will fire when it's supposed to if too many events fire at the same time.
I actually coded a spell handler to do this for me. The spell handler just checks the spell thats cast then runs a separate thread to perform the spell. Many events does kinda slow down framerate with the debugger on, but when I tried spamming the ability on full screen, seems to work just fine with no lag despite the insane amount of effects taking place. Its open source so you can get it here.
Catalogs sound like fun. Are they restricted to modifying effect parameters? Or can we mess around with the Ability parameters as well? I'm thinking of using some unused field to store the damage values. I'd like to avoid having to create extra effects where possible (Trying to avoid any unecessary map size increase and keep things optimal.)
It can be easy to fire more than thousands. For example, if you have many units with an attack speed of zero, "any unit is attacked" can cause overflow problems.
This might seem like a dumb question, but:
For WC3-like abilities, do I have to create a distinct abilities for each level? For example, if I had a Fireball ability, would I have to create 3 separate abilities Fireball Lvl 1, Fireball Lvl 2, and Fireball Lvl 3 in order for the level-up system to work correctly?
This seems a little heavy-handed to me. Is there something where I could, say, just add damage to an ability I already have for each level point invested in that ability?
@Johnzee: Go
Well, when I have a complex ability with multiple levels and only want to change the damage on lvlup, I usually use a damage effect with 0 damage and use a trigger, which triggers for this damage effect. Then I cause the damage dependant on the skill level per trigger.
Other than that, there is no possibility I know of.
@Kueken531: Go
You can do a similar thing with the data editor and use a behavior to change the damage.
@dddarrenccc: Go
Example? Is this a Behavior of type Veterancy?
Upgrades tab.
This is a good question. Could someone give a more detailed answer?
You use a damage effect, which causes 0 damage. Then you create a trigger with the event: Any unit takes damage with (your effect). Then you use the UnitDamage- Function to cause the desired amount of damage to your target. You can get the ability level of the ability (note that level 1 will be detected as 0, level 2 is 1 and so on).
The UnitDamage- Function uses a damage effect to cause the damage, you can either take the 0 damage effect (in this case, make sure it has no AoE, cover AoE-damage with search effects. Also add a condition: damage caused==0 to prevent an infinite loop and you should carefully handle actors, dont use the damage effect as impact effect for actors, it will trigger the actor event multiple times), or use another damage effect dedicated for the triggered damage.
Dunno if the UnitDamage- Function is available in Gui, I use Galaxy script. You could easily use a custom script if not.
This would be a simple spell (or a complex one, does not really matter as long as all damage is caused by a single damage effect), named Electrocute. It has the id "Electrocute" and uses a 0 damage effect "ElectrocuteDamage". The damage caused is set up in the function EC_Damage, the passed integer is the ability level -1, like stated above.
So this function would return 50 + 25*lvl as damage, which is then caused by the UnitDamage- function. My ability has 5 levels, which cause 50/75/100/125/150 damage this way.
Note that this way should be fairly performant, since your trigger is reactin only on a single damage effect (unlike for example a wc3 damage detection, which needed to check all damage events at once and filter the correct ones to modify)
Using Kueken's pure data editor method (which he describes in another post), I was able to get my ability to do 3 levels of damage.
See the other post for details: http://forums.sc2mapster.com/development/data/13984-increasing-ability-damage-with-levels/
@Kueken531: Go
Terribly sorry for bumping this.. But could anyone please teach me how I can make my abilites have more than 1 level?
By default the data editor seems to assume 0. Im using galaxy to increment the level of the ability, but it seems to be capped at 1.
In the "Effects" field, just add more of the same effect. Should work with Cost or Range fields as well. Each value in any of those fields corresponds to a level, so first value means level 1, second value level 2, etc. so if you add values to any of those fields, itll increase the level cap.
From your posts today i see youre trying to learn to make abilities through data (partially at least)... Ive got MSN and skype, PM me if you want to add me and i can answer your questions quicker :)
Dota tutorial in my sig. Part 2 (I think) covers multi-level abilities. Might be helpful to read.
It can get a bit tedious creating damage effects for every level of ability though.
If you have an excessive amount of levels for something simple like a pure damage ability, it may be better to just trigger it.
@TheAlmaity: Go
Done :) Works exactly as I need it to. Thanks for the help and the offer. Though I don't think I'll be touching on data much :P I mainly need to use it because there is no way to dynamically created buttons/effects (That I know of) through pure script.
@zeldarules28: Go
Aight, I'll keep that in mind should I ever need it.
@VoidPotato: Go
My thoughts exactly. 1 dummy effect that deals 0 damage is all it takes really.
Got one last question. Does anyone know how to extract the level of an ability and use it to create a dynamic tooltip? Some arithmetic required here.
You should be careful when linking triggers with spells. It's not guaranteed that a trigger will fire when it's supposed to if too many events fire at the same time.
Use another dummy effect that isnt used by the spell at all, have the tooltip refer to a value you need from that effect (If your tooltip says the ability does X damage, have "X" be a reference to the Damage - Amount field in the unused effect), then use catalogs to change that value every time the ability is leveled up :)
@TheAlmaity: Go
Does this work if players can have multiple units with the ability?
Still needs to be determined. For my tests, thousands of events simultaneously fired work perfectly fine.
In this case, you might want to use catalogs to change the ability effects directly :)
If you use the proper ref links in the tooltip, it will update automatically. Also its easier to change other things than just damage (like AoE or something)
@TheAlmaity: Go
Hm.. Heres the raw text for one of the existing campaign abilities
I'm pretty sure this is the string that performs dynamic damage calculation. If there is some sort of reference I can point to to directly get level with this method, Then it should be possible to avoid having to create a new effect at all. I just need a field or array of sorts it seems.. Will update later, Gonna try this out.
I actually coded a spell handler to do this for me. The spell handler just checks the spell thats cast then runs a separate thread to perform the spell. Many events does kinda slow down framerate with the debugger on, but when I tried spamming the ability on full screen, seems to work just fine with no lag despite the insane amount of effects taking place. Its open source so you can get it here.
I'll be updating time to time though when I make modifications.
@Kueken531: Go
Catalogs sound like fun. Are they restricted to modifying effect parameters? Or can we mess around with the Ability parameters as well? I'm thinking of using some unused field to store the damage values. I'd like to avoid having to create extra effects where possible (Trying to avoid any unecessary map size increase and keep things optimal.)
@Kueken531: Go
It can be easy to fire more than thousands. For example, if you have many units with an attack speed of zero, "any unit is attacked" can cause overflow problems.
@FuzzYD: Go
When you say thread, are you referring to it in the context of parallel processing, or does the term have a different meaning in the editor?
Does the editor actually give you control over how many concurrent threads are run on your processor?