1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The poll for our 11th Music Contest is up! Help us choose the most awesome cinematic tracks by casting a vote!
    Dismiss Notice
  3. Melee Mapping contest #3 - Poll is up! Vote for the best 4v4 melee maps!
    Dismiss Notice
  4. The 30th edition of the Modeling Contest is finally up! The Portable Buildings need your attention, so come along and have a blast!
    Dismiss Notice
  5. The Aftermath has been revealed for the 19th Terraining Contest! Be sure to check out the Results and see what came out of it.
    Dismiss Notice

[GUI] Omnislash Template

Submitted by MyPad
This bundle is marked as pending. It has not been reviewed by a staff member yet.

Omnislash your way to all sorts of Omnislash derivatives:



Create your own Omnislash spells with ease.

Sometimes, Omnislash mechanics are all too much the same, and it is a pain recreating the triggers for different spells which are all too much the same. What if there was a system that did it for you?

Features:



The Omnislash System is a system designed to handle most practical cases of how most Omnislash derivatives are handled, including filtering out flying units, allies, magic immunes, and such. It is also capable of having more than one Omnislash instance for a desired unit, if the user so wishes.



    1. In the General Tab, under Preferences, found in the File Tab, allow the Automatic creation of variables by ticking it.
    2. Copy all the relevant triggers found in the Omnislash System Folder
    3. (Optional) copy the demo triggers to investigate how the system is run.
    4. Success!


  • The system will be explained more in detail within the map itself, but here are some key variables which you can manipulate (and some which can but shouldn't be manipulated):

    Flags:



    1. Omni_AffectAir
      - A flag which determines whether a flying unit will be targeted.
      (Manipulable)

    2. Omni_AffectMagicImmune
      - Determines whether a magic immune unit will be targeted.
      (Manipulable)

    3. Omni_ContinueWhenDead
      - Determines whether the omnislash will go through even when the caster is dead.
      (Manipulable)

    4. Omni_CheckAllies
      - Determines whether allies will be targeted.
      (Manipulable)

    5. Omni_CheckEnemies
      - Determines whether enemies will be targeted.
      (Manipulable)

    6. Omni_CheckRange
      - Determines whether targeted enemies in a group must be within range.
      (Manipulable)

    7. Omni_StopWhenRooted
      - Determines whether the omnislash stops when the caster is snared (I am not sure if rooted has the same effect).
      (Manipulable)

    8. Omni_TargetDead
      - Determines whether dead units are targeteable.
      (Manipulable)

    9. Omni_TargetInvul
      - Determines whether invulnerable units are targeteable.
      (Manipulable)

    10. Omni_TargetHidden
      - Determines whether hidden units (either through triggers or not visible) are targeteable.
      (Manipulable)

    11. Omni_TargetStructure
      - Determines whether buildings are included.
      (Manipulable)

    Omnislash Information:



    These are usually considered the important parts of Omnislash. For convenience, a table describing the state of the variable will be displayed below:

    Notation Context
    W Writable
    LW Limited Writable
    DO Define-Only
    NW Not Writable


    1. udg_Omni_Caster
      - The unit who is the slasher in a given Omnislash instance.
      (DO) Defined only before the creation of the instance.

    2. udg_Omni_Target
      - The unit who is the current target of a given Omnislash instance. (W).

    3. udg_Omni_Duration
      - The amount of time left for an instance.
      (LW) Not recommended for writing, since it requires knowledge on the status of certain Omnislash instances.

    4. udg_Omni_Interval
      - The amount of time per slash.
      (W).

    5. udg_Omni_Count
      - The amount of slashes to be made.
      (W)

    6. udg_Omni_Range
      - The enumeration range of the acquisition of targets.
      (W)

    7. udg_Omni_Damage
      - The amount of damage to be dealt to the omnislash target.
      (W).

    8. udg_Omni_Group
      - The enumeration group used by the system.
      (NW) Should not be written.


  • Due to the feature of Previewing triggers, this part is no longer necessary and has been omitted.

  • Setup:
    • On Spell
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Darkness Slash
      • Actions
        • Set Omni_Caster = (Triggering unit)
        • Set Omni_Target = (Target unit of ability being cast)
        • Set Omni_Damage = 100.00
        • Set Omni_Range = 500.00
        • Set Omni_Interval = 0.10
        • Set Omni_Count = 40
        • Set Omni_ContinueWhenDead = True
        • Set Omni_CheckAllies = True
        • Set Omni_OnSlashEvent = On Spell Attack <gen>
        • Set Omni_OnSlashEnd = On Spell Attack <gen>
        • Trigger - Run Omni Create <gen> (ignoring conditions)


    Before the slash occurs (e.g.: before the damage is dealt)
    • On Spell Attack
      • Events
      • Conditions
      • Actions
        • Unit - Make Omni_Caster face Omni_Target over 0.00 seconds
        • Animation - Change Omni_Caster's animation speed to 200.00% of its original speed
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Omni_Target belongs to an ally of (Owner of Omni_Caster)) Equal to True
          • Then - Actions
            • Animation - Play Omni_Caster's spell animation
            • Special Effect - Create a special effect attached to the chest of Omni_Target using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
            • Special Effect - Destroy (Last created special effect)
            • Set Omni_Damage = (0.00 - (Abs(Omni_Damage)))
          • Else - Actions
            • Animation - Change Omni_Caster's animation speed to 500.00% of its original speed
            • Animation - Play Omni_Caster's attack animation
            • Special Effect - Create a special effect attached to the chest of Omni_Caster using Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
            • Special Effect - Destroy (Last created special effect)
            • Custom script: call UnitDamageTarget(udg_Omni_Caster, udg_Omni_Target, 0, true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WOOD_HEAVY_BASH)
            • Set Omni_Damage = (Abs(Omni_Damage))
            • Unit - Set life of Omni_Caster to ((Life of Omni_Caster) + (Omni_Damage x 0.50))


    Upon the termination of the instance
    • On Spell End
      • Events
      • Conditions
      • Actions
        • Animation - Change Omni_Caster's animation speed to 100.00% of its original speed



v.1.0.0 - Initial Release

v.1.0.1 - Removed the udg_Omni_Trigger array variable in favor of using real events.
Elevated the importance of the udg_omni_abil array variable for filtering out
triggers that need to execute.

Changed the last parameter of RequestOmnislash from
trigger tt

to
boolean b


v.1.0.2 - Reintroduced the udg_omni_Trig array variable and removed the udg_omni_abil array variable.
Reworked the base trigger for the omnislash to allow for unlimited omnislashing.
You can now change the interval of the timer when it ends.

v.1.0.3 - Changed the name of the bundle from "Omnislash Template" to "Multiple-Target Slashing Template".

Changed the behavior of the function RequestOmnislash so that the last parameter takes a trigger instead of a boolean.

v.1.1.0 - Recoded everything from scratch. Backwards-compatibility broken but its' now easier to make an omnislash instance much more effectively.

No longer has the real-variable events.

v.1.1.0.1 - Added a new GUI example of usage.

v.1.2.0 - Revisited/rewritten the entire resource bundle to be completely GUI. (However, performance may be affected due to the rewrite).

Removed backwards compatibility (They will be introduced when the need arises).

Further improved documentation, Changelog, and Resource description.

Added comments on how to use the resource.

Now only goes with versions 1.29 and up (This is due to the determination of the invulnerability of a unit being exposed as a native function.)

Removed the ability to easily define the animation to be played when slashing.

Reverted name back to Omnislash Template​

You can make this into a passive ability, active ability that targets the ground or object, create some sort of target-only multi-slash, or even make it heal allies while appearing to slash. (It's all up to you, this just assists in making the omnislash-like spell that you desire.)
Contents

Omnislash Template (Map)

Reviews
KILLCIDE
It would be great if you can make the API shorter and more user friendly.
  1. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,137
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    If there is something wrong with the resource, feel free to tell me.

    EDIT: (July 29, 2017)

    Removed Bump and first edit!
     
    Last edited: Jul 29, 2017
  2. Reventhous

    Reventhous

    Joined:
    May 2, 2015
    Messages:
    105
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I haven't test your system to the fullest yet, but here's my quick suggestions for the next update.

    -Please do something with the code, its a bit messy.
    -Add some configuration.
    -Instead using multiple timer, use integer as countdown for each interval.
    -Replace the
    local group g
    with global variable.
    -
    null
    the local variables just before
    return
    or
    endfunction
     
  3. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,137
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    Which part of the code are you pertaining to? Is it the one with the pf__ prefixes and sm__ prefixes or is it in the functions that start with neither?

    Configuration, you say? Could you further elaborate on this?

    - Don't worry about the timers; it is done internally. About the integer being used as countdown, I would like you to further expand on your suggestion.

    Done!

    I guess you caught some unnulled variables. If it is about the
    local unit enum_unit
    , don't worry about it; the
    FirstOfGroup
    native will get the first unit and
    GroupRemoveUnit
    will remove that unit from the group, effectively setting the first unit to the second unit in the group.

    I'll elaborate on this later..
     
  4. Reventhous

    Reventhous

    Joined:
    May 2, 2015
    Messages:
    105
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Just put some space between the code line. Like this,
    Code (vJASS):

    function RequestOmnislash takes unit u, unit t, real timeout, real damage, real range, integer i, boolean b returns integer
        local integer this = sm__Omnislash__allocate()
        local group g
        local unit enum_u

        call sm__Omnislash__push(this)

        set udg_omni_Caster[this] = u
        set udg_omni_Target[this] = t
        set udg_omni_Timer[this] = CreateTimer()
        set udg_omni_Interval[this] = timeout
        set udg_omni_Damage[this] = 0
        set udg_omni_Range[this] = range

        if b then


    Anything that is constant in your code should be configurable. Likes unit filter, attack type, damage type, ...


    I'm talking about performance, it is something to worry about.
    Create a timer when the game start, when there is a index exist, start the timer and pause when there is no index on the list. So, your system will no longer needs to constantly create and destroy timer.

    About the integer as countdown, this method is for systems that uses a single timer. Actually you can also use real but I prefer integer.
    Its works like this

    Create a integer array variable "omni_Countdown
    Create a integer array variable "omni_MaxCount
    Create a integer array variable "omni_CurrentTick
    Create a integer array variable "omni_MaxTick

    Given
    timeOut
    is 0.30
    and
    omni_Interval
    is 0.03
    >
    set udg_omni_MaxCount[index] = timeOut/udg_omni_Interval // == 10

    >
    set udg_omni_Countdown[index] = udg_omni_MaxCount[index]

    >
    set udg_omni_CurrentTick[index] = 0

    >
    set udg_omni_MaxTick[index] = i


    In the iterating function
    >add
    Code (vJASS):
    if udg_omni_Countdown > 0 then
        set udg_omni_Countdown[index] = set udg_omni_Countdown[index] - 1
    else
        set udg_omni_Countdown[index] = udg_omni_MaxCount[index]
        set udg_omni_CurrentTick[index] = set udg_omni_CurrentTick[index] + 1


    End the omnislash when CurrentTick >= MaxTick.

    I don't know what you've done. The
    local group g
    is still exist in your code.
    What I mean by replacing
    local group g
    with global variable is
    >remove
    local group g

    >create Unit Group variable "omni_tmpGroup"
    >replace
    g
    with omni_tmpGroup
    >remove CreateGroup and DestroyGroup in your code.
     
    Last edited: Apr 3, 2017
  5. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,137
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    Oh, that is for the default trigger. It's coded so that everything is configurable if you don't use the default trigger. To make it more clear,

    Code (vJASS):

    call RequestOmnislash(caster, target, timeout, damage, range, instances, triggerId)
     


    You can plug in any trigger that you like in the triggerId; the only compromise is that you have to put it in Custom Script.
    If triggerId is null, it resorts to the default setting, explaining what you see in the trigger now.

    So if you have another trigger that catches the moment when the variable
    udg_omni_Omnislash_RealEvent
    is set to 1.00 or 2.00, and you want that instance previously mentioned to have the trigger's actions executed, you can use the triggerId in order to identify which is which. (This is ideally done in a triggercondition)

    That could be a viable suggestion, but I'll have yet to implement timestamps for it and code it in a priority queue form. As a compromise, I'm keeping it as is for now.

    In a way, that is what is being done in the iterating function
    Code (vJASS):

    function pf__Omnislash__onExec takes nothing returns nothing
     


    Changed it now. It will now use a variable
    udg_ENUM_GROUP
    instead of dynamically creating and destroying groups, (although from what I've heard, groups are actually a type of linked list and (this one is from me) they're quite safe to dynamically create and destroy.)
     
  6. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,440
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20

    Needs Fixed

    • Filters for the base omnislash should be configurable from the top
    • 851972 should be configurable
    • Documentation would be appreciated as it will make the review process less tedious and prevent misunderstandings

    Suggestions

    • Update your code to follow the GPAG & JPAG guidelines
    • GetWidgetLife()
      IsUnitState()
      when checking if a unit is alive or dead
    • It's unnecessary to use
      GroupClear()
      before
      GroupEnumUnitsInRange()

    Status


    Awaiting Update
     
  7. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,137
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    Thanks for the suggestions, though I would like to ask a few questions.

    1.) What is your suggestion for the function name instead of
    RequestOmnislash
    and
    ReturnOmnislash
    ?

    2.) Should I add protection by allowing only one instance per slasher or pseudo-protection by queuing the following requests for the same slasher, or ignore protection?
     
    Last edited: Jul 2, 2017
  8. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,440
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    GetOmnislashId

    I would do the former.
     
  9. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,137
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    Okay, then. I'm actually recoding this thing from scratch, so that it would ultimately be nicer to look at.

    How about
    AddOmnislash
    and
    RemoveOmnislash
    ?
    Not only do they provide instances, but they also provide default values, and deallocate instances respectively.
     
    Last edited: Jul 3, 2017
  10. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,440
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    That works then. If you want to be consistent with how naming conventions work in vJASS, you can call it OmnislashCreate & OmnislashDestroy.
     
  11. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,137
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    (July 29, 2017)
    - Updated the bundle with newer examples! (New example in GUI (but it need not be manually displayed because of the preview triggers option :p))
     
    Last edited: Jul 31, 2017
  12. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,440
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    It would be great if you can make the API shorter and more user friendly.
     
  13. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,137
    Resources:
    3
    Models:
    1
    Icons:
    1
    JASS:
    1
    Resources:
    3
    After a year or so, I thought of revisiting the concept, making it more GUI-Friendly in the process. Thus, the revisions were borne, and just as Warcraft 3 gets a Reforged version, so does this get a Remade version.

    If there are bugs which I have not spotted, or cases which are not considered by the system, please let me know here.