• 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] Help with Trigger

Status
Not open for further replies.
Level 5
Joined
Sep 10, 2006
Messages
185
I'm making it so when a unit is attacked by a lightning rod, it has around 8% chance to be stunned for 1 second. The position the unit is being sent to is just for testing atm. The FX are destroyed, but nothing is displayed and the unit does not move.

help appreciated

  • Lightning Rod
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to |c00ffff00Lightning Rod (1)
    • Actions
      • -------- Locals --------
      • Custom script: local unit udg_LightningRodUnit
      • Custom script: local effect udg_LightningRodEffect
      • Custom script: local location udg_LightningRodPos
      • -------- --------
      • Set LightningRodUnit = (Attacked unit)
      • Set LightningRodInt = (Random integer number between 1 and 12)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LightningRodInt Equal to 1
        • Then - Actions
          • Unit - Pause LightningRodUnit
          • Special Effect - Create a special effect attached to the overhead of LightningRodUnit using Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl
          • Set LightningRodEffect = (Last created special effect)
          • Wait 1.00 seconds
          • Unit - Unpause LightningRodUnit
          • Unit - Order LightningRodUnit to Move To (Center of (Playable map area))
          • Game - Display to (All players) the text: (Name of LightningRodUnit)
          • Special Effect - Destroy LightningRodEffect
          • Custom script: call RemoveLocation(udg_LightningRodPos)
        • Else - Actions
      • Custom script: set udg_LightningRodUnit = null
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
After 1.5-2 seconds, remember that wait is inaccurate. Thus the only way to really wait 1 second is to use a timer which would mean JASS for MUI.

And the reason it does not work is I think that you can only use the GUI native bug once. Try upgrading the whole thing to JASS, making it more effecent and not use locals which have global names.

You also leak a non nulled local.
 
Level 4
Joined
Aug 4, 2008
Messages
76
(Correct me if I'm wrong) Check on your locals the custom script if they're written correctly because,they're like rly sensitive and the problem can be caused from a "F" instead of an "f" if u understand what I mean.
 
Status
Not open for further replies.
Top