• 🏆 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!

Drain Aura help

Status
Not open for further replies.
Level 4
Joined
Aug 21, 2019
Messages
42
Hello, I tried to make something like ,,Drain Aura'', but triggers don't want work. I hope that u know what I mean. I want it to deal caster's INT/10 per second. Can u help? U will got special thx in my CHS.
 
Level 16
Joined
May 2, 2011
Messages
1,345
Hello, I tried to make something like ,,Drain Aura'', but triggers don't want work. I hope that u know what I mean. I want it to deal caster's INT/10 per second. Can u help? U will got special thx in my CHS.
periodic event

every 0.5 second of game time
pick units around your hero, and check if the unit has the aura buff, if yes then reduce their HP.
 
Level 4
Joined
Aug 21, 2019
Messages
42

Attachments

  • hive.png
    hive.png
    19.4 KB · Views: 42
Level 16
Joined
May 2, 2011
Messages
1,345
How To Post Your Trigger

Please copy your trigger as text and paste it here inside this BBCode.
  • <your trigger here>


Use

[plain]
[trigger]
[/trigger]

[/plain]
instead of code tags.



Your trigger seems fine to me, apart from some leaks. though is there only 1 unit with the aura? or there can be more than one unit which has this same aura?
your trigger will probably only work for 1 unit, so if you have more than that in your map it wouldnt work.
 
Level 4
Joined
Aug 21, 2019
Messages
42
Your trigger seems fine to me, apart from some leaks. though is there only 1 unit with the aura? or there can be more than one unit which has this same aura?
your trigger will probably only work for 1 unit, so if you have more than that in your map it wouldnt work.
  • idumm enter
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Dark Seer
    • Actions
      • Set VariableSet iddum = (Entering unit)
      • Trigger - Turn on drain aura <gen>
      • Trigger - Turn off (This trigger)
  • drain aura
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Cruelty Drain ) Equal to True
            • Then - Actions
              • Floating Text - Create floating text that reads (String(((Intelligence of iddum (Include bonuses)) / 10))) above (Picked unit) with Z offset 0.00, using font size 9.00, color (50.00%, 0.00%, 50.00%), and 10.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to (Random real number between 1.00 and 2.00) seconds
              • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
              • Unit - Cause iddum to damage circular area after 0.00 seconds of radius 900.00 at (Position of iddum), dealing (Real(((Intelligence of iddum (Include bonuses)) / 10))) damage of attack type Spells and damage type Normal
            • Else - Actions
 
Level 16
Joined
May 2, 2011
Messages
1,345
Good. Now you just need to put these two tags before and after your trigger
Use

[trigger]
[/trigger]

so it will become like this

  • idumm enter
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Dark Seer
    • Actions
      • Set VariableSet iddum = (Entering unit)
      • Trigger - Turn on drain aura <gen>
      • Trigger - Turn off (This trigger)
  • drain aura
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) has buff Cruelty Drain ) Equal to True
            • Then - Actions
              • Floating Text - Create floating text that reads (String(((Intelligence of iddum (Include bonuses)) / 10))) above (Picked unit) with Z offset 0.00, using font size 9.00, color (50.00%, 0.00%, 50.00%), and 10.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to (Random real number between 1.00 and 2.00) seconds
              • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
              • Unit - Cause iddum to damage circular area after 0.00 seconds of radius 900.00 at (Position of iddum), dealing (Real(((Intelligence of iddum (Include bonuses)) / 10))) damage of attack type Spells and damage type Normal
            • Else - Actions


Looks pretty neat doesnt it?
 
Level 16
Joined
May 2, 2011
Messages
1,345
the trigger seems to work fine with me
  • AuraHelp
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause Necromancer to damage circular area after 0.00 seconds of radius 500.00 at (Position of Necromancer), dealing 100.00 damage of attack type Spells and damage type Normal





though im pretty sure this isnt the intended effect because here it can even damage our own units.
its better to do it as in, cause Necromancer to damage picked unit IF picked unit has the buff.

something like
 
Last edited:
Level 4
Joined
Aug 21, 2019
Messages
42
it won't work cos i want to deal INT/10. There must be some trigg that will read his INT and deal damage.
the trigger seems to work fine with me
  • AuraHelp
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause Necromancer to damage circular area after 0.00 seconds of radius 500.00 at (Position of Necromancer), dealing 100.00 damage of attack type Spells and damage type Normal
 
Level 4
Joined
Aug 21, 2019
Messages
42
the trigger seems to work fine with me
  • AuraHelp
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Cause Necromancer to damage circular area after 0.00 seconds of radius 500.00 at (Position of Necromancer), dealing 100.00 damage of attack type Spells and damage type Normal
in CHS u pick hero and there can be more than 1 same hero.
 
Level 16
Joined
May 2, 2011
Messages
1,345
it works for me just fine.

  • AuraHelp
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set INTLich = (Intelligence of Lich 0033 <gen> (Include bonuses))
      • Set TempPoint01 = (Position of Necromancer)
      • Set AuraTarget = (Units within 512.00 of TempPoint01 matching (((Matching unit) has buff Unholy Aura) Equal to True))
      • Unit Group - Pick every unit in AuraTarget and do (Actions)
        • Loop - Actions
          • Unit - Cause Necromancer to damage (Picked unit), dealing (Real(INTLich)) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_TempPoint01)
      • Custom script: call DestroyGroup(udg_AuraTarget)
you might not understand the last two lines. its basically to remove the leak. dont worry about it too much even if you didnt understand it.


its bascially to delete the group and the location used once the trigger is finished just so it doesnt consume memory. just write them using custom script and make sure you use the correct variable names .
 
Level 4
Joined
Aug 21, 2019
Messages
42
it works for me just fine.

  • AuraHelp
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set INTLich = (Intelligence of Lich 0033 <gen> (Include bonuses))
      • Set TempPoint01 = (Position of Necromancer)
      • Set AuraTarget = (Units within 512.00 of TempPoint01 matching (((Matching unit) has buff Unholy Aura) Equal to True))
      • Unit Group - Pick every unit in AuraTarget and do (Actions)
        • Loop - Actions
          • Unit - Cause Necromancer to damage (Picked unit), dealing (Real(INTLich)) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_TempPoint01)
      • Custom script: call DestroyGroup(udg_AuraTarget)
you might not understand the last two lines. its basically to remove the leak. dont worry about it too much even if you didnt understand it.


its bascially to delete the group and the location used once the trigger is finished just so it doesnt consume memory. just write them using custom script and make sure you use the correct variable names .
Sorry that i am maybe annoying, but i won't work for CASTERS hero types in map. Eh, thx btw maybe someone will help
 
Level 16
Joined
May 2, 2011
Messages
1,345
just use an array then.
do you want the aura to stack with itself?

map designer said:
or there can be more than one unit which has this same aura?
also when I asked above you didnt say it will work for more than one player :)

anyway,

array will be fine if each player only has 1 dark seer. but if 1 player can have many dark seers then you will need to make it MUI
 
Level 16
Joined
May 2, 2011
Messages
1,345
Array is varialbel with index as a number to distinguish between them. think of it like a table.
like
Variable Necromancer[x] with size 3
will have
Necromancer[1]
Necromancer[2]
Necromancer[3]

you can increase the size if you want to be as many player as you have.
just make any variable you want, and tick the array box, and choose the size you want.

do you know how to create a variable?

you still didnt mention if you want the aura to stack or not.
in other words, if there is one footman near 2 dark seers, he receive 1 damage or receive 2 damage?
 
Level 4
Joined
Aug 21, 2019
Messages
42
Array is varialbel with index as a number to distinguish between them. think of it like a table.
like
Variable Necromancer[x] with size 3
will have
Necromancer[1]
Necromancer[2]
Necromancer[3]

you can increase the size if you want to be as many player as you have.
just make any variable you want, and tick the array box, and choose the size you want.

do you know how to create a variable?

you still didnt mention if you want the aura to stack or not.
in other words, if there is one footman near 2 dark seers, he receive 1 damage or receive 2 damage?
i end this, thx u anyway.
 
Level 16
Joined
May 2, 2011
Messages
1,345
@ShYMs0N
Dynamic indexing will allow the spell to be MUI, it's what Map Designer is trying to convey to you.
Follow the tutorials example and you will be set.

If you can't be arsed to do it I don't mind slinging it up, just say the word.
though @ShYMs0N must explain if he want the aura from multiple sources to stack or not. otherwise you might code the un-intended spell and then it will be a shame if he wouldnt use it.
 
Level 4
Joined
Aug 21, 2019
Messages
42
though @ShYMs0N must explain if he want the aura from multiple sources to stack or not. otherwise you might code the un-intended spell and then it will be a shame if he wouldnt use it.
Man I dew it
  • drain iduum
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set VariableSet iddum = (Units of type Dark Seer)
      • Unit Group - Pick every unit in iddum and do (Actions)
        • Loop - Actions
          • Set VariableSet iduum_unit = (Picked unit)
          • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has buff Cruelty Drain ) Equal to True
                • Then - Actions
                  • Unit - Cause iduum_unit to damage circular area after 0.00 seconds of radius 900.00 at (Position of iduum_unit), dealing (Real(((Intelligence of iduum_unit (Include bonuses)) / 10))) damage of attack type Spells and damage type Normal
                • Else - Actions
 
Level 25
Joined
Sep 26, 2009
Messages
2,383
@ShYMs0N Ignoring the memory leaks in that trigger (which could cause performance problems if you had multiple of such periodic triggers or periodic triggers that fire more often), your spell will cause undesired behaviour.

These are the problems:
1.
The action for damaging enemies which you use (Unit - Damage Area) is poorly chosen, as this will deal damage to everyone - enemies and allies of the caster, including the caster himself. So your spell right now does not only damage enemies that have the debuff, but also allies and the caster who do not have the Cruelty Drain buff.

2.
Due to the trigger not checking anything, but just blindly doing "for each Dark Seer in entire map pick every unit in entire map that has 'Cruelty Drain' debuff and for each such picked unit cause damage to everyone in 900 range of currently picked Dark Seer", you will damage a unit multiple times at a given time (instead of only once).
As an example, if you had 2 Dark Seers and 9 units with Cruelty Drain debuff, your one iteration of the period trigger will cause any unit within 900 range of each Dark Seer (including Dark Seers themselves) to take the "INT/10" damage between 9 to 18 times (depending on positions of all units)
 
Last edited:
Level 4
Joined
Aug 21, 2019
Messages
42
@ShYMs0N Ignoring the memory leaks in that trigger (which could cause performance problems if you had multiple of such periodic triggers or periodic triggers that fire more often), your spell will cause undesired behaviour.

These are the problems:
1.
The action for damaging enemies which you use (Unit - Damage Area) is poorly chosen, as this will deal damage to everyone - enemies and allies of the caster, including the caster himself. So your spell right now does not only damage enemies that have the debuff, but also allies and the caster who do not have the Cruelty Drain buff.

2.
Due to the trigger not checking anything, but just blindly doing "for each Dark Seer in entire map pick every unit in entire map that has 'Cruelty Drain' debuff and for each such picked unit cause damage to everyone in 900 range of currently picked Dark Seer", you will damage a unit multiple times at a given time (instead of only once).
As an example, if you had 2 Dark Seers and 9 units with Cruelty Drain debuff, your one iteration of the period trigger will cause any unit within 900 range of each Dark Seer (including Dark Seers themselves) to take the "INT/10" damage between 9 to 18 times (depending on positions of all units)
I tested it and it works good, deals damage only to enemies, summoned units don't take damage.
 
Status
Not open for further replies.
Top