periodic eventHello, 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.
Please show what you have atm.
i tried and it dont want to work, u can see triggperiodic 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.
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.
Use
[trigger]
[/trigger]
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
it looks but can u help me?Good. Now you just need to put these two tags before and after your trigger
so it will become like this
Looks pretty neat doesnt it?
It don't deal damage, dont triggs Dark Seer as triggering unit, also floating text because of that always 0In what term it does not work? never deals damage or deals damage to wrong unit?
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.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
Sorry that i am maybe annoying, but i won't work for CASTERS hero types in map. Eh, thx btw maybe someone will helpit works for me just fine.
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.
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)
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 .
You know Custom Hero Survival? If no,what do you mean? more than one hero has the aura?
you can also change the line to
Set AuraTarget = (Units in (Playable map area) matching (((Matching unit) has buff Unholy Aura) Equal to True))
also when I asked above you didnt say it will work for more than one playermap designer said:or there can be more than one unit which has this same aura?
array? can help?just use an array then.
do you want the aura to stack with itself?
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
i end this, thx u anyway.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?
? You mean this is what you need?i end this, thx u anyway.
i mean i tired cos of it, it will deal HERO LEVEL * 2 and will work? You mean this is what you need?
please show your final trigger when you are done x)
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.@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.
Man I dew itthough @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.
I tested it and it works good, deals damage only to enemies, summoned units don't take damage.@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)