• 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] Simple trigger won't work.

Status
Not open for further replies.
Level 5
Joined
Sep 10, 2006
Messages
185
I'm making a trigger for a tower, that a second after being attacked, the units will become intoxicated by toxic sludge, and this is what I've made... however it doesn't work. (Tried to make it MUI)

=[ any ideas? Any glaring mistakes?

  • Sewage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Ancient of Wonders
      • (Owner of (Attacked unit)) Equal to Player 10 (Light Blue)
    • Actions
      • -------- Locals --------
      • Custom script: local unit udg_SewageDummy
      • Custom script: local unit udg_SewageTarget
      • Custom script: local location udg_SewagePosCast
      • -------- Set Variables --------
      • Set SewageTarget = (Attacked unit)
      • Set SewagePosCast = (Position of (Attacking unit))
      • Unit - Create 1 Toxic Sewage (Dummy) for (Owner of (Attacking unit)) at SewagePosCast facing (Facing of (Attacking unit)) degrees
      • Set SewageDummy = (Last created unit)
      • -------- Action --------
      • Unit - Add Toxic Sludge (Poison, Sewage) Dummy to SewageDummy
      • Wait 1.00 seconds
      • Unit - Order SewageDummy to Neutral Alchemist - Acid Bomb SewageTarget
      • -------- Leak Clean up --------
      • Custom script: call RemoveLocation(udg_SewagePosCast)
      • -------- Null locals --------
      • Custom script: set udg_SewagePosCast = null
      • Custom script: set udg_SewageDummy = null
      • Custom script: set udg_SewageTarget = null
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
  • Sewage
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Ancient of Wonders
      • (Owner of (Attacked unit)) Equal to Player 10 (Light Blue)
    • Actions
      • -------- Locals --------
      • Custom script: local unit udg_SewageDummy
      • Custom script: local unit udg_SewageTarget
      • Custom script: local location udg_SewagePosCast
      • -------- Set Variables --------
      • Set SewageTarget = (Attacked unit)
      • Set SewagePosCast = (Position of (Attacking unit))
      • Unit - Create 1 Toxic Sewage (Dummy) for (Owner of (Attacking unit)) at SewagePosCast facing (Facing of (Attacking unit)) degrees
      • Set SewageDummy = (Last created unit)
      • -------- Action --------
      • Unit - Add Toxic Sludge (Poison, Sewage) Dummy to SewageDummy
      • Wait 1.00 seconds
      • Unit - Order SewageDummy to Neutral Alchemist - Acid Bomb SewageTarget
      • -------- Leak Clean up --------
      • Custom script: call RemoveLocation(udg_SewagePosCast)
      • -------- Null locals --------
      • Custom script: set udg_SewagePosCast = null
      • Custom script: set udg_SewageDummy = null
      • Custom script: set udg_SewageTarget = null
 
Level 5
Joined
Sep 10, 2006
Messages
185
Dummy unit spawns, just doesn't do anything.

Gave the unit 1000 mana init / mana max... and made the spell free to boot. He just won't cast it.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
The problem is that you can make only one GUI global local variable per GUI trigger.
So out of:
Custom script: local unit udg_SewageDummy
Custom script: local unit udg_SewageTarget
Custom script: local location udg_SewagePosCast
Only the first works.
Convert to text, rename the variables to be really local and correct their names when they are used.
 
Last edited:
Status
Not open for further replies.
Top