• 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 seems MUI and OK for you ?

Status
Not open for further replies.
Level 6
Joined
Apr 15, 2016
Messages
118
  • Arrow Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Curtain Call
    • Actions
      • Set ArrowTTLMaxIndex = (ArrowTTLMaxIndex + 1)
      • Set ArrowTTL[ArrowTTLMaxIndex] = (Casting unit)
      • Set ArrowTTLPoint = (Position of ArrowTTL[ArrowTTLMaxIndex])
      • Unit - Set ArrowTTL[ArrowTTLMaxIndex] movement speed to 1.00
      • Unit - Create 1 Sniper Position Arrow for (Owner of ArrowTTL[ArrowTTLMaxIndex]) at ArrowTTLPoint facing Default building facing degrees
      • Set ArrowTTLDummy = (Last created unit)
      • Camera - Set (Owner of ArrowTTL[ArrowTTLMaxIndex])'s camera Height Offset to 900.00 over 0.50 seconds
      • Camera - Pan camera for (Owner of ArrowTTL[ArrowTTLMaxIndex]) to ((Position of ArrowTTL[ArrowTTLMaxIndex]) offset by 400.00 towards 270.00 degrees) over 0.50 seconds
      • Camera - Lock camera target for (Owner of ArrowTTL[ArrowTTLMaxIndex]) to ArrowTTLDummy, offset by (0.00, -720.00) using Default rotation
      • Unit - Remove Arrow from ArrowTTL[ArrowTTLMaxIndex]
      • Unit - Add Arrow Arc True to ArrowTTL[ArrowTTLMaxIndex]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArrowTTLMaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Arrow Loop <gen>
        • Else - Actions
  • Arrow Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer ArrowTTLCurrentIndex) from 1 to ArrowTTLMaxIndex, do (Actions)
        • Loop - Actions
          • Set ArrowTTLPeriod[ArrowTTLCurrentIndex] = (ArrowTTLPeriod[ArrowTTLCurrentIndex] + 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ArrowTTLPeriod[ArrowTTLCurrentIndex] Greater than or equal to 5.00
            • Then - Actions
              • Unit - Kill ArrowTTLDummy
              • Camera - Set (Owner of ArrowTTL[ArrowTTLCurrentIndex])'s camera Height Offset to 0.00 over 0.50 seconds
              • Selection - Clear selection for (Owner of ArrowTTL[ArrowTTLCurrentIndex])
              • Selection - Select ArrowTTL[ArrowTTLCurrentIndex] for (Owner of ArrowTTL[ArrowTTLCurrentIndex])
              • Camera - Lock camera target for (Owner of ArrowTTL[ArrowTTLCurrentIndex]) to ArrowTTL[ArrowTTLCurrentIndex], offset by (0.00, 0.00) using Default rotation
              • Unit - Set ArrowTTL[ArrowTTLCurrentIndex] movement speed to (Default movement speed of ArrowTTL[ArrowTTLCurrentIndex])
              • Unit - Remove Arrow Arc True from ArrowTTL[ArrowTTLCurrentIndex]
              • Unit - Add Arrow to ArrowTTL[ArrowTTLCurrentIndex]
              • Set ArrowTTL[ArrowTTLCurrentIndex] = ArrowTTL[ArrowTTLMaxIndex]
              • Set ArrowTTL[ArrowTTLMaxIndex] = No unit
              • Set ArrowTTLDummy = No unit
              • Set ArrowTTLPeriod[ArrowTTLCurrentIndex] = ArrowTTLPeriod[ArrowTTLMaxIndex]
              • Set ArrowTTLPeriod[ArrowTTLMaxIndex] = 0.00
              • Set ArrowTTLMaxIndex = (ArrowTTLMaxIndex - 1)
              • Set ArrowTTLCurrentIndex = (ArrowTTLCurrentIndex - 1)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ArrowTTLMaxIndex Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
The camera setting you may not worry about, but is this trigger good enough and seems OK for you ? MUI ?

If yes, I might have FINALLY learned how to make a MUI spell :ap:
 
There are a lot of things I can nitpick about in terms of efficiency, but here are some things you should consider:
  • ArrowTTLDummy is not indexed when it should be. Your spell is currently not MUI for this reason

    • Camera - Pan camera for (Owner of ArrowTTL[ArrowTTLMaxIndex]) to ((Position of ArrowTTL[ArrowTTLMaxIndex]) offset by 400.00 towards 270.00 degrees) over 0.50 seconds
    ^leaks a location handle

    • Set ArrowTTL[ArrowTTLMaxIndex] = No unit
    • Set ArrowTTLDummy = No unit
    • Set ArrowTTLPeriod[ArrowTTLMaxIndex] = 0.00[/STABLE]
    ^None of these are needed


    [*]Move the If/Then/Else to the inside of the loop after you decrement MaxIndex and CurrentIndex
    [*]You never remove the ArrowTTLPoint handle, so this will leak a location everytime a new instace is created
 
Status
Not open for further replies.
Top