Stealth Attack not Triggering Properly

bYo

New Member
Reaction score
5
Hi guys, I would be grateful if any of you could help me out on this one. I have a move called Stealth Attack, which is based off the ability Orc > Windwalk. The basic idea is that the unit goes invisible for a certain amount of time (20, 40 and 60 seconds for each level) and gains bonus agility until they attack a target or the time runs out. However, they retain the agility for 10s afterwards, before resetting back to normal.

I triggered all this and it was working perfectly fine until I spotted a bug which allowed you to permanently gain agility. In fixing this, now suddenly the agility gain refuses to work. I've got four triggers for this skill. All triggers except the first are initially off.

Initiating Trigger
Trigger:
  • Stealth Attack Initiate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Stealth Attack2
    • Actions
      • Set Rogue_Agi_Original = (Agility of (Triggering unit) (Exclude bonuses))
      • Trigger - Turn on Stealth Attack Removal <gen>
      • Trigger - Turn on Stealth Attack Timer <gen>
      • Unit Group - Pick every unit in (Units of type Rogue) and do (Actions)
        • Loop - Actions
          • Floating Text - Create floating text that reads Melding... above (Casting unit) with Z offset 2.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 50.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Trigger - Run Stealth Attack Timer <gen> (checking conditions)
      • Wait 2.00 seconds
      • Trigger - Turn on Stealth Attack Damage <gen>


Agility Gain Trigger

Trigger:
  • Stealth Attack Damage
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Rogue) and do (Actions)
        • Loop - Actions
          • Hero - Modify Agility of (Picked unit): Add ((Level of Stealth Attack2 for (Picked unit)) x 10)
          • Floating Text - Create floating text that reads (String(((Level of Stealth Attack2 for (Picked unit)) x 10))) above (Picked unit) with Z offset 2.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
          • Floating Text - Set the velocity of (Last created floating text) to 50.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds


Attack Removal Trigger

Trigger:
  • Stealth Attack Removal
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Rogue
    • Actions
      • Unit - Remove Stealth Attack2 from (Attacking unit)
      • Trigger - Turn off Stealth Attack Damage <gen>
      • Trigger - Turn off Stealth Attack Timer <gen>
      • Wait 10.00 seconds
      • Unit Group - Pick every unit in (Units of type Rogue) and do (Actions)
        • Loop - Actions
          • Hero - Modify Agility of (Attacking unit): Set to Rogue_Agi_Original
          • Unit - Add Stealth Attack2 to (Attacking unit)
      • Trigger - Turn off (This trigger)


Time Elapsed Trigger

Trigger:
  • Stealth Attack Timer
    • Events
    • Conditions
    • Actions
      • Wait ((Real((Level of Stealth Attack2 for (Picked unit)))) x 20.00) seconds
      • Unit Group - Pick every unit in (Units of type Rogue) and do (Actions)
        • Loop - Actions
          • Hero - Modify Agility of (Picked unit): Set to Rogue_Agi_Original
      • Trigger - Turn off Stealth Attack Damage <gen>
      • Trigger - Turn off Stealth Attack Removal <gen>
      • Trigger - Turn off (This trigger)



Thumbs up if you've managed to read through this wall of triggering. Would be grateful for any help, but thanks in advance because I know how good you guys are :p.
 

jig7c

Stop reading me...-statement
Reaction score
123
i believe waits are screwing this up... this spell is not MUI.. how many Rogue units u got in the map that are casting this at once?

change this:
Trigger:
  • Trigger - Turn on Stealth Attack Timer <gen>

to
Trigger:
  • Countdown Timer - Start Stealth Attack Timer as one shot timer that will expire in ((Real((Level of Stealth Attack2 for (Picked unit)))) x 20.00) seconds


and for the stealth attack timer, in the events, use
Stealth Attack Timer expires

Note: if you use a countdown timer, remove the very last action line from the 4th trigger, Trigger - Turn off (This trigger)
-----------------------------------------------------------------------------
also instead of this:
Trigger:
  • Unit Group - Pick every unit in (Units of type Rogue) and do (Actions)
    • Loop - Action
s
use:
Trigger:
  • set temp_group = Unit of type Rogue
    • Unit Group - Pick every unit in temp_group and do (Actions)
      • Loop - Actions
    • -----other actions------
    • Custom script: call DestroyGroup(udg_temp_group)

--------------------------------------------------------------------------------
(Level of Stealth Attack2 for (Picked unit) put that in an integer variable... maybe it might help
 

bYo

New Member
Reaction score
5
Phew managed to solve it. Did everything you said (thanks by the way) and it was still screwing up. Finally reworded a few triggers (i think it wasn't detecting 'Triggering Unit' as the Rogue) and made it run the damage trigger and it works.

Haha but just realised every time you level up, you will lose the agility gained from the level. Guess I've got to put that in another Variable triggered when the unit levels up and add that to the set agi amount..

Thanks anyway for replying - +rep.
 

jig7c

Stop reading me...-statement
Reaction score
123
i was gonna ask you that, what happens if the hero levels up whilst he is under stealth attack... i'm glad u got it working.. make sure your use variables and remove them at the end, if not, the lag will start increasing
 

bYo

New Member
Reaction score
5
Haha will do. When I first started triggering the map, I copied somebody elses Creep Respawn system. It was coded at 2 seconds into the game to pick all Neutral Hostile units and record them...and it wasn't a variable. Gave me like 2 mins of lag every time until I finally tracked it down and figured out how to make it leakless.

Thanks for the group leak removal. Do I need to bother with integers at all? Or are they just minimal.
 

jig7c

Stop reading me...-statement
Reaction score
123
integers don't leak :)
only handles do, units, points, items, special effects, and such
integers, reals are good
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top