• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Triggered damage per second

Status
Not open for further replies.

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
How can I make a triggered damage per second ? I know we have to use "Time - Every 1 second" but how can I make a duration for this damage ? It just stands forever.

For example: Death and Decay, deals damage per second in an AoE, but I want a triggered version, can you give me this trigger ? If I am not asking too much, can you help me ?
 

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
Do you want the ability to DoT a static area or do you want those in the initial area to be damaged even if they leave this area?

Dot a static area for my skill, but any dps triggered is welcome, at least I can learn, for example Imolation (trigger)
 
Level 12
Joined
Nov 3, 2013
Messages
989
unit starts effect of abilit

ability equal to channel


set index = index + 1
set casterVar[index] = triggering unit
set pointVar[index] = target point of ability being cast

if index = 1 then run trigger someTrigger_Loop

periodic event

every 0.03 sec of time do

for each integerVar from 1 to index do

set timeVar[integervar] = timerVar[integervar] + 0.03

if timeVar[integervar is less than MaxDuration

then do
set unitGroupTarget[integervar] = units within (number) of pointVar matching matching unit is enemy of casterVar[integervar]

make casterVar[integervar] deal (desired dps * 0.03)

else do

set casteVar[index] = casterVar[integerVar]
set timeVar[index] = casterVar[integerVar]
set pointVar[index] = pointVar[integerVar]


set index = index - 1

if index = 0
turn of trigger this (trigger)

pretty much done or w/e
 
  • Like
Reactions: hdm

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
unit starts effect of abilit

ability equal to channel


set index = index + 1
set casterVar[index] = triggering unit
set pointVar[index] = target point of ability being cast

if index = 1 then run trigger someTrigger_Loop

periodic event

every 0.03 sec of time do

for each integerVar from 1 to index do

set timeVar[integervar] = timerVar[integervar] + 0.03

if timeVar[integervar is less than MaxDuration

then do
set unitGroupTarget[integervar] = units within (number) of pointVar matching matching unit is enemy of casterVar[integervar]

make casterVar[integervar] deal (desired dps * 0.03)

else do

set casteVar[index] = casterVar[integerVar]
set timeVar[index] = casterVar[integerVar]
set pointVar[index] = pointVar[integerVar]


set index = index - 1

if index = 0
turn of trigger this (trigger)

pretty much done or w/e

You could tigger [betweeen] this.

You did this MUI ? omg, thx.

What does the trigger do exactly ?
 
Level 12
Joined
Nov 3, 2013
Messages
989
It's a rough "sketch" or w/e for how you'd make it and have MUI for it

If it's supposed to be a channeled ability you should add conditions for if the caster is still channeling.

Didn't make anything for scaling damage with levels

also didn't know if you wanted it to deal % hp like Death and Decay

Also the points leak and so don't forget to clean it up.

so there are things for you to do...
 

hdm

hdm

Level 9
Joined
Nov 19, 2011
Messages
384
Does the integerVar has any value ? or no ? (For Each IntergerVar from 1 to index)

also set timeVar[index] = casterVar[integerVar] is this right ? time = caster ?
 
IntegerVar is just an integer variable that you want instead of the default Integer A or B.
Just create an integer variable called that and don't touch it.

The TimeVar is in fact a Real variable. You need it to be a Real because you need to add fractions of a number eg. 0.03.


Edit:
Index = Integer variable <- Number of abilities in action
CasterVar = Unit variable Array <- The units that have cast the ability
PointVar = Point variable Array <- The location of each ability cast

TimeVar = Real variable Array <- Keep track of the duration of each ability cast
MaxDuration = Real variable <- Is set to the duration you want the DoT to function)
UnitGroupTarget = Unit group variable Array <- Targets around each location of each ability cast
 
  • Like
Reactions: hdm
Level 12
Joined
Nov 3, 2013
Messages
989
Does the integerVar has any value ? or no ? (For Each IntergerVar from 1 to index)

also set timeVar[index] = casterVar[integerVar] is this right ? time = caster ?

IntegerVar is just for the loop, it increases with one for each loop it does.

and no it's a misstype that i've made, it supposed to be timeVar both times.
 
Status
Not open for further replies.
Top