System DPS - Damage Per Second

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
>Try it?
Well... It doesn't o_O
JASS:

//condition which ability is cast...
function Actions takes nothing returns nothing
    local unit t = GetSpellTargetUnit()
    call TriggerSleeepAction(0.4)
    call StopDps(t)
    call TriggerSleepAction(1)
    set t = null
endfunction

//Init trigg and stuff...

And this does not set the PUI counter to 0 :/ The duration of the spell is 4 seconds and this is ran 0.4 seconds after the start
 

Cohadar

master of fugue
Reaction score
209
lol
JASS:
function StartDpsEx takes unit whichUnit, unit whichTarg, real whichDmg, real whichDur, attacktype whichAttackType, damagetype whichDamageType, string whichFx, string whichPoint returns nothing
    local Config store = Config.create(whichUnit, whichTarg, whichDmg, whichDur, whichAttackType, whichDamageType, whichFx, whichPoint)
    local integer pui = GetUnitIndex(store.targ)
    set PUI_TICKS[pui] = PUI_TICKS[pui] + R2I(whichDur)
    call TimerStart(store.time, TIMER_INTERVAL, true, function Dps)
endfunction



JASS:
function StartDpsEx takes unit whichUnit, unit whichTarg, real whichDmg, real whichDur, attacktype whichAttackType, damagetype whichDamageType, string whichFx, string whichPoint returns nothing
    local Config store = Config.create(whichUnit, whichTarg, whichDmg, whichDur, whichAttackType, whichDamageType, whichFx, whichPoint)
    local integer pui = GetUnitIndex(store.targ)
    set PUI_TICKS[pui] = PUI_TICKS[pui] + R2I(whichDur/TIMER_INTERVAL)  // <----<< noob
    call TimerStart(store.time, TIMER_INTERVAL, true, function Dps)
endfunction



EDIT:
also this:
JASS:
    method onDestroy takes nothing returns nothing
        call ClearTimerStructA(.time)
        call PauseTimer(.time)
        call DestroyTimer(.time)
        set PUI_TICKS[GetUnitIndex(.targ)] = 0
    endmethod
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
JASS:
set PUI_TICKS[GetUnitIndex(.targ)] = 0

But if the target has 2+ dps functions on him? Won't that break MUI ?

EDIT: lol..fixed... I love you... you get rep (if I can) and <3 New ver
Still wanna know if this is gonna break MUI :S
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
Okay, another version released. Added buff check again with normal and extended functions. Just to explain a bit how it works...

JASS:
function StartDps takes unit whichUnit, unit whichTarg, real whichDmg, real whichDur returns nothing
call StartDpsBuffEx(whichUnit, whichTarg, whichDmg, whichDur, DIS_BUFF_CHECK ...)

You might notice this DIS_BUFF_CHECK. Well, this is a global integer constant with a value of 0. In the main damage per second function I've added an if/then/else statement that checks if the integer is a buff raw code, or a zero ( 0 ). If it's a buff it will continue to damage if the target has the buff. If it's a zero it will still damage until it finishes.
I made IncreaseDur so that this can work if you want a Poison-like damage (because dps functions are stackable). For example you cast an ability that puts a slow-poison buff on a target. But if you cast again the duration starts all over again and the two casted poisons do not stack (in poison ability). So to make it like that you just simply increase the duration of the damaging. ^^

Umm, I'm not exactly sure my if/then/else statements are optimized... I think it can be done much easier .. Or not...
Comments? :)

EDIT: Oh, and now it uses the newest version of PUI - v4.2 ^^
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
> Im sorry but why is this system even useful?
Never felt tired of creating loops/timers over and over again for simple spells? Or for difficult ones? It just shortens your work and saves your fingers from breaking from ticking on the keyboard.
> caster system can do dps to
Never used caster system. Didn't know that a DPS system already exists..
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
Updated again. Uses ABCT now instead of ABC and PUI.
However, now there isn't an Increase Duration function.
If you want to stop the damaging you just remove the buff you
used with StartDps/StartDpsEx function. Yes, buff checks are used only.
Included a boolean argument to the functions so you can choose if you want
a special effect to be displayed each time the unit is damaged.

Umm, can't remember what else I did. Ask if you want to ask something.
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
Another update, lol
Returned normal Start and StartEx functions that do not require a buff to work. Also returned Stop and Increase Duration functions for them. The system uses PUI again.
Comments? ^^
 

GoGo-Boy

You can change this now in User CP
Reaction score
40
Seems to be very nice and very useful system. I think I might use it, though my map doesn't really make use of damage over seconds stuff, but that might change :)
 

Cohadar

master of fugue
Reaction score
209
Another update, lol
Returned normal Start and StartEx functions that do not require a buff to work. Also returned Stop and Increase Duration functions for them. The system uses PUI again.
Comments? ^^

I already told you, buffs are good, always use buffs when you can.
I assume you returned to the non-buff version because your system failed with buff version a couple of times.

Here is why: When you use spells like Acid Bomb, the buff on the unit does not get activated immediately, the bomb must fly to the unit first (projectile) and when it hit's it, it applies the buff.

So for a buff system to work properly you must wait for a buff to come after spell is cast and then start the DPS.

Put waiting time to 3 seconds or something (3 ticks in this case) and if buff does not show in that time after you cast a spell you simply abort the dps.

As you can see this gets a little tricky here, but that is the point of systems,
doing the dirty work instead of you, those kind of systems are the only one worth using anyways.

All blizzard dps spells use buffs (so they work ok with dispel, spell shield ...)
dps systems that do not use buffs are simply lame.
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
Ow, haven't thought about Acid Bomb... Thanks for that I'll try to work out something.
Anyway I put non-buff function because someone might want that ..
 

Cohadar

master of fugue
Reaction score
209
Noone wants spells that don't behave good with other spells.
It is very important that dps can be dispelled or blocked.
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
Updated again, hope this is the last. Uses only ABCT again and works only with buff. Has 5 seconds wait after cast. If in these 5 seconds the target does not recieve the assigned buff then DPS is cancelled. Test map includes Frost Nova and Acid Bomb test.
 

Cohadar

master of fugue
Reaction score
209
JASS:

//  PROS:
//      - Easy to use
//
//  CONS:
//      - A bit difficult to use


loooooooooooooooooooooooooooooooooooooooooooool :D

Anyways you need a CHECK_DURATION = 5.0 constant
(hardcoding it in tics is not good, calculate ticks from the constant)

Btw using other systems is not a con, especially if I made them :p
 

cr4xzZz

Also known as azwraith_ftL.
Reaction score
51
> Anyways you need a CHECK_DURATION = 5.0 constant
Um, ok, I'll do it right away ^^

> Btw using other systems is not a con, especially if I made them
Oh... Okay xD

> lol thingy
May be easy for some people and difficult for others ..
 
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

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top