• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Invisibility only works once on a unit...

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
update: SOLVED

I am updating my Star Wars map. I have an ability that jams radar when cast, but if cast after you've punched in your auxiliary power will turn you invisible.

The trigger is given below:

  • Jamming
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Jamming
    • Actions
      • Set tempUnit = (Triggering unit)
      • -------- -----check for Auxilary------ --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (tempUnit has buff Auxiliary Power) Equal to True
          • ((Owner of tempUnit) is in Rebels) Equal to True
        • Then - Actions
          • -------- invisibility! --------
          • Unit - Remove Auxiliary Power buff from tempUnit
          • Custom script: call MoveLocation(udg_LocationMove1, GetUnitX(udg_tempUnit), GetUnitY(udg_tempUnit))
          • Unit - Create 1 dummy caster for (Owner of (Triggering unit)) at LocationMove1 facing (Facing of (Triggering unit)) degrees
          • Game - Display to (All players) the text: (ordered: + (Name of (Last created unit)))
          • Unit - Order (Last created unit) to Human Sorceress - Invisibility tempUnit
          • Game - Display to (All players) the text: (target: + (Name of tempUnit))
        • Else - Actions
  • Untitled Trigger 001 Copy Copy 2
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(invisibility))
    • Actions
      • Game - Display to (All players) the text: ordered
Here's what happens:

You punch in your auxiliary power and cast "Jam." Everything works. You turn invisible and you read all the text you would expect.

After a while, the ability stops working. The Jam trigger does fire. The dummy caster is created because I see: "ordered: dummy caster" and I see "target: Runner." But the odd thing is, the second trigger does NOT fire. I never see "ordered" and the unit does not go invisible.

This means that a dummy unit is being created, told to cast invisibility on a unit with the line:

  • Unit - Order (Last created unit) to Human Sorceress - Invisibility tempUnit
But a trigger with this event and condition:

  • Untitled Trigger 001 Copy Copy 2
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(invisibility))
...does not fire.

I don't know how I can order a unit to cast invisibility but not trigger an event that is caused by a unit ordered to cast invisibility!

The dummy unit has mana, and invisibility has no requirements, a very long range, and so forth. After all, the spell does start working just fine.

I'm afraid I'm really stumped on this one... does anyone have any ideas on why this would work and then just stop working?

Darwin

********************************

UPDATE:

Well this is entirely embarrassing! I forgot that I used the magic defense ability as the template for my link or unlink fire. I was linking my fire and accidentally making my unit magic immune.
 
Last edited:
Level 12
Joined
May 20, 2009
Messages
822
Just add permanent invisibility or ghost to the unit instead of making a dummy unit to cast invisibility on the unit.

It functions a bit differently, but you can script it to work the way you want it to. (As in if your invisible unit attacks, remove the ability.)

Then if you need the buff, just use Berserk as the base spell or something and set all it's stats to 0.
 
Status
Not open for further replies.
Top