• 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 problem===

Status
Not open for further replies.
Level 33
Joined
Mar 27, 2008
Messages
8,035
Can someone tell me WHAT determines the FIRST caster of the ability

  • Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Order Blood Mage 0000 <gen> to Night Elf Druid Of The Claw - Roar
      • Unit - Order Blood Mage 0052 <gen> to Night Elf Druid Of The Claw - Roar
As you can see, Blood Mage 0000 is the first in order BUT the effect will go to the second unit, Blood Mage 0052
So, my question is WHAT will determine which unit is the first to cast the ability ? (well, this question is for non-MUI trigger)

For the following trigger, it is not MUI
Can someone help me to make it MUI and if you can, please explain this and that and maybe tips to help me and also, others, hope so

  • Plasma Gravity Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Plasma Gravity
    • Actions
      • Set Caster = (Triggering unit)
      • Set CasterLoc = (Position of Caster)
      • Set Duration = 3.00
      • Set AOE = (Units within 1000.00 of CasterLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True)))
      • Unit Group - Pick every unit in AOE and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
      • Custom script: call DestroyGroup(udg_AOE)
      • Trigger - Turn on Plasma Gravity Loop <gen>
  • Plasma Gravity Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set Duration = (Duration - 0.03)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Duration Greater than 0.00
        • Then - Actions
          • Set AOE = (Units within 1000.00 of CasterLoc matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of Caster)) Equal to True)))
          • Unit Group - Pick every unit in AOE and do (Actions)
            • Loop - Actions
              • Set PickedUnit = (Picked unit)
              • Set PickedUnitLoc = (Position of PickedUnit)
              • Unit - Move PickedUnit instantly to (PickedUnitLoc offset by 10.00 towards (Angle from CasterLoc to PickedUnitLoc) degrees)
          • Custom script: call RemoveLocation(udg_PickedUnitLoc)
          • Custom script: call DestroyGroup(udg_AOE)
        • Else - Actions
          • Custom script: call RemoveLocation(udg_CasterLoc)
          • Trigger - Turn off (This trigger)
I've attached a test map for easier preference
Please update the test map and post it in your reply so I/we can download it and test it
+rep is all I can give =D
 

Attachments

  • Plasma Gravity.w3x
    16.1 KB · Views: 51
Level 12
Joined
Jan 30, 2009
Messages
1,067
Yeah, you have to set the last unit to use it to a variable and use that. Otherwise it will do it according to the last unit to cast the ability.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
The effect in your map goes for the last unit to cast it, since the spell isn't MUI.

EDIT: Updated map.

So, "Last bla bla bla unit" will determine the effect of the spell/trigger, correct ?
The last in order was Blood Mage 0052, which is my enemy...
Will check the trigger and leave comments =D

EDIT:
OMG, too many custom scripts !!!
Can someone make it more in a GUI way ?
Indexing looks easier than hashtables since it doesn't require the usage of too many custom scripts !
SaveReal(udgo[k[aopk'[dk'ap[ko) OMG !
But thanks for the edit Maker !
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
That's only if you're using JNGP, Def, as Hashtables don't seem to work in GUI for JNGP.

If you're using regular WE, you'll be able to get away with it, I guess.
 
Ghost to the rescue...
I can supply a map if needed.

  • PG Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Roar
    • Actions
      • Set PG_Int[1] = (PG_Int[1] + 1)
      • Set PG_Int[2] = (PG_Int[2] + 1)
      • Set PG_On[PG_Int[1]] = True
      • Set PG_Time[PG_Int[1]] = 3.00
      • Set PG_Timer[PG_Int[1]] = 0.00
      • Set PG_Caster[PG_Int[1]] = (Triggering unit)
      • Set CasterLoc[PG_Int[1]] = (Position of (Triggering unit))
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 1000.00 of CasterLoc[PG_Int[1]] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))) and do (Actions)
        • Loop - Actions
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\Thunderclap\ThunderClapCaster.mdl
          • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn on PG Loop <gen>
  • PG Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer PG_Int[3]) from 1 to PG_Int[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PG_On[PG_Int[3]] Equal to True
              • PG_Timer[PG_Int[3]] Greater than or equal to PG_Time[PG_Int[3]]
            • Then - Actions
              • Set PG_On[PG_Int[3]] = False
              • Set PG_Int[2] = (PG_Int[2] - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PG_Int[2] Equal to 0
                • Then - Actions
                  • Set PG_Int[1] = 0
                • Else - Actions
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PG_On[PG_Int[3]] Equal to True
                • Then - Actions
                  • Set PG_Timer[PG_Int[3]] = (PG_Timer[PG_Int[3]] + 0.03)
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within 1000.00 of CasterLoc[1] matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True))) and do (Actions)
                    • Loop - Actions
                      • Set temp_point = (Position of (Picked unit))
                      • Unit - Move (Picked unit) instantly to (temp_point offset by 10.00 towards (Angle from CasterLoc[PG_Int[3]] to temp_point) degrees)
                      • Custom script: call RemoveLocation(udg_temp_point)
                • Else - Actions
 
It is just indexing, but the PG_Int is confusing. I couldn't be bothered making 'PG_Index', 'PG_Skip', and 'PG_Loop', so I combined them into one array variable.
PG_1 = index (the current max array)
PG_2 = skip (the current amount of total arrays)
PG_3 = loop (an integer to replace Integer A, to remove some bugs)

Btw, my triggers aren't bugged (I copied yours, but made them indexed), I believe that you set the angle wrong, so it is pushing instead of pulling (unless you wanted that effect).
 
Last edited:
Status
Not open for further replies.
Top