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

Disarm System v1.1.1

FOR 1.29+ USERS : READ THIS

DISARM SYSTEM BY DAFFA THE MAGE
==================================================================
DESCRIPTION :
A system that allows user to disarm a unit with configurables.
==================================================================
MANUAL :
(1)Preference :
Make sure "Automatically creates Unknown Variables when pasting trigger data" is ticked on

(2)Object Editor :
Copy and Paste "Disarm Ability" to your map

(3)Trigger Editor :
Copy and Paste "Disarm System" folder to your map
Set the variables in the "Disarm Config" to the correct values
Configure the system using the instructions in the "Disarm Manual"

If it's still not enough, look at the Example folder on the test map for actual usage
==================================================================

  • Disarm Manual
    • Events
    • Conditions
    • Actions
      • -------- Below are the available variables that needs to be modified by user to use the system --------
      • -------- Check "Applying Examples" for more information --------
      • -------- The affected unit --------
      • Set DisarmedUnit = (Last created unit)
      • -------- The source --------
      • Set DisarmSource = (Last created unit)
      • -------- Duration of disarm to target --------
      • Set DisarmDuration = 0.00
      • -------- File path for SFX on affected unit, needs DisarmAttachment to be placed on unit's body properly --------
      • Set DisarmEffect = <Empty String>
      • -------- Location of SFX attachment --------
      • Set DisarmAttachment = <Empty String>
      • -------- If this set to true, the duration will stack else it will overrides (the highest one will take place) --------
      • -------- e.g1 : a unit has 3 non-stack second duration, then another unit gives a new registration --------
      • -------- the new registration is stack and has 2 second, this means the affected unit now take 3 + 2 = 5 seconds --------
      • -------- e.g2 : a unit has 3 stack second duration, then another unit gives a new registration --------
      • -------- the new registration is non-stack and has 2 second, this means the affected unit now take 3 seconds (as the newest one doesn't stack and has less duration) --------
      • Set DisarmDurationStack = False
      • -------- ======================================== --------
      • -------- WARNING --------
      • -------- Due to limitation with the current script for SFX (1 SFX per unit) and only the latest one will take effect --------
      • -------- ======================================== --------
      • -------- BASIC USAGE --------
      • -------- ======================================== --------
      • -------- Below are available states that players can get from a disarmed unit --------
      • Set DisarmState = 0.00
      • -------- A unit takes disarm = 1.00 (triggers when units are registered to the system) --------
      • -------- Disarm in progress = 1.50 (remember to calculate that this run 32 times in 1 second) --------
      • -------- Disarm ends = 2.00 (triggers on death or duration ends) --------
      • -------- To avoid taking wrong units, it's advised to use buffs on disarmed units that takes additional effects so they can be used as filters --------
      • -------- To attain correct unit on disarm end, it's recommended that it has a disarm buff that has a very slight longer duration than the disarm itself (0.04-0.10) --------
      • -------- There's another method involving detect the disarm --------
      • Set IsUnitDisarmed[(Custom value of DisarmedUnit)] = False
      • -------- The above variable will return true (the system does the checking automatically) and you can use this for detections --------
      • -------- Check in condition of a trigger for it's status, and the value will be used --------
      • -------- Check Applying Examples folder, the Paladin Spell trigger for more information --------
      • -------- ======================================== --------
      • -------- ADVANCED USAGE --------
      • -------- ======================================== --------
      • -------- Below is how to check for duration --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DisarmDurRemain[(Custom value of DisarmedUnit)] Less than 3.00
        • Then - Actions
          • -------- ACTIONS HERE --------
        • Else - Actions
      • -------- To modify duration, we do as seen below, the below example sets the duration to 10 seconds --------
      • Set DisarmDurRemain[(Custom value of DisarmedUnit)] = 10.00
      • -------- Duration can be frozen, which halt it from decreased by the loop, do as shown below to apply it --------
      • Set DisarmDurationIsFrozen[(Custom value of DisarmedUnit)] = True
      • -------- However, make sure to release the freeze else it will be permanent, a frozen duration can be released with below technique --------
      • Set DisarmDurationIsFrozen[(Custom value of DisarmedUnit)] = False
      • -------- A "frozen" duration disarm is AUTOMATICALLY released when the disarmed unit dies --------

  • Disarm Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ======================================== --------
      • -------- This is the base ability to erase 'Attack' ability --------
      • -------- Copy the one from sample map and paste it on your map then set this variable to that ability --------
      • Set DisarmAbility = Disarm Ability
      • -------- Use variable below with Run Trigger function to run the system --------
      • -------- Set this variable to Disarm System trigger --------
      • Set DisarmTrigger = Disarm System <gen>
      • -------- Set this to Disarm Loop trigger --------
      • Set DisarmLoopTrigger = Disarm Loop <gen>
      • -------- END OF DETAIL - BELOW ARE CORE PART --------
      • -------- This is the loop value, 32 execution per second --------
      • Custom script: set udg_DisarmLoop = 0.03125
      • Trigger - Add to DisarmLoopTrigger the event (Time - Every DisarmLoop seconds of game time)
  • Disarm System
    • Events
    • Conditions
    • Actions
      • -------- Start the system --------
      • Set DisarmUnitValue = (Custom value of DisarmedUnit)
      • Set DisarmDurationStackBoolean[DisarmUnitValue] = DisarmDurationStack
      • Set DisarmSourceUnit[DisarmUnitValue] = DisarmSource
      • -------- Duration input --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DisarmDurationStackBoolean[DisarmUnitValue] Equal to True
        • Then - Actions
          • Set DisarmDurRemain[DisarmUnitValue] = (DisarmDurRemain[DisarmUnitValue] + DisarmDuration)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DisarmDurRemain[DisarmUnitValue] Less than or equal to DisarmDuration
            • Then - Actions
              • Set DisarmDurRemain[DisarmUnitValue] = DisarmDuration
            • Else - Actions
      • -------- Check state of current units, is it already disarmed or not --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsUnitDisarmed[DisarmUnitValue] Equal to False
        • Then - Actions
          • -------- Apply effect if doesn't applied yet --------
          • Set IsUnitDisarmed[DisarmUnitValue] = True
          • Unit - Add DisarmAbility to DisarmedUnit
          • Special Effect - Create a special effect attached to the DisarmAttachment of DisarmedUnit using DisarmEffect
          • Set DisarmSFX[DisarmUnitValue] = (Last created special effect)
          • -------- Insert to system loop --------
          • Unit Group - Add DisarmedUnit to DisarmGroup
          • Set DisarmCounter = (DisarmCounter + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DisarmCounter Equal to 1
            • Then - Actions
              • Trigger - Turn on DisarmLoopTrigger
            • Else - Actions
        • Else - Actions
          • Special Effect - Destroy DisarmSFX[DisarmUnitValue]
          • Special Effect - Create a special effect attached to the DisarmAttachment of DisarmedUnit using DisarmEffect
          • Set DisarmSFX[DisarmUnitValue] = (Last created special effect)
      • -------- Return State --------
      • Set DisarmState = 1.00
      • Set DisarmState = 0.00
  • Disarm Loop
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DisarmGroup and do (Actions)
        • Loop - Actions
          • Set DisarmedUnit = (Picked unit)
          • Set DisarmUnitValue = (Custom value of DisarmedUnit)
          • -------- Return state --------
          • Set DisarmState = 1.50
          • Set DisarmState = 0.00
          • -------- Duration check --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DisarmDurationIsFrozen[DisarmUnitValue] Equal to False
            • Then - Actions
              • Set DisarmDurRemain[DisarmUnitValue] = (DisarmDurRemain[DisarmUnitValue] - DisarmLoop)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • DisarmDurRemain[DisarmUnitValue] Less than 0.00
                  • (DisarmedUnit is dead) Equal to True
            • Then - Actions
              • -------- Return state --------
              • Set DisarmState = 2.00
              • Set DisarmState = 0.00
              • -------- Unregister --------
              • Set IsUnitDisarmed[DisarmUnitValue] = False
              • Set DisarmDurationIsFrozen[DisarmUnitValue] = False
              • Set DisarmDurRemain[DisarmUnitValue] = 0.00
              • Set DisarmSourceUnit[DisarmUnitValue] = No unit
              • Special Effect - Destroy DisarmSFX[DisarmUnitValue]
              • Unit - Remove DisarmAbility from DisarmedUnit
              • Unit Group - Remove DisarmedUnit from DisarmGroup
              • Set DisarmCounter = (DisarmCounter - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DisarmCounter Equal to 0
                • Then - Actions
                  • Trigger - Turn off DisarmLoopTrigger
                • Else - Actions
            • Else - Actions

===================================================================
CREDITS
Bribe : Unit Indexer
unkn0wn_d3str0y3r : his Disarm System that inspired me
===================================================================
CHANGELOG :
Fixed a major issue with DisarmDurationIsFrozen
Reduces the amount of Comment Lines

Add More Features

First Upload


Keywords:
Disarm, System, d, i, s, a, r, m, y, t, e, Daffa the Mage, Disarming, Disables, No Attack

If you like this work and wish to support me financially, you can support me via Ko-fi.
Contents

Disarm System (Map)

Reviews
12:11, 7th Apr 2015 IcemanBo: Useful.
Level 24
Joined
Aug 1, 2013
Messages
4,657
Disarm... what does it do?
WC3 does not have "weapons" so units cannot be disarmed.
(I know that it is just "blind" but yea you did not mention it.)

Also why does this one has to be used over the existing ones?
People who already use those must know why they should use this one instead.
People who do not use any yet and want to use one will use the same as everyone else does... 70% of the time.
 
This one offers complete control over the disarmed units, you have practically all the access you need.
Basically, in short this one grants full control for users, want to disarm unit while giving them DPS? Sure, disarm then slow them at the end? Why not, disarm and deal double damage to them while disarmed? Okay.
In short, it offers control over the target, which sometime might be a case for user who wants to make a complex spell relying in disarmed units (or in short, blind).
 
Looks good and simple to use.
If unit is already registred no need to increase the counter and no need to add the unit to group.
Getting unit's current stun duration could be useful, too. Just an idea.
User could take it in consideration to define the new disarm duration onRegister.

DisarmAttachment
DisatmEffect

^These should be constants, and be set once in config part. You won't anyway create an other effect if unit is registered already, so it will never have different effects.

So register will only look like:
Set DisarmUnit = <MyUnit>
Set Duration = <MyDuration>

What could be maybe useful is to change the static boolean to stack/not stack to dynamic one.
Though that's also only an idea.
 
Looks good and simple to use.
If unit is already registred no need to increase the counter and no need to add the unit to group.
Getting unit's current stun duration could be useful, too. Just an idea.
User could take it in consideration to define the new disarm duration onRegister.

DisarmAttachment
DisatmEffect

^These should be constants, and be set once in config part. You won't anyway create an other effect if unit is registered already, so it will never have different effects.

So register will only look like:
Set DisarmUnit = <MyUnit>
Set Duration = <MyDuration>

What could be maybe useful is to change the static boolean to stack/not stack to dynamic one.
Though that's also only an idea.
Thanks :)

I will fix that one.

I consider getting the duration, but that would requires a little nifty code to make it easy to implement.

The effect is optioned so that each units can have different effects and such.
The duration Boolean?

And this is done by adding an ability to a unit and removing it when the disarm would be removed?

(I do see the complex stuff about remaining duration and stuff but just that we are on the same level.)
Yeah, it's using the basic technique, which is also applied to my old Blind Spell (in my resources list).
It's not complex for the basic technique, but this one offers a lot for users that wants a completely controllable disarming.
 
:D I can write your system with only 1 configuration trigger inside my EOT System :p
Not to just kick your (_._)... that system of mine is also not yet approved :\
It's your call, all I want to give is a simple system with some features. Users have their calls, and it's their preference to choose which they want.
The system isn't too complex so it's not difficult for user to learn it's features, and not a pain for me to create.

But if you want to register unit once again (now with different effect), it won't be shown. :/
Yeah, tried some different tricks yet none worked, I wonder if overriding the old one is better than discarding the new one, your opinion?
Hope I figure something by a few days or anything,
 
Okay, planned updates :
  1. Fix the annoying SFX issue, so users can attach SFX directly to system without buffs, the retrieving method still requires a filter to check which spell or attack affect the disarmed unit.
  2. Allows duration manipulation, this is to allow user adding, subtract, multiplies, divides and so on the remaining duration of disarmed units, meaning user has full control over disarmed unit's duration.
  3. Point 2 will also come along with another Boolean that allows or prohibits a certain unit from having their duration manipulated. A mechanic will also be explained for this one.
  4. Duration stacking Boolean changed into dynamic one. The mechanic will be explained later.
  5. Improves the registration trigger, giving it more optimization
  6. if possible, animations can be included, mainly during the start and ending phase. {Optional}

Well, hope they can be applied to the system :)
 
I wonder if overriding the old one is better than discarding the new one, your opinion?
In this case removing the old and using the new indeed might be better, but frankly I don't think you have to bother with multiple effects.
People probably don't need many different effects to indicate a "disarmed" unit. You doubtless could go with one constant one I believe! :csmile:

animations can be included, mainly during the start and ending phase
User already can catch the start and end event, so he can use this for animation if really needed.

With doing as less extra features as possible you're doing fine I believe.. it will be useful. Gl with next update!
 
In this case removing the old and using the new indeed might be better, but frankly I don't think you have to bother with multiple effects.
People probably don't need many different effects to indicate a "disarmed" unit. You doubtless could go with one constant one I believe! :csmile:


User already can catch the start and end event, so he can use this for animation if really needed.

With doing as less extra features as possible you're doing fine I believe.. it will be useful. Gl with next update!
Perhaps you're correct about that one, but users might want different effects for some units and some others (example : unit A effect A, unit B effect B and so on) or anything else in their minds. :csmile:

To be honest, you're correct, I should have think about it before :)

Thanks, hope I can carry out the update :)
 
Here's a list of status while preparing the new version :
  1. Successfully implement point 4, but... Refer to 2
  2. About stacking, how should the stack rules applies? Should stacking and non-stacking duration holds 2 different durations?
  3. I figure out that modification of the duration (Point 2 & 3 from the planned update) is quite difficult to control and seems advanced. I might not implement Boolean rules into it, so maybe only point 2 will applies in next update
  4. SFX issue still persist, but this time e newest one will be shown instead of the older one.
  5. Scrapped Point 6, IcemanBo explains it well in this post.
 
Alright, here's a surprise news.

Current status :
1. Well, point 3 is scrapped (for now) and I manage to find a solution to point 2, it's by making the default duration remaining variable modifiable by user
2. Making a new manual for an in-depth guide through the system usage, what I said in point 1 is included in this new manual, as advanced usage.

Below are planned stuffs before the update :
1. Make the disarm source accessible, this is important for damage through disarm and such that involves caster <-> target
2. Make the duration possible to be "frozen", causing it to stop decreasing until "unfrozen"
 
If an instance is "frozen" the onLoop event should probably not fire.

  • Set DisarmDurationStackBoolean[DisarmUnitValue] = DisarmDurationStack
  • [/stable]
^This is not needed. You only use it onRegistration.

Nothing significant, but in loop you could jump into else block and then:
  • Or - Any (Conditions) are true
    • Conditions
      • DisarmDurRemain[DisarmUnitValue] < 0.00
      • (DisarmedUnit is dead) == True
Or - Multiple Conditions block is not needed. Can be ->
  • (DisarmDurRemain[DisarmUnitValue] >= 0.00
  • (DisarmedUnit is alive) == True
(^Not important)
 
If an instance is "frozen" the onLoop event should probably not fire.

  • Set DisarmDurationStackBoolean[DisarmUnitValue] = DisarmDurationStack
  • [/stable]
^This is not needed. You only use it onRegistration.

Nothing significant, but in loop you could jump into else block and then:
  • Or - Any (Conditions) are true
    • Conditions
      • DisarmDurRemain[DisarmUnitValue] < 0.00
      • (DisarmedUnit is dead) == True
Or - Multiple Conditions block is not needed. Can be ->
  • (DisarmDurRemain[DisarmUnitValue] >= 0.00
  • (DisarmedUnit is alive) == True
(^Not important)

Kinda difficult to handle those frozen instance. I'll think of a possibility.

Really? I fear the stack get bugged that way when 2 different booleans are send in succession.

Interesting, wait, between IsUnitAlive and IsUnitDead which is faster? Forget about that one.


Well since the user still has possibility to check the the state if duration is stopped or not onLoop event, it's okay.
Something like each 0.1 seconds would also be completly fine for interval in my opinion.

Anyway... all works good, easy to use, and simple! Approved.
I fear in 0.01 it's too much for older comps to handle.
Thanks! :)
 
Top