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. Lead your forces to battle in the 15th Techtree Contest. The call is yours, commander!
    Dismiss Notice
  5. The reforging of the races is complete. Come see the 14th Techtree Contest Results.
    Dismiss Notice
  6. It's time to choose your horse in the race - the 32nd Modeling Contest Poll is up!
    Dismiss Notice
  7. 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.

Missile [GUI] version 1.6.1

Submitted by BPower
This bundle is marked as awaiting update. A staff member has requested changes to it before it can be approved.
Missile [GUI]

A system made to handle, optimize and ease projectile creation in your map.





The three golden rules for Missile
top
  1. Neither Missile__Origin nor Missile__Impact leak.
    Missile removes both location handles internally.

    ---
  2. All variables storing missile properties such as Missile__Owner or Missile__Damage
    are only valid within a trigger action function fired from the Missile trigger interface.
    Otherwise they will be null, 0 or false. To put it simple invalid.

    ---
  3. Every Missile related variable is prefixed with Missile
    You may only use variables with two underscores __, such as Missile__Source
    or variables with one underscore _, such as Missile_Source[index].
    All other variables are private and strictly reserved for the internal structure of Missile.


Create & destroy missiles
top

Create a missiles via Run Missile Configuration <gen> - Set missile properties - Run Missile <gen> syntax.
For example like here in my Fireball trigger:
  • Fireball Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Fireball
    • Actions
      • Set Missile__TempLoc = (Target point of ability being cast)
      • -------- --------
      • Trigger - Run Missile Configurate <gen> (ignoring conditions)
      • Set Missile__Source = (Triggering unit)
      • Set Missile__Owner = (Triggering player)
      • Set Missile__Origin = (Position of Missile__Source)
      • Set Missile__Impact = (Missile__Origin offset by 550.00 towards (Angle from Missile__Origin to Missile__TempLoc) degrees)
      • Set Missile__ImpactZ = 50.00
      • Set Missile__OriginZ = 50.00
      • Set Missile__Speed = 500.00
      • Set Missile__Model = Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
      • Trigger - Run Missile <gen> (ignoring conditions)
      • -------- --------
      • Custom script: call RemoveLocation(udg_Missile__TempLoc)


A missile can be manually destroyed during each trigger event via
  • Set Missile__WantDestroy = True

or automatically when reaching the impact point.



Missile trigger interface
top

Missile optionally runs the five below listed trigger events.
Each event will upon occurrence run the trigger set to the trigger variable.
In the example below Fireball Actions <gen> would run for all events.

  • Set Missile__OnPeriodic = Fireball Actions <gen>
  • Set Missile__OnCollideUnit = Fireball Actions <gen>
  • Set Missile__OnCollideDestructable = Fireball Actions <gen>
  • Set Missile__OnFinish = Fireball Actions <gen>
  • Set Missile__OnRemove = Fireball Actions <gen>


You can identify the dispatched trigger by evaluating Missile__EventId in an integer comparison with
these constant Missile event variables for example Missile__EventId equals EVENT_MISSILE_FINISH

  • EVENT_MISSILE_PERIODIC runs every timer interval.
  • EVENT_MISSILE_COLLIDE_UNIT runs on unit collision.
  • EVENT_MISSILE_COLLIDE_DEST runs on destructable collision.
  • EVENT_MISSILE_FINISH runs if the impact point is reached. If on finish is defined you must destroy the missile manually.
  • EVENT_MISSILE_REMOVE runs when a missile is irrevocably destroyed.

Missile variables - Documentated in JASS format
top

Code (vJASS):
//=============================================================
//  Missile API.
//=============================================================  
// Syntax for missile creation in GUI:
//    1. Run trigger Missile Configurate <gen>
//    2. Set properties via scalar variables.
//    3. Run trigger Missile <gen>
// JASS users may call the create and launch function directly.
//
// Missile operates with custom events.
// This means that you have access to
// a missile's properties within action functions
// of the Missile trigger interface.
//
// "udg_Missile__EventId" indicates
// which event trigger has been dispatched.
//
// "udg_Missile__EventIndex" is the array index
// of the triggering missile.
//
// Avaliable events are:
//
//   1.) udg_EVENT_MISSILE_COLLIDE_UNIT
//        • Runs when a missile collides with a unit.
//
//   2.) udg_EVENT_MISSILE_COLLIDE_DEST
//        • Runs when a missile collides with a destructable.
//
//   3.) udg_EVENT_MISSILE_PERIODIC
//        • Runs every missile timer interval.
//
//   4.) udg_EVENT_MISSILE_FINISH
//        • Runs when a missile reaches its impact position.
//
//   5.) udg_EVENT_MISSILE_REMOVE
//        • Runs when a missile is destroyed.
//
//   6.) udg_EVENT_MISSILE_NOTHING
//        • Value of udg_Missile__EventId when accessed
//          from outside a trigger action function.
//
// During every missile event you may use the
// following GUI generated variables.
// Every scalar variable has an equivalent array variable,
// which you can read and use at any time.
// For exmple: udg_Missile__Source vs. udg_Missile_Source[index]
//
// Trigger variables which fire Missile events:
//
//    trigger udg_Missile__OnCollideUnit            -    trigger array udg_Missile_OnUnit
//    trigger udg_Missile__OnCollideDestructable    -    trigger array udg_Missile_OnDest
//    trigger udg_Missile__OnPeridoic               -    trigger array udg_Missile_OnPeriodic
//    trigger udg_Missile__OnRemove                 -    trigger array udg_Missile_OnRemove
//    trigger udg_Missile__OnFinish                 -    trigger array udg_Missile_OnFinish
//
// Variables which mimic a function call:
//
//    location udg_Missile__Origin    
//    location udg_Missile__Impact      
//    boolean  udg_Missile__WantDestroy    -    boolean array udg_Missile_WantDestroy
//    boolean  udg_Missile__Recycle        -    boolean array udg_Missile_Recycle
//    real     udg_Missile__Scale          -    real    array udg_Missile_Scale
//    real     udg_Missile__FlyTime        -    real    array udg_Missile_FlyTime ( Converts time in seconds to a vector lenght )
//    real     udg_Missile__Model          -    string  array udg_Missile_Model   ( Converts a string path to a special effect )
//    real     udg_Missile__Arc            -    real    array udg_Missile_Arc     ( Converts an arc in degree to height value )
//    real     udg_Missile__Curve          -    real    array udg_Missile_Curve   ( Converts a curve in degree to an open value )
//
// Variables for read-only:
//
//    integer udg_Missile__EventId    
//    integer udg_Missile__EventIndex  
//    unit    udg_Missile__Dummy           -    unit array udg_Missile_Dummy
//    real    udg_Missile__Angle           -    real array udg_Missile_Angle    ( In radians )
//    real    udg_Missile__Distance        -    real array udg_Missile_Distance ( Total distance traveled )
//
// Variables for read and set.
//
//    unit    udg_Missile__Source          -    unit    array udg_Missile_Source
//    unit    udg_Missile__Target          -    unit    array udg_Missile_Target    ( Enables homing behaviour towards a target unit )
//    player  udg_Missile__Owner           -    unit    array udg_Missile_Owner     ( Pseudo-owner for better onCollide evaluation )
//    real    udg_Missile__ImpactZ         -    real    array udg_Missile_ImpactZ
//    real    udg_Missile__OriginZ         -    real    array udg_Missile_OriginZ
//    real    udg_Missile__Damage          -    real    array udg_Missile_Damage
//    real    udg_Missile__Collision       -    real    array udg_Missile_Collision
//    real    udg_Missile__Speed           -    real    array udg_Missile_Speed
//    real    udg_Missile__Acceleration    -    real    array udg_Missile_Acceleration
//    real    udg_Missile__Height          -    real    array udg_Missile_Height    ( Highest point of the parabola )
//    real    udg_Missile__Open            -    real    array udg_Missile_Open      
//    real    udg_Missile__Turn            -    real    array udg_Missile_Turn      ( Turn ratio per second )
//    real    udg_Missile__Data            -    integer array udg_Missile_Data



Example trigger action function
top

Let's see how the event triggers run code in an action function.
We stick to the fireball scenario. This spell is also included in the demo map.

  • Fireball Actions
    • Events
    • Conditions
    • Actions
      • -------- As you can see Missile__EventId allows you --------
      • -------- to identify which event trigger dispatched. --------
      • -------- Therefore you can run all actions from one trigger function. --------
      • -------- Of course you can also seperate triggers into different triggers. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Missile__EventId Equal to EVENT_MISSILE_REMOVE
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Missile__Data Equal to 1
            • Then - Actions
              • -------- Create more fireballs --------
              • -------- Reference to Missile__Dummy will be removed --------
              • -------- Once you call Run Missile Configurate <gen> --------
              • Set Missile__TempLoc = (Position of Missile__Dummy)
              • For each (Integer A) from 1 to 6, do (Actions)
                • Loop - Actions
                  • Trigger - Run Missile Configurate <gen> (ignoring conditions)
                  • Set Missile__Origin = (Point((X of Missile__TempLoc), (Y of Missile__TempLoc)))
                  • Set Missile__Impact = (Missile__Origin offset by 450.00 towards (60.00 x (Real((Integer A)))) degrees)
                  • Set Missile__ImpactZ = 50.00
                  • Set Missile__Height = 350.00
                  • Set Missile__OriginZ = 50.00
                  • Set Missile__Speed = 500.00
                  • Set Missile__Damage = 150.00
                  • Set Missile__Source = Missile_Source[Missile__EventIndex]
                  • Set Missile__Owner = Missile_Owner[Missile__EventIndex]
                  • Set Missile__Model = Abilities\Weapons\FireBallMissile\FireBallMissile.mdl
                  • Set Missile__OnCollideUnit = Fireball Actions <gen>
                  • Set Missile__OnRemove = Fireball Actions <gen>
                  • Set Missile__Data = 2
                  • Trigger - Run Missile <gen> (ignoring conditions)
              • Custom script: call RemoveLocation(udg_Missile__TempLoc)
              • Custom script: set udg_Missile__TempLoc = null
            • Else - Actions
              • Set Missile__TempLoc = (Position of Missile__Dummy)
              • Set Temp_Group = (Units within 128.00 of Missile__TempLoc matching ((((Matching unit) belongs to an enemy of Missile__Owner) Equal to True) and (((Matching unit) is alive) Equal to True)))
              • Unit Group - Pick every unit in Temp_Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause Missile__Source to damage (Picked unit), dealing Missile__Damage damage of attack type Spells and damage type Normal
              • Special Effect - Create a special effect at Missile__TempLoc using Abilities\Spells\Other\Doom\DoomDeath.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call DestroyGroup(udg_Temp_Group)
              • Custom script: call RemoveLocation(udg_Missile__TempLoc)
              • Custom script: set udg_Missile__TempLoc = null
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Missile__EventId Equal to EVENT_MISSILE_COLLIDE_UNIT
              • (Missile__UnitHit belongs to an enemy of Missile__Owner) Equal to True
            • Then - Actions
              • -------- See how easy damaging got. --------
              • Unit - Cause Missile__Source to damage Missile__UnitHit, dealing Missile__Damage damage of attack type Normal and damage type Normal
              • Set Missile__WantDestroy = True
            • Else - Actions




Keywords:
Missile, Projectile, System
Contents

Just another Warcraft III map (Map)

Reviews
IcemanBo
Submission: [c]Missile [GUI] v1.61[r] Date: [c]1 January 2017[r] Status: [c]Awaiting Update[r] Rating: [c]noneNote: It works actually, but there are some things that needs your attention first. Alone such little things that event ids are different...
  1. gusanomental

    gusanomental

    Joined:
    Oct 16, 2013
    Messages:
    238
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Sorry, my question wasn't clear at all. I need to know how to run Actions <gen> when my missiles enter a certain region.
     
  2. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    3,788
    Resources:
    1
    Spells:
    1
    Resources:
    1
    • Events
      • -------- this is run automatically by the system --------
    • Conditions
    • Actions
      • If (All conditions) then (actions) else (actions)
        • If - Conditions
          • Missile__EventId equal to EVENT_MISSILE_PERIODIC
          • Missile__Data equal to 1 //Maybe should be == 0, depends if Missile__Data starts at 0 or 1 by default
          • (YourRegion <gen> contains Missile__Dummy) Equal to True
        • Then - Actions
          • Set Missile__Data = 2 //maybe 1, see above
          • -------- Do your stuff --------
        • Else - Actions
     
  3. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,384
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Submission: Missile [GUI] v1.61
    Date: 1 January 2017
    Status: Awaiting Update
    Rating: none
    Note:

    It works actually, but there are some things that needs your attention first.
    Alone such little things that event ids are different from description is something unnecessary.
    Some other things were mentioned, too, in thread, but you will probably know best when you come back.

    What is also for me a lacking missile feature is not being able to define a maximum of duration. Travaled distance is not always enough.
    I know you started Projectile library, but I'm still sceptic if we really need to different approaches for similar goals.

    No rating yet, and again for all, this system should work, but before being approved I would feel better if BPower steps in again to make the code a round thing.
     
  4. Shaeam

    Shaeam

    Joined:
    Aug 11, 2010
    Messages:
    265
    Resources:
    1
    Maps:
    1
    Resources:
    1
    This looks like a great system, though I'm thoroughly disappointed that the homing feature doesn't work with arcs. It's really easy to use and pretty powerful, I'm definitely interested in seeing this system being worked on more and hopefully be a very simplistic system yet offering great power.
     
  5. TheBigMetalHandInTheSky

    TheBigMetalHandInTheSky

    Joined:
    Jan 14, 2017
    Messages:
    75
    Resources:
    0
    Resources:
    0
    This is nice, but I want to know what the ImpactZ and OriginZ variables mean.
     
  6. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,527
    Resources:
    18
    Tools:
    2
    Maps:
    3
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    18
    OriginZ: The starting Flying height of your Missle. If you set it a heigh number your Missle will Fall from the Sky.

    ImpactZ: To which heigh over the Ground/Unit the Missle Flies.
     
  7. TheBigMetalHandInTheSky

    TheBigMetalHandInTheSky

    Joined:
    Jan 14, 2017
    Messages:
    75
    Resources:
    0
    Resources:
    0
    I copied 'Missile BPower' into my map and the variables didn't generate. Did I do something wrong?
     
  8. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,384
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
  9. TheBigMetalHandInTheSky

    TheBigMetalHandInTheSky

    Joined:
    Jan 14, 2017
    Messages:
    75
    Resources:
    0
    Resources:
    0
    What does Missile__Data refer to?
     
  10. Clanzion

    Clanzion

    Joined:
    Jul 4, 2016
    Messages:
    438
    Resources:
    0
    Resources:
    0
    I am getting this error Error Image | HIVE I have a UnitIndexer in the map, thinking that might be the cause. It affects the missile template spells in my map.

    P.S. Does anyone know how to make it not continously fire off multiple missiles until the target is dead when used within a damage event (specifically Bribe's damage engine). I tried turning off the Unit Indexer, which did not work.
     
    Last edited: Sep 29, 2018
  11. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,212
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    What is the map you're testing it on?
     
  12. Clanzion

    Clanzion

    Joined:
    Jul 4, 2016
    Messages:
    438
    Resources:
    0
    Resources:
    0
    EDIT: This system works fine but when using around 12 units firing off homing missiles for at least 5 mins in the same area, the fps begins to drop severely to nearly 0 permanently. It stays on a steady 39-40 in the beginning. Is it because too many missile dummies staying put around the same area or being made?

    This does not appear to happen when its not homing missiles.
     

    Attached Files:

  13. brized

    brized

    Joined:
    Aug 25, 2007
    Messages:
    79
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Is there a way to use events to influence the facing/direction of missiles once they're already in flight?
     
  14. Clanzion

    Clanzion

    Joined:
    Jul 4, 2016
    Messages:
    438
    Resources:
    0
    Resources:
    0
    A way you could do this to is to use your own missile dummy that isn't used by the system and launch a new missile with the old missile dummy. This could be done during the Looping event or at the end of the missile duration. Just make to destroy the previous missile duration.
     
  15. brized

    brized

    Joined:
    Aug 25, 2007
    Messages:
    79
    Resources:
    2
    Maps:
    2
    Resources:
    2
    I could see doing something like that, like selecting the missile, removing it, and firing back a new missile. Only problem is I can't figure out a way to select any of this system's missiles in flight. If I try selecting all units owned by Neutral Passive and killing them, that works, but if I try selecting units within X range of a point, that doesn't work with these missiles.
     
  16. Clanzion

    Clanzion

    Joined:
    Jul 4, 2016
    Messages:
    438
    Resources:
    0
    Resources:
    0
    You can refer directly to the missile during the missile events through the variable udg_Missile__Dummy.
     
  17. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,212
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    You can't enumerate a unit with the Locust ability.
     
  18. burner89

    burner89

    Joined:
    Mar 11, 2019
    Messages:
    31
    Resources:
    0
    Resources:
    0
    Hey idk if you're still here, but I'm having an issue creating a special effect on missile finish. It should run collat on finish(it does, but it doesn't create a special effect...)


    Edit: Nevermind, figured it out. I had to change it to MissileLocZ instead of missile__impact. Will leave this up for anyone else.




    • RIFLESHOT Copy
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Snipe
      • Actions
        • Set Missile__TempLoc = (Target point of ability being cast)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • EVENT_MISSILE_COLLIDE_DEST Equal to Missile__EventId
          • Then - Actions
            • Set Missile__WantDestroy = True
            • Animation - Play Missile__DestructableHit's stand hit animation
          • Else - Actions
            • For each (Integer A) from 1 to 1, do (Actions)
              • Loop - Actions
                • Trigger - Run Missile Configurate <gen> (ignoring conditions)
                • Set Missile__Source = (Triggering unit)
                • Set Missile__Owner = (Triggering player)
                • Set Missile__Origin = (Position of Missile__Source)
                • Set Missile__OriginZ = 50.00
                • Set Missile__Impact = (Target point of ability being cast)
                • Set Missile__ImpactZ = 0.00
                • Set Missile__FlyTime = 0.50
                • Set Missile__Speed = 2000.00
                • Set Missile__Collision = 50.00
                • Set Missile__Height = 1.00
                • Set Missile__Damage = 100.00
                • Set Missile__Curve = (-70.00 + (35.00 x (Real((Integer A)))))
                • Set Missile__Model = Abilities\Weapons\HarpyMissile\HarpyMissile.mdl
                • Set Missile__Data = 1
                • -------- Set trigger with should run on missile events. --------
                • Set Missile__OnFinish = collat <gen>
                • Set Missile__OnRemove = collat <gen>
                • Set Missile__OnCollideDestructable = Destruct kill Copy <gen>
                • Set Missile__OnCollideUnit = unithit Copy <gen>
                • Trigger - Run Missile <gen> (ignoring conditions)
                • Custom script: call RemoveLocation(udg_Missile__TempLoc)
                • Custom script: set udg_Missile__TempLoc = null
    • ------------------------------------------------------------------------------------
    • collat
      • Events
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Missile__EventId Equal to EVENT_MISSILE_FINISH
          • Then - Actions
            • Special Effect - Create a special effect at Missile__Impact using Abilities\Spells\Undead\DarkSummoning\DarkSummonMissile.mdl
            • Set Missile__WantDestroy = True
          • Else - Actions
     
    Last edited: Mar 11, 2019