1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  5. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  6. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Disarm System Version 1.1.1

Submitted by Daffa, ukn0wnD3str0y3r
This bundle is marked as approved. It works and satisfies the submission rules.
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
==================================================================
TRIGGERS
MANUAL

  • 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 :
Version 1.1.1
Fixed a major issue with DisarmDurationIsFrozen
Reduces the amount of Comment Lines

Version 1.1.0
Add More Features

Version 1.0.0
First Upload


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

Disarm System (Map)

Reviews
Moderator
12:11, 7th Apr 2015 IcemanBo: Useful.
  1. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,950
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    Forget to mention that the bug from the previous post has been fixed
     
  2. ukn0wnD3str0y3r

    ukn0wnD3str0y3r

    Joined:
    Feb 15, 2013
    Messages:
    364
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Hello Bello :)
     
  3. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,950
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    Hello :)
    Any feedback? :)
     
  4. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,272
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    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)
     
  5. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,272
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    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.
     
  6. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,950
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    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.


    I fear in 0.01 it's too much for older comps to handle.
    Thanks! :)
     
  7. ukn0wnD3str0y3r

    ukn0wnD3str0y3r

    Joined:
    Feb 15, 2013
    Messages:
    364
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Great work!!haha, I forgot most of the triggers things... since I've stop onoine so long
     
  8. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,950
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    No update, just a slight documentation fixing which should've been done since the start of Hive 2 and those emoji.
     
  9. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,950
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    Updated the resources to address a new native IcemanBo mentioned in his Disarmament v1.1 resources.