• 🏆 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!

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