1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The contestants were to create water structures for the 20th Terraining Contest. Choose one in the public poll!
    Dismiss Notice
  3. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  4. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  5. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice

Missile PMD v1.2

Submitted by JC Helas
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.

Description


The system make damaging in just once

Changelog


v1.0
- release
v1.1
- Fix PMD_Check function
v1.2
-Conver into gui
-Set in group
-Custom Id allocation

Demo


Click

  • Select
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Set Unit = (Triggering unit)

  • ESC
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Set M_SampleUnit = Unit
      • Set M_SampleSpeed = 1200.00
      • Set M_SampleAngle = (Facing of M_SampleUnit)
      • Set M_SampleDistance = 800.00
      • Set M_SampleDamage = 75.00
      • Set M_SampleAoE = 100.00
      • Set M_SampleAttackType = Spells
      • Set M_SampleDamageType = Normal
      • Set M_SampleAnimation = attack
      • Set M_SampleTargetEffectAttach = origin
      • Set M_SampleTargetEffect = Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Trigger - Run Missile Execute <gen> (ignoring conditions)

  • Missile Execute
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • M_IndexSize Equal to 0
        • Then - Actions
          • Trigger - Turn on Missile Periodic <gen>
        • Else - Actions
      • Set M_IndexSize = (M_IndexSize + 1)
      • Set M_Unit[M_IndexSize] = M_SampleUnit
      • Set M_Angle[M_IndexSize] = M_SampleAngle
      • Set M_Speed[M_IndexSize] = (M_SampleSpeed x 0.03)
      • Set M_Distance[M_IndexSize] = M_SampleDistance
      • Set M_AoE[M_IndexSize] = M_SampleAoE
      • Set M_Damage[M_IndexSize] = M_SampleDamage
      • Set M_AttackType[M_IndexSize] = M_SampleAttackType
      • Set M_DamageType[M_IndexSize] = M_SampleDamageType
      • Set M_TargetEffect[M_IndexSize] = M_SampleTargetEffect
      • Set M_TargetEffectAttach[M_IndexSize] = M_SampleTargetEffectAttach
      • Set M_Animation[M_IndexSize] = M_SampleAnimation
      • Unit - Turn collision for M_SampleUnit Off
      • Animation - Change M_SampleUnit's animation speed to (100.00 x (M_Speed[M_IndexSize] / 5.00))% of its original speed
      • Animation - Play M_SampleUnit's M_SampleAnimation animation
      • -------- =========================================== --------
      • Set PMD_UnitDamager = M_SampleUnit
      • Custom script: call ExecuteFunc("PMDRegister")
      • -------- =========================================== --------
      • Set M_SampleUnit = No unit
      • Set M_SampleAngle = 0.00
      • Set M_SampleSpeed = 0.00
      • Set M_SampleDistance = 0.00
      • Set M_SampleDamage = 0.00
      • Set M_SampleAoE = 0.00
      • Set M_SampleAnimation = <Empty String>
      • Set M_SampleTargetEffectAttach = <Empty String>
      • Set M_SampleTargetEffect = <Empty String>
      • Custom script: set udg_PMD_AttackType = null
      • Custom script: set udg_PMD_DamageType = null

  • Missile Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer M_IndexLoop) from 1 to M_IndexSize, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • M_Distance[M_IndexLoop] Greater than 0.00
            • Then - Actions
              • Animation - Queue M_Unit[M_IndexLoop]'s M_Animation[M_IndexLoop] animation
              • Set M_TempLoc1 = (Position of M_Unit[M_IndexLoop])
              • Set M_TempLoc2 = (M_TempLoc1 offset by M_Speed[M_IndexLoop] towards M_Angle[M_IndexLoop] degrees)
              • Unit - Move M_Unit[M_IndexLoop] instantly to M_TempLoc2, facing M_Angle[M_IndexLoop] degrees
              • Set M_Distance[M_IndexLoop] = (M_Distance[M_IndexLoop] - M_Speed[M_IndexLoop])
              • Set M_Group = (Units within M_AoE[M_IndexLoop] of M_TempLoc2 matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is alive) Equal to
              • Unit Group - Pick every unit in M_Group and do (Actions)
                • Loop - Actions
                  • Set M_Unit[0] = (Picked unit)
                  • Special Effect - Create a special effect attached to the M_TargetEffectAttach[M_IndexLoop] of M_Unit[0] using M_TargetEffect[M_IndexLoop]
                  • Special Effect - Destroy (Last created special effect)
                  • -------- =========================================== --------
                  • Set PMD_UnitDamager = M_Unit[M_IndexLoop]
                  • Set PMD_UnitTarget = M_Unit[0]
                  • Set PMD_Damage = M_Damage[M_IndexLoop]
                  • Set PMD_AttackType = M_AttackType[M_IndexLoop]
                  • Set PMD_DamageType = M_DamageType[M_IndexLoop]
                  • Custom script: call ExecuteFunc("PMDCheck")
                  • -------- =========================================== --------
              • Custom script: call DestroyGroup(udg_M_Group)
              • Custom script: call RemoveLocation( udg_M_TempLoc1 )
              • Custom script: call RemoveLocation( udg_M_TempLoc2 )
            • Else - Actions
              • Unit - Turn collision for M_Unit[M_IndexLoop] On
              • Animation - Change M_Unit[M_IndexLoop]'s animation speed to 100.00% of its original speed
              • Animation - Reset M_Unit[M_IndexLoop]'s animation
              • -------- =========================================== --------
              • Set PMD_UnitDamager = M_Unit[M_IndexLoop]
              • Custom script: call ExecuteFunc("DePMD")
              • -------- =========================================== --------
              • Set M_Unit[M_IndexLoop] = M_Unit[M_IndexSize]
              • Set M_Angle[M_IndexLoop] = M_Angle[M_IndexSize]
              • Set M_Speed[M_IndexLoop] = M_Speed[M_IndexSize]
              • Set M_Distance[M_IndexLoop] = M_Distance[M_IndexSize]
              • Set M_AoE[M_IndexLoop] = M_AoE[M_IndexSize]
              • Set M_Damage[M_IndexLoop] = M_Damage[M_IndexSize]
              • Set M_AttackType[M_IndexLoop] = M_AttackType[M_IndexSize]
              • Set M_DamageType[M_IndexLoop] = M_DamageType[M_IndexSize]
              • Set M_Animation[M_IndexLoop] = M_Animation[M_IndexSize]
              • Set M_TargetEffect[M_IndexLoop] = M_TargetEffect[M_IndexSize]
              • Set M_TargetEffectAttach[M_IndexLoop] = M_TargetEffectAttach[M_IndexSize]
              • Set M_Animation[M_IndexLoop] = M_Animation[M_IndexSize]
              • Set M_IndexSize = (M_IndexSize - 1)
              • Set M_IndexLoop = (M_IndexLoop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • M_IndexSize Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions



Trigger


Click

  • PMD by Silver Dust
    • Events
    • Conditions
    • Actions
      • -------- My purpose is to make your missile triggering easy and quickly. --------
      • Custom script: endfunction
      • Custom script:
      • Custom script: function PMDNull takes nothing returns nothing
      • Custom script: set udg_PMD_UnitDamager = null
      • Custom script: set udg_PMD_UnitTarget = null
      • Custom script: set udg_PMD_AttackType = null
      • Custom script: set udg_PMD_DamageType = null
      • Custom script: set udg_PMD_Damage = 0
      • Custom script: endfunction
      • Custom script:
      • Custom script: function DePMD takes nothing returns nothing
      • Custom script: local integer i = udg_PMD_Index
      • Custom script: loop
      • Custom script: exitwhen i == 0
      • Custom script: if (udg_PMD_UnitIndex[i] == udg_PMD_UnitDamager) then
      • Custom script: call DestroyGroup(udg_PMD_UnitStorage[i])
      • Custom script: set udg_PMD_UnitIndex[i] = null
      • Custom script: set udg_PMD_RecycleIndex = udg_PMD_RecycleIndex + 1
      • Custom script: set udg_PMD_RecycleId[udg_PMD_RecycleIndex] = i
      • Custom script: set i = 1
      • Custom script: endif
      • Custom script: set i = i - 1
      • Custom script: endloop
      • Custom script: set udg_PMD_UnitDamager = null
      • Custom script: endfunction
      • Custom script:
      • Custom script: function PMDCheck takes nothing returns nothing
      • Custom script: local integer i = udg_PMD_Index
      • Custom script: loop
      • Custom script: exitwhen i == 0
      • Custom script: if (udg_PMD_UnitIndex[i] == udg_PMD_UnitDamager) then
      • Custom script: set udg_PMD_UnitStorage[0] = udg_PMD_UnitStorage[i]
      • Custom script: set i = 1
      • Custom script: elseif not (udg_PMD_UnitStorage[i] == null) then
      • Custom script: call DestroyGroup(udg_PMD_UnitStorage[i])
      • Custom script: set udg_PMD_RecycleIndex = udg_PMD_RecycleIndex + 1
      • Custom script: set udg_PMD_RecycleId[udg_PMD_RecycleIndex] = i
      • Custom script: endif
      • Custom script: set i = i - 1
      • Custom script: endloop
      • Custom script: if (udg_PMD_UnitStorage[0] == null) then
      • Custom script: call PMDNull()
      • Custom script: return
      • Custom script: elseif not IsUnitInGroup(udg_PMD_UnitTarget,udg_PMD_UnitStorage[0]) then
      • Custom script: call UnitDamageTarget(udg_PMD_UnitDamager,udg_PMD_UnitTarget,udg_PMD_Damage,false,false,udg_PMD_AttackType,udg_PMD_DamageType,null)
      • Custom script: call GroupAddUnit(udg_PMD_UnitStorage[0],udg_PMD_UnitTarget)
      • Custom script: set udg_PMD_UnitStorage[0] = null
      • Custom script: endif
      • Custom script: call PMDNull()
      • Custom script: endfunction
      • Custom script:
      • Custom script: function PMDRegister takes nothing returns nothing
      • Custom script: local integer index
      • Custom script: local integer i = udg_PMD_Index
      • Custom script: loop
      • Custom script: exitwhen i == 0
      • Custom script: if (udg_PMD_UnitIndex[i] == udg_PMD_UnitDamager) then
      • Custom script: set i = 1
      • Custom script: set udg_PMD_UnitDamager = null
      • Custom script: return
      • Custom script: endif
      • Custom script: set i = i - 1
      • Custom script: endloop
      • Custom script: if (udg_PMD_RecycleIndex > 0) then
      • Custom script: set index = udg_PMD_RecycleId[udg_PMD_RecycleIndex]
      • Custom script: set udg_PMD_RecycleIndex = udg_PMD_RecycleIndex - 1
      • Custom script: set udg_PMD_RecycleId[udg_PMD_RecycleIndex] = 0
      • Custom script: else
      • Custom script: set index = udg_PMD_Index + 1
      • Custom script: set udg_PMD_Index = index
      • Custom script: endif
      • Custom script: set udg_PMD_UnitIndex[index] = udg_PMD_UnitDamager
      • Custom script: set udg_PMD_UnitStorage[index] = CreateGroup()
      • Custom script: set udg_PMD_UnitDamager = null



Keywords:
Prevent, Multiple, Damage, Missile, Easy, Simple, usd99
Contents

Just another Warcraft III map (Map)

Reviews
Moderator
BPower: This is not a Missile system, but allows to controll which units are already damage by a spell. Currently not very efficient or easy to use. In general not a bad idea, but you need a much better API. Why do you code everything in custom...
  1. BPower: This is not a Missile system, but allows to controll which units are
    already damage by a spell. Currently not very efficient or easy to use.
    In general not a bad idea, but you need a much better API.

    Why do you code everything in custom scripts? It's very hard to read,
    thus making mistakes is pregprogrammend. Move to either plain JASS
    or back to normal read-able GUI.

    Need Fix

    09:42, 27th Mar 2015
    IcemanBo:
    Add a proper description.
    Read BPower's post: http://www.hiveworkshop.com/forums/spells-569/missile-pmd-v1-1-a-263896/?prev=status=p#post2666314
     
  2. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    154
    Resources:
    2
    Spells:
    2
    Resources:
    2
    damn this must be
    Code (vJASS):

    function PMD_Check takes unit t, unit d, unit c returns nothing

        local integer accesnumber = 0
        local integer i = 1
        local integer i1 = 0
        local integer i2 = 0
        local integer i3 = 0

        set udg_PMD_Acces = false

        loop

            exitwhen i > udg_PMD_MUI

            if udg_PMD_Target[i] == t then

                set i1 = 1

            endif
            if udg_PMD_Dummy[i] == d then

                set i2 = 1

            endif
            if udg_PMD_Caster[i] == c then

                set i3 = 1

            endif

            set i = i + 1

        endloop

        if i1 == 1 and i2 == 1 and i3 == 1 then

            set udg_PMD_Acces = true

        else

            set udg_PMD_Acces = false

        endif
       
    endfunction
     


    Code (vJASS):

    function PMD_Check takes unit t, unit d, unit c returns nothing

        local integer accesnumber = 0
        local integer i = 1

        set udg_PMD_Acces = false

        loop

            exitwhen i > udg_PMD_MUI

            if udg_PMD_Target[i] == t and udg_PMD_Dummy[i] == d and udg_PMD_Caster[i] == c then

                set udg_PMD_Acces = true

            endif

            set i = i + 1

        endloop
       
    endfunction
     
     
  3. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    What you do here is not effective. Just allocate a group and use IsUnitInGroup.
    If you are using vJass you can also use Table.
    --> table.has(GetHandleId(unit)). In the end flush or destroy the Table.

    Why search with O(n) if you can have O(1). Less interpreter threads, less lookup time.
     
    Last edited: Mar 21, 2015
  4. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    154
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I always read that "use unit group" , how , I want to know, cause if I use group with index , only group with index 1 can be load a units else always zero can't load units
     
  5. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    custom script: set udg_My_Group[index] = CreateGroup()
    custom script: call DestroyGroup(udg_My_Group[index])
    custom script: set udg_My_Group[index] = null
     
  6. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    154
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I mean the unit group with index 2,3,4,5,6,7... they useless, I can't load them.
     
  7. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    154
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Ahh OK now, I only have to do is just to type creategroup right ^^
     
  8. JC Helas

    JC Helas

    Joined:
    Oct 19, 2014
    Messages:
    154
    Resources:
    2
    Spells:
    2
    Resources:
    2
    But, it still working :)
     
  9. Almia

    Almia

    Joined:
    Apr 24, 2012
    Messages:
    4,861
    Resources:
    35
    Spells:
    30
    Tutorials:
    4
    JASS:
    1
    Resources:
    35
    Are you sure about the recycling method? :D

    Because currently it is bad. Missile Systems are required to have Instant Facing methods in their Dummy Recycling System.
    Because of that, This is also a Nope.

    (If you want to learn about instant facing, approach Nes)
     
  10. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    @Almia: This system is not about Missile creating.
    It's a over complicated approach to store units, which have already been hit
    by a missle.

    At least this was the goal of usd99 .... I think
     
  11. Dat-C3

    Dat-C3

    Joined:
    Mar 15, 2012
    Messages:
    2,460
    Resources:
    10
    Models:
    1
    Maps:
    5
    Spells:
    3
    Tutorials:
    1
    Resources:
    10
  12. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,107
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Are you willing to switch to plain JASS?
    Also "The system make damaging in just once" is vague.
    Please improve the description, as already mentioned in past.
     
  13. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    The name "Missile" is very irritating as your system covers controlled damage dealing
    and not missile movement. Chose another name for the system, move to plain JASS or back to GUI.

    Not really benefitial at the moment as you create a hell of overhead using ExecuteFunc
    periodically within a groupenumeration. i recommend to use TriggerEvaluate instead.

    For now set to Need Fix.

    Side notes:
    I expect from a missile system the following ( this one is no Missile system ):

    1.) Easily create a new missile instance.

    2.) Access to the following members ( set&get)
    • speed, angle, distance, collision
    • source, target, ( owner )
    • arc, curve
    • x, y, z, dummy, hit units ( group )
    • model, scale

    3.) movement is completly done by the system, while users has controll at any time.

    You might want to take a look into this.

    Coding everything in custom scripts is not a benefit. In that case I recommend plain JASS.