• 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.

Trouble with Ability - Stationary Invis

Status
Not open for further replies.
Level 2
Joined
May 11, 2007
Messages
24
Ok so, my map is progressing, and I'm having trouble creating trigger/abilities for a hero that has the following ability:

Mirri's Guile - Stationary invisibility. Mirri can break stealth in a 400 range by teleporting behind a unit and tripping them, stunning them for 2.5/3/3.5/4 seconds. Moving will also break stealth.

Ok, I created the ability, at first I tried Shadowmeld, but that doesn't work as base for this ability I found out, so I used a generic self buffing ability as a castable spell to activate triggers. Here's the first trigger:
  • Mirris Guile
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Mirri's Guile
    • Actions
      • Set Mirri = (Casting unit)
      • Set Guile = (Position of (Casting unit))
      • Unit - Add Trip to (Casting unit)
      • If ((Level of Mirri's Guile for (Casting unit)) Equal to 1) then do (Unit - Set level of Trip for (Casting unit) to 1) else do (Do nothing)
      • If ((Level of Mirri's Guile for (Casting unit)) Equal to 2) then do (Unit - Set level of Trip for (Casting unit) to 2) else do (Do nothing)
      • If ((Level of Mirri's Guile for (Casting unit)) Equal to 3) then do (Unit - Set level of Trip for (Casting unit) to 3) else do (Do nothing)
      • If ((Level of Mirri's Guile for (Casting unit)) Equal to 4) then do (Unit - Set level of Trip for (Casting unit) to 4) else do (Do nothing)
      • Unit - Create 1 Shadowcaster for (Triggering player) at Guile facing Default building facing degrees
      • Hero - Create Guilewand and give it to (Last created unit)
      • Hero - Order (Last created unit) to use (Last created item) on (Casting unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Guile)
      • Trigger - Run Unguile <gen> (ignoring conditions)
So, what's working is the fact that it does give Mirri the trip ability to use out of stealth, and it does set trip to the correct level, so I'm not worried about that. It also invis's her correctly, I used a dummy caster and item ability to achieve the desired effect.

However, my secondary trigger that checks if she's moved to remove the effect isn't working:

  • Unguile
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
      • (Mirri has buff Mirri's Guile ) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of Mirri) Equal to (Order(move))
        • Then - Actions
          • Unit - Remove Mirri's Guile buff from Mirri
          • Unit - Remove Trip from Mirri
          • Custom script: call RemoveUnit (udg_Mirri)
          • Trigger - Turn off (This trigger)
        • Else - Actions
Now, this is my first trigger that uses another trigger, so I'm not surprised. I haven't worked out the trip trigger, but that's a simple matter of moving Mirri behind the target and removing the trip ability.

Does anyone have any insights into how to get this stationary invisibility to work? o_O

As always, thank you for your time and help. -Lashkor
 
Level 11
Joined
Aug 15, 2004
Messages
710
I suggest you save Mirri's X and Y coordinates to a variable. Then each time you check if her either her present X or Y coordinates are different from the last refresh. If so then break invis. Of course this will fire for all movement, including push back, follow, etc.
 
Level 4
Joined
Jul 30, 2007
Messages
79
instead of doing a timed check have you tried the event a

unit is issued an order

condition
unit has buff Mirri's Guile equal true
Ability being cast not equal to trip

Unit - Remove Mirri's Guile buff from Mirri
Unit - Remove Trip from Mirri


i am just trying to give ideas atm since i don't want to build the entire spell :grin:
 
Level 2
Joined
May 11, 2007
Messages
24
Thanks Magnus, I'll give that a shot :)

Ok - so here's what I've come up with. I tested your idea Magnus, and using all 3 Issued Units Orders (Object/point/no target) as events, I was able to get stealth to break upon movement or attack of another unit. However, I couldn't think of a way to make it so that if trip was used on a unit not within range, she would remain stealthed while running into range.

So I tried something else. I created a region, Guile, that should center itself on Mirri when she uses Mirri's Guile. When she leaves the regions, stealth wears off, and trip is removed. The problem I have here, is that the region is not centering itself upon Mirri. It stays in the pot I put it.

I put it in a location I knew where it was to test it, and upon using the ability, and running into the region, then running out, she loses stealth. But, the location is supposed to move on top of my casting unit. Why isn't it? It seems to be the simplest way to get the trigger to work (I think... I'm sure there's a spell guru out there who can JASS it better than I can think about) but I can't get the region to move. You know... I used to have this problem with SC maps too.

*Shrug* Haunting...
 
Last edited:
Level 2
Joined
May 11, 2007
Messages
24
Ok, now I am additionally having trouble with the Trip portion of the trigger. While I thought it would be a simple blink strike it's turning out to be much more than that. I tried creating the trip ability based off Storm Bolt so I could have the stun.

The problem with that was that if I used the trigger 'Begins casting an ability' in my 'Move Unit to location trigger', it would move Mirri to the unit before the spell finished casting, thus, never stunning the target. If I tried used the Move trigger with the event 'Finishes casting an ability' then She never blinked at all. I couldn't figure that one out, but the stun worked in that case.

So I tried taking out the middleman by using a dummy unit. So I created my items and abilities for the dummy unit, then wrote the following trigger:

  • Trip
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Trip
    • Actions
      • Set Triptarget = (Position of (Targeted unit))
      • Unit - Create 1 Shadowcaster for (Triggering player) at Triptarget facing Default building facing degrees
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Trip for (Casting unit)) Equal to 1
        • Then - Actions
          • Hero - Create Tripwand(1) and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Last created item) on (Target unit of ability being cast)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Trip for (Casting unit)) Equal to 2
        • Then - Actions
          • Hero - Create Tripwand(2) and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Last created item) on (Target unit of ability being cast)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Trip for (Casting unit)) Equal to 3
        • Then - Actions
          • Hero - Create Tripwand(3) and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Last created item) on (Target unit of ability being cast)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Trip for (Casting unit)) Equal to 4
        • Then - Actions
          • Hero - Create Tripwand(4) and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Last created item) on (Target unit of ability being cast)
          • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
        • Else - Actions
      • Unit - Remove Trip from (Casting unit)
      • Unit - Move (Casting unit) instantly to Triptarget
      • Unit - Order (Casting unit) to Attack (Target unit of ability being cast)
      • Custom script: call RemoveLocation (udg_Triptarget)
Couple things happen with this trigger... for instance, in crashes WC3 and causes a fatal error. Before, I had the Unit - Move and Unit - Order commands above the dummy casting, and it wouldn't crash, but after the first time the trigger ran, the location wouldn't be removed as per the script. (I use JASS Newgen editor, so I could tell). Also, the dummy unit never casts the stun. In fact, he's not even created in the right place, because he drops the unused item after his timer is up. I can't tell why that is, but I fear it has to do with the 'target of ability' function.

Any help on getting this to work would be much appreciated.
 
Level 6
Joined
Mar 2, 2006
Messages
306
The problem with that was that if I used the trigger 'Begins casting an ability' in my 'Move Unit to location trigger', it would move Mirri to the unit before the spell finished casting, thus, never stunning the target.
that's what "unit starts the effect of an ability" is for. "Begins casting an ability" is only good for extra checking and canceling the spell.

I tested your idea Magnus, and using all 3 Issued Units Orders (Object/point/no target) as events, I was able to get stealth to break upon movement or attack of another unit. However, I couldn't think of a way to make it so that if trip was used on a unit not within range, she would remain stealthed while running into range.
stationary invisibility can be done that way. i know cause i succeded. although i used at least five events (i thing i also used "unit uses an item" and something else). as for tripping within range, spellcasting will surely break invisibility so you have to re-establish it quickly. just detect tripping, and if it is within range, use "hide unit" action, then re-cast the invisibility spell, then wait a bit (polled wait) and then unhide the hero....

and what's with the wand thingy? why didn't you base the main spell of potion on invisibility (= item temporary invisibility)?
 
Status
Not open for further replies.
Top