Help with damage formula

reyghost

New Member
Reaction score
14
Hi,I have created a nova-type spell,im currently working on cleaning its leaks,because im not used to this types of spells(loops,arrays,etc)and im not very sure,well,the matter is im also unable to find a nice formula for the damage this spells does,and so I need some help.
Some usefull information for those of you that would help me is:
-The spell has 4 levels.
-It has 12 "lines" traversed by dummy units once(they die when reaching the maximum distance).
-The Affected units are those within 35 range from the dummies,but note that one affected unit may only be damage once by the same line.
-The maximum distance travelled by this dummies is 500.
-The damage range values im using in my map is: Typical nuke -> 200/250/300/350,for levels
1/2/3/4.

Also important to note is that a unit that is closer to the caster may be in this "35 range" of multiple dummies and therefore damaged multiple time,and the furthest,probably will only be damaged by one.

If anyone finds nice formula and needs more information tell me pls.

The one im currently using,but not fully happy with, is:
(distance travelled by dummy/2)+(90+10*(level of ability ))

Thanks in advance.
+rep to all helpers.:)
 

reyghost

New Member
Reaction score
14
That would solve most problems,but I do want this "the closer they are the harder they get hit",but I want it in a balanced way.Im not sure but that would also not play a sfx on damaged units.
 

Yizzy

New Member
Reaction score
20
(250-(distance travelled by dummy/2))+(90+10*(level of ability)) then?
 

reyghost

New Member
Reaction score
14
Uf that one does huge damage even in level one for a unit hit by 2 dummies,for eg:at100 ->300x2units=600dmg spell level 1.and very few to one at 400-450 away.But thanks for posting something:)
 

Yizzy

New Member
Reaction score
20
I can make more guesses.. free bumps at least :p

Give some numbers and I'll think someting up ;)

75*((level of ability)+1)-(distance travelled by dummy/5)

at100 ->130x2units=260dmg spell level 1
at300 ->90x1units=90dmg spell level 1
at500 ->50x1units=50dmg spell level 1

at100 ->355x2units=710dmg spell level 4
at300 ->315x1units=315dmg spell level 4
at500 ->275x1units=275dmg spell level 4
 

Summoned

New Member
Reaction score
51
If you're doing it with vJASS, just set up 2 timers and a group array (global). One timer expires every 0.03-0.05 seconds for the slide effect and the other timer expires in 500 / missilespeed. Keep adding units to the group array whenever they get hit by the nova missiles so that if they're in the group they don't take damage from any of the other missiles. After the second timer expires, destroy the group.

This way there's no need for silly stuff like taking into account a unit getting hit 4-5 times.
 

reyghost

New Member
Reaction score
14
Sounds better but it discriminates further units(50dmg)and in higher levels at mele range(not sure how many dummies will damage) 710 can litterally blow up everything,think of a melee hero 710-1000 dmg.I need to balance the damage of this spell,nice- close to fearsome near the caster,and still usefull against ranged enemies.

Thanks yizzy I feel bad asking so much and being so retailer :eek:
you can do what you are on now and if you have some spare time and want make some numbers or come with an idea post it.
Big thanks +rep :D
 

reyghost

New Member
Reaction score
14
I used GUI.I did that about the groups but for one line,I dont want it that way because this is meant to be a kind of "protecting spell" making melee or low range attackers to think twice,and some more elaborated spell,i already have 2 other AOE spells for that caster.:)
 

Yizzy

New Member
Reaction score
20
If you say how much dmg you want it to do at say, range 100 and 500 on level 1, and at range 100 and 500 at level 4, and I'll make a formula from that..
 

reyghost

New Member
Reaction score
14
Aproximatley:

Level 1 : 100 range 250 dmg; 500 range 200 damage
Level 4: 100 range 450 dmg; 500 range 350 damage

I hope this does not take you much of your time :D thanks
I cant +rep u again tomorrow ill do so
 

Summoned

New Member
Reaction score
51
I used GUI.I did that about the groups but for one line,I dont want it that way because this is meant to be a kind of "protecting spell" making melee or low range attackers to think twice,and some more elaborated spell,i already have 2 other AOE spells for that caster.:)
What's stopping you from doing, say, Damage Target for 300 - (0.2 * Distance) AFTER doing it my way? :p

You'll need custom scripts for a "local integer i" in the trigger, but it should be doable in GUI.

blah blah starts effect of an ability

ability being cast = nova

Custom script: local integer i
Set novacount = novacount + 1
Custom script: set i = udg_novacount
Set missilenovacount[missilemuicount] = novacount
Wait ??? seconds
Custom script: call DestroyGroup(udg_novahitgroup)

or maybe Custom script: call GroupClear(udg_novahitgroup)

in the other trigger, check

if (Picked unit) is in missilenovacount[Integer A] equal to False
Unit group - add (Picked unit) to missilenovacount[Integer A]
deal damage

Hard for me to know exactly what to add in your trigger to make it happen though, since I don't know how you're doing it.

Much cleaner than trying to account for a unit being hit by 5 missiles at point blank and maybe 2 missiles at 100 range.
 

Yizzy

New Member
Reaction score
20
R,L distance travelled by dummy,level of ability

262.5-R/8
Level 1: 100 range 250 dmg; 500 range 200 damage
475-R/4
Level 4: 100 range 450 dmg; 500 range 350 damage

262.5-R/(8-L)+212.5((L-1)/3)

(262.5-212.5/3)-R/(8-L)+L(212.5/3)

(575/3)-R/(8-L)+L(425/6)

191.667-(distance travelled by dummy)/(8-(level of ability))+(level of ability)*70.833


This no NOT take in to account that unit can be hit twice
 

reyghost

New Member
Reaction score
14
Here is the trigger I am currently using for the spell,there will probaly(with 99% accuracy)be better/easier ways to do it,if you think its really worth changing it ill delete it and do it again(I will cry ,but I will do it :)).

Trigger:
  • Electricfield
    • Events
      • Unit - A unit Starts the effect of ana ability
    • Conditions
      • (Ability being cast) Equal to Electric field
    • Actions
      • Set EF_catser = (Triggering unit)
      • Set EF_casterpos = (Position of EF_catser)
      • Special effect - Create a special effect attached to the overhead of EF_catser using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
      • Special effect - Destroy (Last created special effect)
      • Special effect - Create a special effect attached to the origin of EF_catser using Abilities\Spells\Orc\LightningShield\LightningShieldTarget.mdl
      • Wait 0.75 seconds
      • Special effect - Destroy (Last created special effect)
      • For each (Integer EF_circleinteger) from 1 to 12, do (Actions)
        • Loop: Actions
          • Unit - Create 1 ElectricDummy for (Owner of EF_catser) at EF_casterpos facing (0.00 + ((Real(EF_circleinteger)) x 30.00)) degrees
          • Set EF_electricdummies[EF_circleinteger] = (Last created unit)
          • Set EF_dummyoffset[EF_circleinteger] = ((Position of EF_electricdummies[EF_circleinteger]) offset by 550.00 towards (0.00 + ((Real(EF_circleinteger)) x 30.00)) degrees)
      • Trigger - Turn on Electricfieldmovement <gen>





Trigger:
  • Electricfieldmovement
    • events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer EF_circleinteger) from 1 to 12, do (Actions)
        • Loop: Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If: Conditions
              • (Distance between (Position of EF_electricdummies[EF_circleinteger]) and EF_dummyoffset[EF_circleinteger]) Mayor que o igual a 50.00
            • Then: Acitions
              • Set EF_nextdummypos[EF_circleinteger] = ((Position of EF_electricdummies[EF_circleinteger]) offset by 25.00 towards (0.00 + ((Real(EF_circleinteger)) x 30.00)) degrees)
              • Unit - Move EF_electricdummies[EF_circleinteger] instantly to EF_nextdummypos[EF_circleinteger]
              • Set EF_dummytargetgroup[EF_circleinteger] = (Units within 35.00 of (Position of EF_electricdummies[EF_circleinteger]) matching ((((Matching unit) is in EF_damagedgroup[EF_circleinteger]) Not equal to True) and (((Matching unit) belongs to an enemy of (Owner of EF_catser)) Equal to True)))
              • Unit group - Pick every unit in EF_dummytargetgroup[EF_circleinteger] and do (Actions)
                • Loop: Actions
                  • Unit - Cause EF_catser to damage (Picked unit), dealing (((Distance between (Position of EF_electricdummies[EF_circleinteger]) and (Position of EF_catser)) / 2.00) + (90.00 + (10.00 x (Real((Level of Electric field for EF_catser)))))) damage of attack type Magic and damage type Normal
                  • Special effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Weapons\Bolt\BoltImpact.mdl
                  • Unit group - Remove (Picked unit) from EF_dummytargetgroup[EF_circleinteger]
                  • Special effect - Destroy (Last created special effect)
                  • Unit group - Add (Picked unit) to EF_damagedgroup[EF_circleinteger]
            • Else: Actions
              • Unit - Kill EF_electricdummies[EF_circleinteger]



I also have a doubt,do I have to use "turn trigger off" in the second one ?,if so where ?
And some tips on where exactly to put the custom scripts for leaks would be nice:p

Thank anyway for all help.
 

Yizzy

New Member
Reaction score
20
I'm not too good on optimization, but it does what I want.. (and maybe more :p)

JASS:
scope ElectricField initializer Init

globals
    private constant integer Electric_Field = 'AOwk' //Your ability code ex. Wind Walk
    private constant string CASTER_EFFECT = "Abilities\\Spells\\Other\\Monsoon\\MonsoonBoltTarget.mdl"
    private constant string CASTER_EFFECT2 = "Abilities\\Spells\\Orc\\LightningShield\\LightningShieldTarget.mdl"
    private constant string TARGET_EFFECT = "Abilities\\Weapons\\Bolt\\BoltImpact.mdl"
    private group array g
    private boolexpr b
    private unit c
    private real pos_c_x
    private real pos_c_y
    private integer level
    private player p
    private integer i
endglobals

private function Conditions takes nothing returns boolean
    return GetSpellAbilityId() == Electric_Field
endfunction

function Dist takes real dx, real dy returns real
    return SquareRoot(dx * dx + dy * dy)
endfunction

private function CheckUnit takes nothing returns boolean
    return IsPlayerEnemy(p, GetOwningPlayer(GetFilterUnit())) and Dist(pos_c_x-GetUnitX(GetFilterUnit()),pos_c_y-GetUnitY(GetFilterUnit())) > i*125.0 and GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) > 0.5
endfunction

private function Electrify takes nothing returns nothing
    local unit u = GetEnumUnit()
    local real range = Dist(pos_c_x-GetUnitX(u),pos_c_y-GetUnitY(u))
    call DestroyEffect(AddSpecialEffectTarget(TARGET_EFFECT, u, "overhead"))
    call UnitDamageTarget(c, u, 191.667 + level*70.833 - range/(8-level), true, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WHOKNOWS)
endfunction

private function Actions takes nothing returns nothing
    set c = GetSpellAbilityUnit()
    set pos_c_x = GetUnitX(c)
    set pos_c_y = GetUnitY(c)
    set level = GetUnitAbilityLevel(c, Electric_Field)
    set p = GetOwningPlayer(c)
    call DestroyEffect(AddSpecialEffectTarget(CASTER_EFFECT, c, "overhead"))
    call DestroyEffect(AddSpecialEffectTarget(CASTER_EFFECT2, c, "origin"))
    //
    set i = 0
    loop
        exitwhen i >= 3
        call GroupClear(g<i>)
        call GroupEnumUnitsInRange (g<i>, pos_c_x, pos_c_y, (i+1)*125.0,b)
        set i = i + 1
    endloop
    //
    set i = 0
    loop
        exitwhen i &gt;= 3
        call ForGroup(g<i>, function Electrify)
        call TriggerSleepAction(0.05) //wait, so there&#039;s time differnace as trigger damages further away
        set i = i + 1
    endloop
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    local integer index = 0
    loop
        exitwhen index &gt;= 12
        call TriggerRegisterPlayerUnitEvent(t, Player(index), EVENT_PLAYER_UNIT_SPELL_EFFECT, null)
        set index = index + 1
    endloop
    call TriggerAddCondition(t, Condition(function Conditions))
    call TriggerAddAction(t, function Actions)
    set t = null
    //make more groups if you want..
    set index = 0
    loop
        exitwhen index &gt;= 3
        set g[index] = CreateGroup()
        set index = index + 1
    endloop
    
    set b = Condition(function CheckUnit)
endfunction

endscope</i></i></i>


Sorry if you wanted a GUI-trigger, it's a lot easier to do almost anything in Jass, no dummy units, no variables, no arrays n' such you have to make to implement it, only change abicode and it should work.. :thup:

it uses my dmg formula from previous post, remember that it's ATTACK_TYPE_MAGIC, does 2xDmg to heavy armor units, I tested it on Timber Wolfs (lvl2), it has no trouble one-shoting 'em at lvl1..
 

Legacyspy

New Member
Reaction score
19
That would solve most problems,but I do want this "the closer they are the harder they get hit",but I want it in a balanced way.Im not sure but that would also not play a sfx on damaged units.

Is this due to being hit by multiple lines? If so shockwave will already do this, as a unit closer to the center will have more lines pass through him.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top