1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

MUI help

Discussion in 'Triggers & Scripts' started by pOke, Aug 21, 2013.

  1. pOke

    pOke

    Joined:
    Mar 24, 2013
    Messages:
    1,102
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Bump... See above :/
     
  2. pOke

    pOke

    Joined:
    Mar 24, 2013
    Messages:
    1,102
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Bump... See Above :/
     
  3. pOke

    pOke

    Joined:
    Mar 24, 2013
    Messages:
    1,102
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Bump...patience is a virtue :)

    To catch anyone up who is looking at this for the first time;

    The Looping trigger posted below is unable to properly deal with multiple instances of the spell.

    Specially the way in which


    Hashtable - Save Handle Of(Last created unit) as Hook_CurrentIndex of Hook_Loop[Hook_CurrentIndex] in Hook_Hashtable


    this is saved is incorrect.

    Currently, one instance will fire and complete properly, if another one is fired while the 1st one is active and this second instance will finish after the first one has finished, a problem occurs where it loses track of the proper dummy units it points to.

    Thanks!

    Trig
    • Hook Loop
      • Events
        • Time - Every 0.03 seconds of game time
      • Conditions
      • Actions
        • Do Multiple ActionsFor each (Integer Hook_CurrentIndex) from 1 to Hook_MaxIndex, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Hooked_Boolean[Hook_CurrentIndex] Equal to (==) False
              • Then - Actions
                • Set Hook_Loop[Hook_CurrentIndex] = (Hook_Loop[Hook_CurrentIndex] + 1)
                • Set TempLoc = (Position of Hook_Caster[Hook_CurrentIndex])
                • Set TempLoc2 = (TempLoc offset by (50.00 x (Real(Hook_Loop[Hook_CurrentIndex]))) towards HookAngle[Hook_CurrentIndex] degrees)
                • Unit - Create 1 Hook for (Owner of Hook_Caster[Hook_CurrentIndex]) at TempLoc2 facing HookAngle[Hook_CurrentIndex] degrees
                • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
                • Hashtable - Save Handle Of(Last created unit) as Hook_CurrentIndex of Hook_Loop[Hook_CurrentIndex] in Hook_Hashtable
                • Game - Display to (All players) the text: Create Link
                • Set TempGroup = (Units within 100.00 of TempLoc2 matching ((((Matching unit) is alive) Equal to (==) True) and ((((Matching unit) is A structure) Equal to (==) False) and ((((Matching unit) is Mechanical) Not equal to (!=) True) and ((Matching unit) Not equal to (!=) Hook_Ca
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TempGroup is empty) Equal to (==) False
                    • Then - Actions
                      • Game - Display to (All players) the text: Hooked
                      • Set Hooked_Boolean[Hook_CurrentIndex] = True
                      • Set MeatHookTarget[Hook_CurrentIndex] = (Random unit from TempGroup)
                      • Custom script: call SetUnitPropWindow(udg_MeatHookTarget[udg_Hook_CurrentIndex], 0)
                        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                          • If - Conditions
                            • (MeatHookTarget[Hook_CurrentIndex] belongs to an enemy of (Owner of Hook_Caster[Hook_CurrentIndex])) Equal to (==) True
                          • Then - Actions
                            • Game - Display to (All players) the text: Hooked Enemy!
                            • Unit - Create 1 Hook for (Owner of Hook_Caster[Hook_CurrentIndex]) at TempLoc2 facing Default building facing (270.0) degrees
                            • Unit - Add a 0.05 second Generic expiration timer to (Last created unit)
                            • Unit - Cause (Last created unit) to damage MeatHookTarget[Hook_CurrentIndex], dealing MeatHook_Dmg[Hook_CurrentIndex] damage of attack type Chaos and damage type Universal
                            • Special Effect - Create a special effect attached to the origin of MeatHookTarget[Hook_CurrentIndex] using Objects\Spawnmodels\Human\HumanBlood\BloodElfSpellThiefBlood.mdl
                            • Special Effect - Destroy (Last created special effect)
                          • Else - Actions
                    • Else - Actions
                • Custom script: call DestroyGroup(udg_TempGroup)
                • Custom script: call RemoveLocation(udg_TempLoc)
                • Custom script: call RemoveLocation(udg_TempLoc2)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Hook_Loop[Hook_CurrentIndex] Greater than or equal to (>=) HookLength[Hook_CurrentIndex]
                    • Then - Actions
                      • Game - Display to (All players) the text: Max Length
                      • Set Hooked_Boolean[Hook_CurrentIndex] = True
                    • Else - Actions
              • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • MeatHookTarget[Hook_CurrentIndex] Not equal to (!=) No unit
                  • Then - Actions
                    • Set TempUnit = (Load Hook_CurrentIndex of Hook_Loop[Hook_CurrentIndex] in Hook_Hashtable)
                    • Custom script: call SetUnitX(udg_MeatHookTarget[udg_Hook_CurrentIndex], GetUnitX(udg_TempUnit))
                    • Custom script: call SetUnitY(udg_MeatHookTarget[udg_Hook_CurrentIndex], GetUnitY(udg_TempUnit))
                    • Game - Display to (All players) the text: Move Unit!
                  • Else - Actions
                • Set TempUnit = (Load Hook_CurrentIndex of Hook_Loop[Hook_CurrentIndex] in Hook_Hashtable)
                • Unit - Remove TempUnit from the game
                • Game - Display to (All players) the text: Remove Unit
                • Set Hook_Loop[Hook_CurrentIndex] = (Hook_Loop[Hook_CurrentIndex] - 1)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Hook_Loop[Hook_CurrentIndex] Less than or equal to (<=) 0
                    • Then - Actions
                      • Game - Display to (All players) the text: Deindexed
                      • Hashtable - Clear all child hashtables of child Hook_Loop[Hook_CurrentIndex] in Hook_Hashtable
                      • Custom script: call SetUnitPropWindow(udg_MeatHookTarget[udg_Hook_CurrentIndex], 1)
                      • Set Hook_Loop[Hook_CurrentIndex] = Hook_Loop[Hook_MaxIndex]
                      • Set MeatHookTarget[Hook_CurrentIndex] = MeatHookTarget[Hook_MaxIndex]
                      • Set MeatHookTarget[Hook_CurrentIndex] = No unit
                      • Set Hooked_Boolean[Hook_CurrentIndex] = Hooked_Boolean[Hook_MaxIndex]
                      • Set Hooked_Boolean[Hook_CurrentIndex] = False
                      • Set Hook_Caster[Hook_CurrentIndex] = Hook_Caster[Hook_MaxIndex]
                      • Set Hook_Caster[Hook_CurrentIndex] = No unit
                      • Set Hook_CurrentIndex = (Hook_CurrentIndex - 1)
                      • Set Hook_MaxIndex = (Hook_MaxIndex - 1)
                    • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Hook_MaxIndex Equal to (==) 0
          • Then - Actions
            • Trigger - Turn off (This trigger)
          • Else - Actions
     
  4. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    you use hashtable and indexing at the same time?
    i wonder if it's fine
     
  5. jakeZinc

    jakeZinc

    Joined:
    Aug 13, 2013
    Messages:
    1,373
    Resources:
    20
    Spells:
    20
    Resources:
    20
    Don't triple post pOke just have a patience ;). Anyway this can be done in hashtable without I'Arr and I see there that you doesn't use unit groups. You can check the spell sections about hooks and review them or make them as your template ;).
     
  6. Assassins-Creed

    Assassins-Creed

    Joined:
    Aug 6, 2009
    Messages:
    660
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Seems like a lot of extra work if you ask me. You don't even have to use indexing to make a hashtable spell MUI. At least I don't believe so.
     
  7. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,685
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
  8. pOke

    pOke

    Joined:
    Mar 24, 2013
    Messages:
    1,102
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I thank you Daffa, while I've already attempted to use these as a spring board, I've gone back over them while the Phantom takes an "easy" way out with lightning and the Meat Hook GUI MUI removes them all in 1 fell swoop. The Psycho does more of what I'm trying to do, however my original method is the same one it employs and for whatever reason it works for them but not me... >.>

    the
    • Set PHSegment[((i x 100) + PHSegmentMax[i])] = (Last created unit)


    Meaning it saves the unit as the CurrentIndex * 100 + the Link Position, but the problem seems to be that when I decrease the index we lose the unit being pointed to because it goes from being 201 to 101.

    P.S. Jake it's not triple posting when you wait 2+ days in between :)