• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Trying a Shadow Meld (this is my SECOND time trying a MUI trigger)

Status
Not open for further replies.
Level 6
Joined
Apr 15, 2016
Messages
118
Trying a Shadow Meld that works DURING DAY.
  • Meld Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hide Meld Channel
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MeldHideMaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn on Meld Loop <gen>
        • Else - Actions
      • Set HIdeMeldCaster[MeldHideMaxIndex] = (Casting unit)
      • Set HIdeMeldCasterPos = (Position of HIdeMeldCaster[MeldHideMaxIndex])
      • Unit - Add Permanent Invisibility to HIdeMeldCaster[MeldHideMaxIndex]
      • Custom script: call RemoveLocation(udg_HIdeMeldCasterPos)
  • Meld Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HIdeMeldCurrentIndex) from 1 to MeldHideMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of HIdeMeldCaster[HIdeMeldCurrentIndex]) Not equal to MeldOrder
            • Then - Actions
              • Unit - Remove Permanent Invisibility from HIdeMeldCaster[HIdeMeldCurrentIndex]
            • Else - Actions
              • Set HIdeMeldCaster[HIdeMeldCurrentIndex] = HIdeMeldCaster[MeldHideMaxIndex]
              • Set MeldHideMaxIndex = (MeldHideMaxIndex - 1)
              • Set HIdeMeldCurrentIndex = (HIdeMeldCurrentIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MeldHideMaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
Please go easy, my second time trying. Is the indexing good ? Or a completly CRAPPY and I should kill myself ? It's not working when the order is canceled and the Perma Invisibility is not being removed. The Order is Channel.

OBS: The HideCurrentIndex is not "invisible"... I mean, its value is 0 and not "-none-" as most of the pro spellmakers variables (somehow they make the Variable invisible, mean, when you try edit it, it doesn't show what kind of variable is it, you can't press ok, etc. you just can't mess).
 
Level 18
Joined
May 11, 2012
Messages
2,108
  • Meld Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hide Meld Channel
    • Actions
      • Set MeldHideMaxIndex = (MeldHideMaxIndex + 1)
      • Set HIdeMeldCaster[MeldHideMaxIndex] = (Triggering unit)
      • Unit - Add Permanent Invisibility to HIdeMeldCaster[MeldHideMaxIndex]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MeldHideMaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Meld Loop <gen>
        • Else - Actions
  • Meld Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HIdeMeldCurrentIndex) from 1 to MeldHideMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of HIdeMeldCaster[HIdeMeldCurrentIndex]) Not equal to MeldOrder
            • Then - Actions
              • Unit - Remove Permanent Invisibility from HIdeMeldCaster[HIdeMeldCurrentIndex]
              • Set HIdeMeldCaster[HIdeMeldCurrentIndex] = HIdeMeldCaster[MeldHideMaxIndex]
              • Set HIdeMeldCaster[MeldHideMaxIndex] = (No Unit)
              • Set MeldHideMaxIndex = (MeldHideMaxIndex - 1)
              • Set HIdeMeldCurrentIndex = (HIdeMeldCurrentIndex - 1)
            • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • MeldHideMaxIndex Equal to 0
      • Then - Actions
        • Trigger - Turn off (This trigger)
      • Else - Actions
You don't that location there.
This is the correct way and this should work properly (if the order string is correct AND the order is recognized by trigger). Any questions ask me. :)
 
I find it completely unnecessary to check if your MaxIndex == 0 after every loop function. It makes more sense to only check it when you actually decrement it. You also don't need to set Caster[] to No unit.

Other than that, BloodDrunk's trigger will fix your other problems. Here it is slightly modified to what I said above:
  • Meld Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hide Meld Channel
    • Actions
      • Set MeldHideMaxIndex = (MeldHideMaxIndex + 1)
      • Set HIdeMeldCaster[MeldHideMaxIndex] = (Triggering unit)
      • Unit - Add Permanent Invisibility to HIdeMeldCaster[MeldHideMaxIndex]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MeldHideMaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Meld Loop <gen>
        • Else - Actions

  • Meld Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer HIdeMeldCurrentIndex) from 1 to MeldHideMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of HIdeMeldCaster[HIdeMeldCurrentIndex]) Not equal to MeldOrder
            • Then - Actions
              • Unit - Remove Permanent Invisibility from HIdeMeldCaster[HIdeMeldCurrentIndex]
              • Set HIdeMeldCaster[HIdeMeldCurrentIndex] = HIdeMeldCaster[MeldHideMaxIndex]
              • Set MeldHideMaxIndex = (MeldHideMaxIndex - 1)
              • Set HIdeMeldCurrentIndex = (HIdeMeldCurrentIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MeldHideMaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top