Any way to delete an event from a trigger via action?

naughty

New Member
Reaction score
12
I need to delete events from a trigger because i have a spell that adds events to a trigger for regions but after a while i don't want that trigger to work for those regions anymore so i want to delete those events. Is there any way?
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
not in GUI, thats called event leaks.

but most likely if you tell us what you want to make we can tell you how to make it without adding events.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
To my knowledge, there is no way to delete events. I think I'd need more information about what you are doing to try finding a workaround.
 

naughty

New Member
Reaction score
12
Well my spells creates regions between trees and adds an event to another trigger "Trigger - Add to Unit Comes To Trap <gen> the event (Unit - A unit enters R_Troll[(Integer A)])". Its supposed to be a trap if the unit passes through there to take damage and so on. But after 30 seconds those regions should be removed and nothing should happen if a unit passes there anymore. However i cant make that work even though i use "Custom script: call RemoveRect(udg_R_Troll[GetForLoopIndexA()])" and "Custom script: set udg_R_Troll[GetForLoopIndexA()] = null", still if the unit passes through those regions the spell will activate.... I did it with adding an event for a unit comes to a unit but the game kinda lags like that with so much units...
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
889
You might just try using a boolean variable. Spell_On or so. When the spell is cast, set it to True, and after a certain amount of time, set it to False. In the trigger with the region entering, check to make sure that Spell_On is set to True before running the actions.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
i'd say adding events here is a really bad thing to do, it will leak twice.
not just the event but the region as well since the event will create its own region which cannot be destroyed anymore.

can you use circles instead of rects? would make things alot easier.

otherwise you might want to run a periodic event checking for every unit within the rect. you can make this MUI via hashtable use too.
 

naughty

New Member
Reaction score
12
i'd say adding events here is a really bad thing to do, it will leak twice.
not just the event but the region as well since the event will create its own region which cannot be destroyed anymore.

can you use circles instead of rects? would make things alot easier.

otherwise you might want to run a periodic event checking for every unit within the rect. you can make this MUI via hashtable use too.

how can i use circles? i don't know how will i detect if a unit comes to that circle if not by adding a new event or by using regions. i must use a periodic event for 0.01 second because i want it to happen immediately which i think for so much circles will cause lag
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
i'd say use a dummy unit with permanent immolation dealing 0.01 points of damage every 0.25 (or whatever) seconds.

then your trigger might look like,
Event
unit takes damage
Condition
damage source == MyDummyUnit
Action
do stuff

this would be by far the best solution for circle based detection though it would require a damage detection system (Weeps GDD (GUI-Friendly-Damagedetection) is recommended)
 

naughty

New Member
Reaction score
12
sorry man but your solution does not help me because i have pushing spells that move the unit very very fast and every 0.25 seconds is very low to detect that. to detect that speed i will need 0.01 second which will cause lag and will deal too much damage if the unit normally passes through it because it will happen at least 5 times till the unit moves those 30 points..also i don't want the unit to take damage if its standing there i want when the unit will only pass there ... i still think i'll stick with the leaking option...however its an ultimate spell with a lot of cooldown. i don't think it can cause so much leaks
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
first of all, you can set the intervalls for the permanent immolation skill to whatever you like, even 0.01

the damage might be set to 0.00 either but i dont know for sure, however 0.01 points of damage will most probably deal nothing at all since the game will round it down.

and for a pushback, the event "unit enters rect" isnt the right think either, you said you want your trigger to fire when a unit enters a specific position not periodically.
 

gaskell

Member
Reaction score
0
could you just make a trigger to turn on and off the required trigger when conditions (or time) is reached.
sooo you start with the trigger off and have a trigger that enables it when blah blah happens (game time, periodic, unit does blah blah) then start a timer and a trigger to disable the trigger when that timer expires?
Would that work?
 

RangerX

I am justice!
Reaction score
69
ok create a dummy goblin mine trap and a dummy "Mine - exploding" ability change it's activation delay to 0.01 and transition to 0.01 then when it dies it gives damage and than create another mine in the same place and use some boolean to check if the creating mine trigger should still work and offcorse you can add some buff to all the damaged units so it's not getting new damage if it just sit
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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