• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Simple Temporary Ability System v1.01

- This system allows you to add abilities temporarily to a unit.
- Now you can add hidden abilities or even Spell Book (disable) it for temporary usage !


External Instructions
- Open World Editor - File - Preferences... - General Tab - Tick the Automatically create unknown variables while pasting trigger data
- Copy the Simple Temporary Ability System folder.
- You can also take a look at the example(s) and see how do you want to manipulate this system.

Internal Instructions
- You have 3 variables that you need to manipulate in order to use this system.
TA_AbilitySet - Sets which ability is to be added to the unit
TA_DurationSet - Sets the duration of the added ability
TA_UnitSet - Sets which unit should get the ability

- After you have set those 3 variables, you only need to run them by;
  • Trigger - Run TA Event <gen> (ignoring conditions)
  • TA Loop
    • Events
    • Conditions
    • Actions
      • For each (Integer TA_CurrentIndex) from 1 to TA_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TA_Duration[TA_CurrentIndex] Greater than 0.00
            • Then - Actions
              • Set TA_Duration[TA_CurrentIndex] = (TA_Duration[TA_CurrentIndex] - TA_Interval)
            • Else - Actions
              • Unit - Remove TA_Ability[TA_CurrentIndex] from TA_Unit[TA_CurrentIndex]
              • Set TA_Ability[TA_CurrentIndex] = TA_Ability[TA_MaxIndex]
              • Set TA_Duration[TA_CurrentIndex] = TA_Duration[TA_MaxIndex]
              • Set TA_Unit[TA_CurrentIndex] = TA_Unit[TA_MaxIndex]
              • Set TA_CurrentIndex = (TA_CurrentIndex - 1)
              • Set TA_MaxIndex = (TA_MaxIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • TA_MaxIndex Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
  • TA Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TA_Interval = 0.03
      • Trigger - Add to TA Loop <gen> the event (Time - Every TA_Interval seconds of game time)
  • TA Event
    • Events
    • Conditions
    • Actions
      • For each (Integer TA_CurrentIndex) from 1 to TA_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TA_Unit[TA_CurrentIndex] Equal to TA_UnitSet
              • TA_Ability[TA_CurrentIndex] Equal to TA_AbilitySet
            • Then - Actions
              • Set TA_Duration[TA_CurrentIndex] = TA_DurationSet
              • Custom script: return
            • Else - Actions
      • Set TA_MaxIndex = (TA_MaxIndex + 1)
      • Set TA_Ability[TA_MaxIndex] = TA_AbilitySet
      • Set TA_Duration[TA_MaxIndex] = TA_DurationSet
      • Set TA_Unit[TA_MaxIndex] = TA_UnitSet
      • Unit - Add TA_AbilitySet to TA_UnitSet
      • Trigger - Turn on TA Loop <gen>
-


v1.0
- Initial release

v1.01
- Fixed instance issue


Keywords:
simple, temporary, ability, system, duration, defskull, index, indexing.
Contents

Just another Warcraft III map (Map)

Reviews
19:18, 27th Sep 2012 Magtheridon96: Approved. This is useful and well-coded.

Moderator

M

Moderator

19:18, 27th Sep 2012
Magtheridon96: Approved.
This is useful and well-coded.
 
Level 8
Joined
Dec 22, 2008
Messages
207
Useful, original idea, and good execution. Triggers look good.
I know you have a 'how to use' here on the forum, but I suggest some documentation to go with it. Perhaps a disabled and initially on/unchecked trigger explaining what you're doing in each line.
5/5 and +rep nevertheless.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
Useful, original idea, and good execution. Triggers look good.
I know you have a 'how to use' here on the forum, but I suggest some documentation to go with it. Perhaps a disabled and initially on/unchecked trigger explaining what you're doing in each line.
5/5 and +rep nevertheless.
Thanks for the feedback ;p
Actually I don't like to include a heavy documentation to my systems, I would like to keep it as simple as it can be but as simple it is, the information should be understandable by end-user.
 
Now that's really useful... I just hope people would learn to use the search function before asking "how can we add abilities for a set amount of time?"

shouldn't TA EVENT be like this?

  • For each (Integer TA_CurrentIndex) from 1 to TA_MaxIndex, do (Actions)
  • Loop - Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • TA_Unit[TA_CurrentIndex] Equal to TA_UnitSet
      • TA_Ability[TA_CurrentIndex] Equal to TA_AbilitySet
    • Then - Actions
      • Set TA_Duration[TA_CurrentIndex] = TA_DurationSet
      • Custom script: call return
    • Else - Actions
  • Set TA_MaxIndex = (TA_MaxIndex + 1)
  • Set TA_Ability[TA_MaxIndex] = TA_AbilitySet
  • Set TA_Duration[TA_MaxIndex] = TA_DurationSet
  • Set TA_Unit[TA_MaxIndex] = TA_UnitSet
  • Unit - Add TA_AbilitySet to TA_UnitSet
  • Trigger - Turn on TA Loop <gen>
that way, you only add another instance if there is no current instance running for that Unit-Ability combination... because on your current way, you always add another instance when you call the TA_EVENT
 
Top