• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Is this MUI?

Status
Not open for further replies.
Level 1
Joined
Feb 26, 2012
Messages
4
  • Events
    • Unit - A unit owned by Player 1 (Red) Begins channeling an ability
    • Unit - A unit owned by Player 2 (Blue) Starts the effect of an ability
    • Unit - A unit owned by Player 3 (Teal) Starts the effect of an ability
    • Unit - A unit owned by Player 4 (Purple) Starts the effect of an ability
    • Unit - A unit owned by Player 5 (Yellow) Starts the effect of an ability
    • Unit - A unit owned by Player 6 (Orange) Starts the effect of an ability
    • Unit - A unit owned by Player 7 (Green) Starts the effect of an ability
    • Unit - A unit owned by Player 8 (Pink) Starts the effect of an ability
    • Unit - A unit owned by Player 9 (Gray) Starts the effect of an ability
    • Unit - A unit owned by Player 10 (Light Blue) Starts the effect of an ability
    • Unit - A unit owned by Player 11 (Dark Green) Starts the effect of an ability
    • Unit - A unit owned by Player 12 (Brown) Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to [Demon Mage] Rain of Chaos
  • Actions
    • Set RoCIndex = (RoCIndex + 1)
    • Set RoCIndex2 = RoCIndex
    • Set RoCaster[RoCIndex2] = (Triggering unit)
    • Set RoCPoint[RoCIndex2] = (Position of (Triggering unit))
    • Set RoCInteger[RoCIndex2] = (Level of [Demon Mage] Reign of Chaos for RoCaster[RoCIndex2])
    • For each (Integer RoCLoop[RoCIndex2]) from 1 to (2 + (3 x RoCInteger[RoCIndex2])), do (Actions)
      • Loop - Actions
        • Unit - Create 1 Peasant for (Triggering player) at RoCPoint[RoCIndex2] facing Default building facing degrees
        • Unit - Add [Demon Mage] Inferno to (Last created unit)
        • Unit - Set level of [Demon Mage] Inferno for (Last created unit) to RoCInteger[RoCIndex2]
        • Unit - Order (Last created unit) to Undead Dreadlord - Inferno (Random point in Creep Spawn <gen>)
        • Unit - Add a 0.75 second Generic expiration timer to (Last created unit)
        • Wait 0.40 seconds
    • Set RoCIndex = (RoCIndex - 1)
    • Custom script: call RemoveLocation (udg_RoCPoint[udg_RoCIndex2])


Help will be appreciated and if anybody can tell me how to post triggers in a forums I would appreciate that too.

>[Peaseant refers to my dummy caster]
>>[Forget the leaks, I can solve them]
>>>[What I am doing is just triggering "Rain of Chaos (Archimode)""
 
Last edited:
1. use tags but dont use space like me :P
[ trigger ] [ / trigger ] - trigger
[ jass ] [ / jass] - jass
[ hidden = my trigger ] [ trigger ] asdasd [ / trigger ] [ / hidden] - if something long then hide tthis way
[ QUOTE ] [ / QUOTE]
[ CODE ] [ / CODE]

2. why u use wait if u use expiration timer? i dont think wait inside a loop is good, if u need badly delay between effect just do a timer
3. one side it seems mui but dont forget max index is 8192 if i remember well, u allways increase with 1 but never decrease, maybe try use something like this
https://www.hiveworkshop.com/forums/2105466-post6.html
 
Protip: If you ever have to use 12 different player-specific events instead of one generic event (for example, if you're doing "Player # skips a cinematic sequence" or "Player # types a chat message"), you can save yourself some precious time and sanity by leaving the event blank and making a second trigger like this:


  • Map Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Trigger <gen> the event (Player - (Player((Integer A))) types a chat message containing SHORTCUT as An exact match)
Especially useful if you have a lot of chat commands and such in your map.



Main topic: Your trigger is making my brain hurt a little. Unless I'm missing something (Please tell me if I am, don't want to seem presumptuous), your indexing system doesn't actually accomplish anything and isn't making the trigger MUI, because RoCIndex2 can still be overwritten.
 
  • Events
    • Unit - A unitStarts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to [Demon Mage] Rain of Chaos
  • Actions
    • Custom Script : local unit u = GetTriggerUnit()
    • Custom Script : local location l = GetUnitPosition(u)
    • Custom Script : local integer i = IDontKnowHowToWriteLevelOfAbilityInJass
    • Custom Script : local integer i2 = 1
    • Custom Script : Custom Script : set udg_TempUnit = u
    • Custom Script : set udg_TempLoc = l
    • Custom Script : set udg_TempInt = i
    • For each (Integer TempInt2) from 1 to (2 + (3 x TempInt)), do (Actions)
      • Loop - Actions
        • Custom Script : set udg_TempUnit = u
        • Custom Script : set udg_TempLoc = l
        • Custom Script : set udg_TempInt = i
        • Variable - Set TempLoc2 = (Random point in Creep Spawn)
        • Unit - Create 1 Peasant for (Triggering player) at TempLoc facing Default building facing degrees
        • Unit - Add [Demon Mage] Inferno to (Last created unit)
        • Unit - Set level of [Demon Mage] Inferno for (Last created unit) to TempInt
        • Unit - Order (Last created unit) to Undead Dreadlord - Inferno (TempLoc2)
        • Unit - Add a 0.75 second Generic expiration timer to (Last created unit)
        • Wait 0.40 seconds
        • Custom Script : set i2 = i2 + 1
        • Custom Script : set udg_TempInt2 = i2
        • Custom script: call RemoveLocation (udg_TempLoc2)

done. screw the inferior form of GUI indexing.

e/ heres a finished trigger that actually compiles (except i used animate dead)

  • Yes
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Custom script: local unit u = GetTriggerUnit()
      • Custom script: local location l = GetUnitLoc(u)
      • Custom script: local integer i = GetUnitAbilityLevel(u,GetSpellAbilityId())
      • Custom script: local integer i2 = 1
      • Custom script: set udg_TempUnit = u
      • Custom script: set udg_TempLoc = l
      • Custom script: set udg_TempInt = i
      • For each (Integer Temp_Integer) from 1 to (2 + (3 x TempInt)), do (Actions)
        • Loop - Actions
          • Custom script: set udg_TempUnit = u
          • Custom script: set udg_TempLoc = l
          • Custom script: set udg_TempInt = i
          • Unit - Create 1 Mother Rat for (Triggering player) at TempLoc facing Default building facing degrees
          • Unit - Add Animate Dead to (Last created unit)
          • Unit - Set level of Animate Dead for (Last created unit) to TempInt
          • Unit - Order (Last created unit) to Undead Dreadlord - Inferno TempLoc2
          • Unit - Add a 0.75 second Generic expiration timer to (Last created unit)
          • Wait 0.40 seconds
          • Custom script: set i2 = i2 + 1
          • Custom script: set udg_Temp_Integer = i2
          • Custom script: call RemoveLocation(udg_TempLoc2)
 
I thought nulling variables was merely good coding practice and not leaks or anything else.

Not setting temploc2 is an accident...
 
Status
Not open for further replies.
Back
Top