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

Ability won't be removed

Status
Not open for further replies.
Level 7
Joined
May 15, 2009
Messages
192
Battlehound asking for help again (these posts are getting rarer!).

This time 'round, I have tried to create a sort of Strength-increasing-roar. The ability simply adds an attribute bonus ability to nearby allies when the spell is cast, and then removes the attribute bonus after 12 seconds.

However, the removal of the attribute bonus only works on the very first cast. The first time you cast the ability, it runs smooth as anything. The second time, none of the affected heroes lose the bonus. Which is quite overpowered. Any advice? Help is much appreciated.

  • Invigorating Roar
    • Events
      • Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
      • Unit - A unit owned by Player 2 (Blue) Starts the effect of an ability
      • Unit - A unit owned by Player 3 (Teal) Starts the effect of an ability
      • Unit - A unit owned by Player 4 (Purple) Starts the effect of an ability
      • Unit - A unit owned by Player 5 (Yellow) Starts the effect of an ability
      • Unit - A unit owned by Player 6 (Orange) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Barbarian: Invigorating Roar
    • Actions
      • Set BAR_IR_Tempp = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within 650.00 of BAR_IR_Tempp matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is alive) Equal to True)) and ((((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True) and (((Matching unit) is A Hero) E and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to BAR_IR_Tempg
          • Unit - Add Invigorating Roar Stat Bonus to (Picked unit)
          • Unit - Set level of Invigorating Roar Stat Bonus for (Picked unit) to (Level of (Ability being cast) for (Triggering unit))
          • Countdown Timer - Start BAR_IR_Timer as a One-shot timer that will expire in 12.00 seconds
      • Custom script: call RemoveLocation(udg_BAR_IR_Tempp)
And the revoval trigger:
  • Invigorating Roar Remove
    • Events
      • Time - BAR_IR_Timer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in BAR_IR_Tempg and do (Actions)
        • Loop - Actions
          • Unit - Remove Invigorating Roar Stat Bonus from (Picked unit)
      • Custom script: call DestroyGroup(udg_BAR_IR_Tempg)
Thx in advance.
 
Well eitherway, I think it's important to point out, that even with the timer running correctly each time, it would not be MUI, since once the timer expires you're removing all units in the group, rather than just the ones which were effected at the instance of the spell being casted (unless that's intentional?) typically controlling timers correctly in this manner are done in JASS (so I'm told) However from a basic GUI perspective I would recommend the use of an artifical wait timer and to Dynamically index the units effected by the spell as to only remove it from the units who's "time have ran out" as such for the duration of the effect of the ability, we have a tutorial on this: http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/mui-triggers-waits-218354/ read the bottom section of the tutorial.
 
Level 7
Joined
May 15, 2009
Messages
192
Im honestly not trying to make it MUI. (I know I should probaly have said this earlier) im making an RPG, where there can only possibly be one unit of each hero type. And thus, this ability will never be cast more than once at a time. It's cooldown is also longer than it's duration.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Custom script: call DestroyGroup(udg_BAR_IR_Tempg)
This destroys the object, the group doesn't exist anymore, it can't be used or accessed.

If you destroy the group, then you need to use CreateGroup() before being able to use the group again.

You could use Unit Group - Clear group instead of destroying it.

  • Unit Group - Pick every unit in (Units within 650.00 of BAR_IR_Tempp matching (((((Matching unit) is...
^This leaks a unit group. Place
  • Custom script: set bj_wantDestroyGroup = true
before the unit group pick line and there will be no leak.

Please use [hidden=Text][/hidden] tags for your trigger.
 
Level 7
Joined
May 15, 2009
Messages
192
Thx for all the advice guys - will try these things out as soon as the chance arises.

Sorry for abandoning this thread. I haven't had acces to World Editor for a while, and thus, I haven't quite bothered to check up on Hive.

Thx guys. Will +rep all of you, and come back to you once I have tried these things out in my trigger.
 
Status
Not open for further replies.
Top