Trigger Execution Problem

MorbazanRhot

New Member
Reaction score
7
I have a pretty simple question. Why isn't the Loop executing more than once when I cast this spell (I've tried changing the number to 2, and to something based off of the level of the spell, but regardless it always runs just once and ends)? +rep for anything that helps me fix this.

Trigger:
  • Dark
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark
    • Actions
      • Set TempLoc9 = (Target point of ability being cast)
      • Set TempLoc10 = (Target point of ability being cast)
      • Special Effect - Create a special effect at TempLoc9 using Abilities\Spells\Other\Drain\DrainCaster.mdl
      • Set SpecialEffect[1] = (Last created special effect)
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Wait 1.00 game-time seconds
          • Special Effect - Create a special effect at TempLoc10 using Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Create 1 Dummy for (Owner of TheChanneler) at TempLoc9 facing Default building facing (270.0) degrees
          • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
          • Unit - Add Dark(dummy) to (Last created unit)
          • Unit - Set level of Dark(dummy) for (Last created unit) to (Level of Dark for (Triggering unit))
          • Set GroupVar4 = (Units within 900.00 of TempLoc9 matching ((((Owner of (Matching unit)) is an enemy of (Triggering player)) Equal to True) and (((Matching unit) is alive) Equal to True)))
          • Set UnitVarPicked2 = (Random unit from GroupVar4)
          • Unit - Order (Last created unit) to Orc Far Seer - Chain Lightning UnitVarPicked2
          • Custom script: call DestroyGroup (udg_GroupVar4)
      • Special Effect - Destroy SpecialEffect[1]
      • Custom script: call RemoveLocation (udg_TempLoc9)
      • Custom script: call RemoveLocation (udg_TempLoc10)
 

MorbazanRhot

New Member
Reaction score
7
Alright, first I tried moving the wait until the end of the Loop, still experienced the same problem. Then I removed it entirely and it worked fine. The thing is, in order for the spell to function the way I'd like that wait really is crucial. I could switch it to 2 separate triggers and use another Every 1 Second of Game-time trigger but I'd really prefer to not do that if I don't have to (and quite frankly, I can't see anything in this trigger that the wait is screwing up). So can anyone tell me what's getting screwed up by the wait? Or possibly any way to fix this without making another separate trigger?
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
590
# Custom script: call DestroyGroup (udg_GroupVar4)
You attempt to reuse something dead. You never destroy globals, I suggest clearing the group though.
 

MorbazanRhot

New Member
Reaction score
7
I'm not quite sure what you're saying? I've tried the trigger without the Custom Script line in the Loop and it still only runs once (which would be bad anyway, because the unit group would leak?). And I've used that line to clear groups before and never had a problem using them again.

Like I said, I probably just don't understand what you're saying, sorry.
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
You may not destroy an unexisting group. The variable itself still exists, but it has no value, so basically you're destroying an unexisting group and the function stops, because whenever something goes wrong the function stops.
 

MorbazanRhot

New Member
Reaction score
7
But if I remove that line (Custom script: call DestroyGroup (udg_GroupVar4)) from the Loop it still only executes once (provided the wait still exists). So how does that relate?
 

Exide

I am amazingly focused right now!
Reaction score
448
How do you know that it only runs once?
Add a message saying 'Success!' inside the loop, and see how many times the message appear.

-Make sure that the cooldown on the Chain lightning spell that your dummy is supposed to cast is something like 0.01.
-Don't remove the Custom script: call DestroyGroup(udg_GroupVar4) action.
-Do remove TempLoc10, and use TempLoc9 instead.

EDIT: Change this
Trigger:
  • Set GroupVar4 = (Units within 900.00 of TempLoc9 matching ((((Owner of (Matching unit)) is an enemy of (Triggering player)) Equal to True) and (((Matching unit) is alive) Equal to True)))


into:

Trigger:
  • Set GroupVar4 = (Units within 900.00 of TempLoc9 matching ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True) and (((Matching unit) is alive) Equal to True)))


(Triggering Player) = (Owner of (Triggering Unit))
 

MorbazanRhot

New Member
Reaction score
7
Tried the text method of testing the number of times it runs, only ran once. Fixed the Triggering Player mistake, but it didn't actually fix the trigger. Also cut down to 1 point variable. So I'm still stumped.

Is it possible there could be something else in the map affecting how this trigger runs (these variables are only used in this trigger though, I originally used replaceable ones but gave this trigger its own when it wouldn't work properly)?
 

Exide

I am amazingly focused right now!
Reaction score
448
The only thing I can think of is that you're looping something else at the same time.
-Try using an Integer that is specially created for this loop.

You can also upload your map, if you don't mind.
 

MorbazanRhot

New Member
Reaction score
7
Thank you so much! There must be something else looping at the same time (although as of right now, I'm not quite sure what) because giving it its own variable solved the problem (and that makes sense with the wait being the problem too). Already gave you and everyone else that helped out +rep a while ago. Thanks again.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Howdy
  • 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 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