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

[GUI]Simple Stun System v1.0 [UnitIndexer Version]

Back from the dead, the legend is back!

As a tribute to an old friend - Paladon - I coded a system in his honor which looks a lot like his old systems.

This is the UnitIndexer Version.

And I'm sorry, new computer, haven't installed photoshop thus awesome paint picture :D

and I'm sorry, it doesn't use firebolt as dummy ability but stormbolt works just fine when you made it an ultimate ability (with standard game constants ^^)

In-Game Documentation

Simple Stun System v1.0 (Unit Indexer Version)
by baassee

Credits
baassee for being back from the dead
Bribe for the UnitIndexer
Paladon, nothing less than a shining knight - system is in paladon style to honor him in his absence

DOCUMENTION
Simple system just like the other system but this is much better, based on a unit indexer by Bribe which reduces the amount of iterations by way far.

As this is not the like the stand alone version, you have to have unitindexer which is provided in the same folder.

Read the readmes for their features, basic in the first README it explains how to stun.
In README2 it gives you the possibility to cancel a stun at any given time.

also uses only one dummy unit - all the time. Creates it at map ini and never removes it omg omg so much performance boost

oh right btw, stun stacks, so if you stun a unit with one spell cast another spell that stuns too - the durations will add up together ^^ (OMG PERMASTUN SO OP)
this above is of course up to the user him/herself

HOW TO COPY PASTE
1. Copy paste the ability, buff and dummy unit. Remember to fix buff on the ability when you imported it to the correct buff.
2. Copy StunSystemStandAlone folder into your map
3. Follow all triggers and read where I pointed out where to fix this or that
4. Credit me and be happy to use a fully working stun system.

Changelog.
v1.0 released

Good luck! And please credit me - baassee - if you use this system. Thank you!

Any questions just throw me a PM or VM or reply to the resource thread.

Sincerly,
baassee


  • STUNINITIALIZE
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- ---------------------------------------------------------------------- --------
      • -------- DOCUMENTATION START --------
      • -------- ---------------------------------------------------------------------- --------
      • -------- I had to do this, people will just struggle with using unitIDs ^^ --------
      • -------- ---------------------------------------------------------------------- --------
      • Set TempLoc = (Center of (Playable map area))
      • -------- ---------------------------------------------------------------------- --------
      • -------- remember to fix the dummy type --------
      • -------- ---------------------------------------------------------------------- --------
      • Unit - Create 1 DUMMY for Neutral Hostile at TempLoc facing Default building facing degrees
      • -------- ---------------------------------------------------------------------- --------
      • Set STUN_DUMMY = (Last created unit)
      • -------- ---------------------------------------------------------------------- --------
      • -------- Adds our stun ability to our unit --------
      • -------- remember to fix this --------
      • -------- ---------------------------------------------------------------------- --------
      • Unit - Add SIMPLESTUNDUMMY to STUN_DUMMY
      • -------- ---------------------------------------------------------------------- --------
      • -------- some cleaning --------
      • -------- ---------------------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_TempLoc)
      • -------- ---------------------------------------------------------------------- --------
      • -------- is this safe for initialize? ^^ --------
      • -------- ---------------------------------------------------------------------- --------
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())
      • -------- ---------------------------------------------------------------------- --------
      • -------- MOVE ON TO STUNREADME TRIGGER --------
      • -------- ---------------------------------------------------------------------- --------


  • STUN README
    • Events
    • Conditions
    • Actions
      • -------- ---------------------------------------------------------------------- --------
      • -------- THIS IS WHAT YOU WILL COPY INTO YOUR TRIGGER --------
      • -------- ---------------------------------------------------------------------- --------
      • -------- ---------------------------------------------------------------------- --------
      • -------- The unit that is getting stunned, can be picked unit, triggering unit etc etc. --------
      • -------- ---------------------------------------------------------------------- --------
      • Set StunUnit = (Triggering unit)
      • -------- ---------------------------------------------------------------------- --------
      • -------- The duration the unit is being stunned. --------
      • -------- ---------------------------------------------------------------------- --------
      • Set StunDur = (Random real number between 0.01 and 1.00)
      • -------- ---------------------------------------------------------------------- --------
      • -------- THE GFX that will be above the stunned unit --------
      • -------- ---------------------------------------------------------------------- --------
      • Set StunGFX = Abilities\Spells\Human\Thunderclap\ThunderclapTarget.mdl
      • -------- ---------------------------------------------------------------------- --------
      • -------- and this boolean - if true - makes the stun stack with any previous stuns --------
      • -------- if false it will just be the duration of the last stun applied (this one) --------
      • -------- ---------------------------------------------------------------------- --------
      • Set StunStack = True
      • -------- ---------------------------------------------------------------------- --------
      • -------- and you're done! Can you believe it, how simple it can be? ^^ --------
      • -------- ---------------------------------------------------------------------- --------
      • -------- runs the indexing trigger --------
      • -------- check it out if you wanna learn something about triggering ^^ --------
      • -------- ---------------------------------------------------------------------- --------
      • Trigger - Run STUNRUN <gen> (checking conditions)
      • -------- ---------------------------------------------------------------------- --------


  • STUN README2
    • Events
    • Conditions
    • Actions
      • -------- ---------------------------------------------------------------------- --------
      • -------- alright this is used if you wanna cancel a stun on a unit at any given time --------
      • -------- I guess it can get handy --------
      • -------- ---------------------------------------------------------------------- --------
      • -------- the unit that you want to remove the stun from --------
      • -------- ---------------------------------------------------------------------- --------
      • Set StunUnit = (Triggering unit)
      • -------- ---------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (StunUnit is in STUNGROUP) Equal to True
        • Then - Actions
          • -------- ---------------------------------------------------------------------- --------
          • -------- we set the custom value simple and easy --------
          • -------- ---------------------------------------------------------------------- --------
          • Set TempInt = (Custom value of StunUnit)
          • -------- ---------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StunUnit Equal to STUN_UNIT[TempInt]
            • Then - Actions
              • -------- ---------------------------------------------------------------------- --------
              • -------- finds our unit and sets it duration to a negative value, which will make the next loop turn that instance down --------
              • -------- ---------------------------------------------------------------------- --------
              • Set STUN_DUR[TempInt] = -1.00
              • -------- ---------------------------------------------------------------------- --------
              • -------- and cancels further actions --------
              • -------- ---------------------------------------------------------------------- --------
            • Else - Actions
        • Else - Actions
          • -------- ---------------------------------------------------------------------- --------
          • -------- if it's not in the system, we do some debug --------
          • -------- ---------------------------------------------------------------------- --------
          • Game - Display to (All players) the text: Simple Stun System ...
          • -------- ---------------------------------------------------------------------- --------


  • STUNRUN
    • Events
    • Conditions
    • Actions
      • -------- ---------------------------------------------------------------------- --------
      • -------- just some fail-safe proof to keep ya noobs out of my system ^^ --------
      • -------- whole if can be removed if you know what you are doing :) --------
      • -------- ---------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (StunDur Less than or equal to 0.00) or (((StunUnit is dead) Equal to True) or ((StunUnit is A structure) Equal to True))
        • Then - Actions
          • -------- ---------------------------------------------------------------------- --------
          • -------- warns ya in-game if you have failed --------
          • -------- ---------------------------------------------------------------------- --------
          • Game - Display to (All players) the text: Simple Stun System ...
          • -------- ---------------------------------------------------------------------- --------
          • -------- cancels all further actions --------
          • -------- ---------------------------------------------------------------------- --------
          • Skip remaining actions
          • -------- ---------------------------------------------------------------------- --------
        • Else - Actions
      • -------- ---------------------------------------------------------------------- --------
      • -------- now this is the unit indexer verison, we do almost the same as in the standalone version but much more simple ^^ --------
      • -------- fixed by using a unit's custom value --------
      • -------- ---------------------------------------------------------------------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (StunUnit is in STUNGROUP) Equal to True
        • Then - Actions
          • -------- ---------------------------------------------------------------------- --------
          • -------- set the customvalue into a integer variable --------
          • -------- ---------------------------------------------------------------------- --------
          • Set TempInt = (Custom value of StunUnit)
          • -------- ---------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • StunStack Equal to True
            • Then - Actions
              • -------- ---------------------------------------------------------------------- --------
              • -------- so if it should stack then we make it stack --------
              • -------- ---------------------------------------------------------------------- --------
              • Set STUN_DUR[TempInt] = (STUN_DUR[TempInt] + StunDur)
              • -------- ---------------------------------------------------------------------- --------
            • Else - Actions
              • -------- ---------------------------------------------------------------------- --------
              • -------- else we just reset the duration --------
              • -------- ---------------------------------------------------------------------- --------
              • Set STUN_DUR[TempInt] = StunDur
              • -------- ---------------------------------------------------------------------- --------
        • Else - Actions
          • -------- ---------------------------------------------------------------------- --------
          • -------- same as above with the custom value, but now we set our arrays --------
          • -------- ---------------------------------------------------------------------- --------
          • Set TempInt = (Custom value of StunUnit)
          • -------- ---------------------------------------------------------------------- --------
          • -------- the unit stunned --------
          • -------- ---------------------------------------------------------------------- --------
          • Set STUN_UNIT[TempInt] = StunUnit
          • -------- ---------------------------------------------------------------------- --------
          • -------- add the duration --------
          • -------- ---------------------------------------------------------------------- --------
          • Set STUN_DUR[TempInt] = StunDur
          • -------- ---------------------------------------------------------------------- --------
          • -------- some custom script because I'm lazy ^^ and saves you a BJ omg --------
          • -------- so much performance boost --------
          • -------- ---------------------------------------------------------------------- --------
          • -------- also we move the dummy to the "target" --------
          • -------- to enhance our stun experience --------
          • -------- ---------------------------------------------------------------------- --------
          • Custom script: call SetUnitX(udg_STUN_DUMMY, GetUnitX(udg_StunUnit))
          • Custom script: call SetUnitY(udg_STUN_DUMMY, GetUnitY(udg_StunUnit))
          • Custom script: set udg_STUN_GFX[udg_TempInt] = AddSpecialEffectTarget(udg_StunGFX, udg_StunUnit, "overhead")
          • -------- ---------------------------------------------------------------------- --------
          • -------- stun the unit with our dummy ^^ --------
          • -------- ---------------------------------------------------------------------- --------
          • Unit - Order STUN_DUMMY to Human Mountain King - Storm Bolt StunUnit
          • -------- ---------------------------------------------------------------------- --------
          • -------- and at last we add our new unit into our fail-safe group --------
          • -------- ---------------------------------------------------------------------- --------
          • Unit Group - Add StunUnit to STUNGROUP
          • -------- ---------------------------------------------------------------------- --------
          • -------- and we dont check how many there are in the group now because we just added one unit to the group --------
          • -------- so we will just crack on --------
          • -------- ---------------------------------------------------------------------- --------
          • Trigger - Turn on STUNLOOP <gen>
          • -------- ---------------------------------------------------------------------- --------
          • -------- go to the loop trigger if you wanna learn more ^^ --------
          • -------- ---------------------------------------------------------------------- --------


  • STUNLOOP
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- ---------------------------------------------------------------------- --------
      • -------- the loop trigger, yes you can change the event timer to whatever you want --------
      • -------- less number = more accurate although more fires/second thus more performance needed --------
      • -------- all about to you, I think 33 times a second is accurate enough --------
      • -------- ---------------------------------------------------------------------- --------
      • Unit Group - Pick every unit in STUNGROUP and do (Actions)
        • Loop - Actions
          • -------- ---------------------------------------------------------------------- --------
          • -------- get the custom value of the picket units --------
          • -------- ---------------------------------------------------------------------- --------
          • Set TempInt = (Custom value of (Picked unit))
          • -------- ---------------------------------------------------------------------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (STUN_DUR[TempInt] Greater than 0.00) and ((STUN_UNIT[TempInt] is dead) Equal to False)
            • Then - Actions
              • -------- ---------------------------------------------------------------------- --------
              • -------- if it hasnt ended, then we reduce our "variable" --------
              • -------- ---------------------------------------------------------------------- --------
              • Set STUN_DUR[TempInt] = (STUN_DUR[TempInt] - 0.03)
              • -------- ---------------------------------------------------------------------- --------
            • Else - Actions
              • -------- ---------------------------------------------------------------------- --------
              • -------- and if the duration is gone omg --------
              • -------- then we remove the debuff which will make the unit out of stun --------
              • -------- ---------------------------------------------------------------------- --------
              • Unit - Remove Stunned SIMPLE STUN SYSTEM buff from STUN_UNIT[TempInt]
              • -------- ---------------------------------------------------------------------- --------
              • -------- more custom script because im lazy --------
              • -------- basic destroying the effect --------
              • -------- ---------------------------------------------------------------------- --------
              • Custom script: call DestroyEffect(udg_STUN_GFX[udg_TempInt])
              • -------- ---------------------------------------------------------------------- --------
              • -------- remove the unit from our group --------
              • -------- ---------------------------------------------------------------------- --------
              • Unit Group - Remove STUN_UNIT[TempInt] from STUNGROUP
              • -------- ---------------------------------------------------------------------- --------
              • -------- here we count the amount of units in the group --------
              • -------- if it's 0, we turn off this trigger ^^ --------
              • -------- ---------------------------------------------------------------------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in STUNGROUP) Equal to 0
                • Then - Actions
                  • -------- ---------------------------------------------------------------------- --------
                  • Trigger - Turn off (This trigger)
                  • Skip remaining actions
                  • -------- ---------------------------------------------------------------------- --------
                • Else - Actions
      • -------- ---------------------------------------------------------------------- --------
      • -------- thats it ^^ so simple system right --------
      • -------- ---------------------------------------------------------------------- --------



So time for some pros vs. cons.
Pros
  • Can stun any given unit at any given time.
  • Can cancel stun at any given time.
  • Can stun magic immune units (If constants are not touched ^^)
  • Any duration.
  • Stun stacks with other stuns from the system (rarely a pro, can also be a con but as said, implemented a cancel feature as well). - NOW YOU CAN CHOOSE IF YOU WANT IT TO STACK WITH THE PREVIOUS STUN OR JUST CHOOSE THE LAST ONE.
  • Only uses one dummy unit.
Cons
  • A unit can basicly be perma-stunned as the stuns stack with each others. - This can only happen if the user now only uses stack with the boolean added ^^
  • If you checked the constant "ultimate goes through magic immune" or whatever the name is, it will not work on magic immune units (false by default which makes it workable).
  • Well I included a GFX string variable BUT I recommend to use the standard version. Cause if different abilities got different stun GFX and a unit gets stunned, the GFX will not stack but the stun will (no it doesn't leak).
  • GFX will be overhead - I will not change this.
  • Shouldn't be used it any other stun systems nor even stun abilities. But it should work with other stun abilities due to the fact of custom buff yet I have not tested it so I cannot recommend this.
  • Structures cannot be target.
  • Mag96 sux :)

Have fun with the system. Give credit if used please.

Sincerly,
~baassee

Keywords:
simple, stun, system, baassee, legend, is, back, standalone, mag96, sux,
Contents

[GUI]Simple Stun System v1.0 [UI V] (Map)

Reviews
06:36, 17th Aug 2012 Magtheridon96: Okay, this is a great alternate version of the other system that uses dynamic indexing. I'll give it a higher rating because this will have much less overhead with a large number of units stunned at the same...

Moderator

M

Moderator

06:36, 17th Aug 2012
Magtheridon96: Okay, this is a great alternate version of the other system that uses dynamic indexing.

I'll give it a higher rating because this will have much less overhead with a large number of units stunned at the same time ^_^

Also, it's great that you took the time to add comments to this.

And yes, I do suck ^.^
 
Top