• 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] removing a special effect

Status
Not open for further replies.
Level 10
Joined
Sep 29, 2006
Messages
447
is there a way to immediately remove a special effect that is on a unit without waiting for its death time. for instance, i have the mana shield effect attached to a unit in a trigger and when i want to remove it, i destroy the effect, but since the death time on the effect takes so long it looks very wrong and the mana shield stays there long after it should. can anyone help? I'll post the trigger just in case, although it shouldn't be needed since the trigger itself works fine.

  • Stasis Field New
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stasis Field (Tinker)
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Set TempGroupArray[(Player number of (Owner of (Triggering unit)))] = (Units within 300.00 of TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Unit Group - Pick every unit in TempGroupArray[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Invulnerable
          • Unit - Pause (Picked unit)
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\ManaShield\ManaShieldCaster.mdl
          • Set spfx[(Player number of (Owner of (Triggering unit)))] = (Last created special effect)
          • Set StasisUnit[(Player number of (Owner of (Triggering unit)))] = (Picked unit)
      • Wait (3.00 + (Real((Level of Stasis Field (Tinker) for (Triggering unit))))) seconds
      • Unit - Make StasisUnit[(Player number of (Owner of (Triggering unit)))] Vulnerable
      • Unit - Unpause StasisUnit[(Player number of (Owner of (Triggering unit)))]
      • Special Effect - Destroy spfx[(Player number of (Owner of (Triggering unit)))]
      • Custom script: call DestroyGroup(udg_TempGroupArray[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: set udg_spfx[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = null
 
Level 5
Joined
May 23, 2008
Messages
148
Short answer: no.
Long answer: you might try removing the unit totally and recreating it without the effect (amagad, I would give up already) OR try with the dummy crap (THAT is an overkill, you'd have to control every animation and every move it makes, ugh).

Smart answer anybody?
 
Level 11
Joined
Dec 31, 2007
Messages
780
make it inside the loop like this

  • Stasis Field New
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stasis Field (Tinker)
    • Actions
      • Set INTEGER_VARIABLE = 0
      • Set TempPoint = (Target point of ability being cast)
      • Set TempGroupArray[(Player number of (Owner of (Triggering unit)))] = (Units within 300.00 of TempPoint)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Unit Group - Pick every unit in TempGroupArray[(Player number of (Owner of (Triggering unit)))] and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) Invulnerable
          • Set INTEGER_VARIABLE = INTEGER_VARIABLE + 1
          • Unit - Pause (Picked unit)
          • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\ManaShield\ManaShieldCaster.mdl
          • Set spfx[INTEGER_VARIABLE] = (Last created special effect)
          • Set StasisUnit[(Player number of (Owner of (Triggering unit)))] = (Picked unit)
      • Wait (3.00 + (Real((Level of Stasis Field (Tinker) for (Triggering unit))))) seconds
      • Unit - Make StasisUnit[(Player number of (Owner of (Triggering unit)))] Vulnerable
      • Unit - Unpause StasisUnit[(Player number of (Owner of (Triggering unit)))]
      • For each Integer A to INTEGER_VARIABLE do
        • Loop - Actions
          • Special Effect - Destroy spfx[Integer A]
      • Custom script: call DestroyGroup(udg_TempGroupArray[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
      • Custom script: set udg_spfx[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))] = null
that should do it... else you can try destroying the effect immediately after creating it but i dont know if that is gonna show the way you want to :p

NOW: things you are doing wrong
  • Set StasisUnit[(Player number of (Owner of (Triggering unit)))] = (Picked unit)
it should be like this

  • Set StasisUnit[INTEGER_VARIABLE] = (Picked unit)
this

  • Unit - Make StasisUnit[(Player number of (Owner of (Triggering unit)))] Vulnerable
  • Unit - Unpause StasisUnit[(Player number of (Owner of (Triggering unit)))]
should also look like this

  • Unit - Make StasisUnit[INTEGER_VARIABLE] Vulnerable
  • Unit - Unpause StasisUnit[INTEGER_VARIABLE]
here (for ie: your CASTING UNIT belongs to player 1) you are unpausing stassisUnit 1 but if you have more than 1 unit affected by the spell only the last one is gonna be unpaused

EDIT: i really doubt that your trigger works fine coz you are overwritting info there

so the whole solution should be like this

  • For each Integer A to INTEGER_VARIABLE do
    • Loop - Actions
      • Special Effect - Destroy spfx[Integer A]
      • Unit - Make StasisUnit[Integer A] Vulnerable
      • Unit - Unpause StasisUnit[Integer A]
 
Level 5
Joined
May 23, 2008
Messages
148
Hell yea. I knew it will be this Dummy crap ;]
But, dude make it Life Regeneration Aura (it has no icon displayed but you can add Art-Target). Invulnerability is mmmm a bit too gameplay-affecting?
Also remember to set Allwoed Targets to None.
 
Status
Not open for further replies.
Top