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

Missile v1.04

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Requested by Marcikat
Missile! is a spell that fires a rocket that has a range of 1500. The missile flies straight and detonates on impact with either the 1500 range mark or any enemies in the way. Damage, cooldown, range of the rocket, levels, impact range, are all customizable.
Missile! - Level 1 - 100 Damage with 130 impact range.
Missile! - Level 2 - 200 Damage with 180 impact range.
Missile! - Level 3 - 300 Damage with 240 impact range.
Fully MUI/GUI; three different casters included in demo map. Red, blue and teal are available with the testing.

DooM_AngeaL - Spell
Flood - Fixing
baassee - Fixing
Laserdude - Fixing
Adiktuz - Fixing

Code:

  • Missile cast
    • Missile cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Missile
    • Actions
      • Set player_hero[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Set temploc3[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Animation - Play (Triggering unit)'s attack animation
      • Animation - Queue (Triggering unit)'s stand animation
      • Special Effect - Create a special effect attached to the weapon of (Triggering unit) using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Missle for (Owner of (Triggering unit)) at temploc3[(Player number of (Owner of (Triggering unit)))] facing (Facing of (Triggering unit)) degrees
      • Unit - Turn collision for (Last created unit) Off
      • Unit - Add a 3.33 second Generic expiration timer to (Last created unit)
      • Unit Group - Add (Last created unit) to missle_unit[(Player number of (Owner of (Triggering unit)))]
      • Trigger - Turn on Missile Collision <gen>
      • Trigger - Turn on Missle Movement <gen>
      • Trigger - Turn on Missile DeathIDamage <gen>
      • Custom script: call RemoveLocation(udg_temploc)
      • Custom script: call RemoveLocation(udg_temploc3[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])

  • Missile Collision
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in missle_unit[(Integer A)] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Set missle_collisionloc[(Integer A)] = (Position of (Picked unit))
                  • Set missle_unitgroup[(Integer A)] = (Units within 130.00 of missle_collisionloc[(Integer A)])
                  • Unit Group - Pick every unit in missle_unitgroup[(Integer A)] and do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Or - Any (Conditions) are true
                            • Conditions
                              • ((Picked unit) is dead) Equal to True
                              • ((Picked unit) belongs to an ally of (Owner of (Random unit from missle_unit[(Integer A)]))) Equal to True
                        • Then - Actions
                        • Else - Actions
                          • Unit Group - Pick every unit in missle_unit[(Integer A)] and do (Actions)
                            • Loop - Actions
                              • Unit - Make (Picked unit) Vulnerable
                          • Unit Group - Pick every unit in missle_unitgroup[(Integer A)] and do (Actions)
                            • Loop - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • Or - Any (Conditions) are true
                                    • Conditions
                                      • ((Picked unit) is dead) Equal to True
                                      • ((Picked unit) belongs to an ally of (Owner of (Random unit from missle_unit[(Integer A)]))) Equal to True
                                • Then - Actions
                                • Else - Actions
                                  • Unit Group - Pick every unit in missle_unit[(Integer A)] and do (Actions)
                                    • Loop - Actions
                                      • Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 100.00 at missle_collisionloc[(Integer A)], dealing 1.00 damage of attack type Spells and damage type Normal
                          • Unit Group - Pick every unit in missle_unit[(Integer A)] and do (Actions)
                            • Loop - Actions
                              • Unit - Make (Picked unit) Invulnerable
                  • Custom script: call RemoveLocation(udg_missle_collisionloc[GetForLoopIndexA()])
                  • Custom script: call DestroyGroup(udg_missle_unitgroup[GetForLoopIndexA()])
                • Else - Actions
  • Missile DeathIDamage
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Missle
    • Actions
      • Set temploc = (Position of (Dying unit))
      • Special Effect - Create a special effect at temploc using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Missile for player_hero[(Player number of (Owner of (Dying unit)))]) Equal to 1
        • Then - Actions
          • Unit - Cause (Dying unit) to damage circular area after 0.00 seconds of radius 200.00 at temploc, dealing 100.00 damage of attack type Spells and damage type Normal
          • Destructible - Pick every destructible within 200.00 of temploc and do (Actions)
            • Loop - Actions
              • Destructible - Kill (Picked destructible)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Missile for player_hero[(Player number of (Owner of (Dying unit)))]) Equal to 2
            • Then - Actions
              • Unit - Cause (Dying unit) to damage circular area after 0.00 seconds of radius 200.00 at temploc, dealing 200.00 damage of attack type Spells and damage type Normal
              • Destructible - Pick every destructible within 200.00 of temploc and do (Actions)
                • Loop - Actions
                  • Destructible - Kill (Picked destructible)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Missile for player_hero[(Player number of (Owner of (Dying unit)))]) Equal to 3
                • Then - Actions
                  • Unit - Cause (Dying unit) to damage circular area after 0.00 seconds of radius 200.00 at temploc, dealing 300.00 damage of attack type Spells and damage type Normal
                  • Destructible - Pick every destructible within 200.00 of temploc and do (Actions)
                    • Loop - Actions
                      • Destructible - Kill (Picked destructible)
                • Else - Actions
      • Custom script: call RemoveLocation(udg_temploc)
      • Unit Group - Remove (Dying unit) from missle_unit[(Player number of (Owner of (Dying unit)))]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in missle_unit[(Player number of (Owner of (Dying unit)))]) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Missile Collision <gen>
          • Trigger - Turn off Missle Movement <gen>
        • Else - Actions
  • Missle Movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Missle
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Set temploc1 = (Position of (Picked unit))
              • Set temploc2 = (temploc1 offset by 13.00 towards (Facing of (Picked unit)) degrees)
              • Unit - Move (Picked unit) instantly to temploc2
              • Custom script: call RemoveLocation(udg_temploc1)
              • Custom script: call RemoveLocation(udg_temploc2)
            • Else - Actions
              • Do nothing
Keywords:
cast, missle, request, missile, missle, spell, fire, fires, rocket, range, 1500, fly, straight, boom, explode, impact, enemy, damage, cooldown, levels
Contents

missle (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 14:30, 4th Mar 2011 Bribe: My review Status: Rejected until updated

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long time as NeedsFix. Rejected.

14:30, 4th Mar 2011
Bribe:

My review

Status: Rejected until updated
 
Level 12
Joined
Apr 16, 2010
Messages
584
Second trigger should look like this:
  • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (missle_unit[(Integer A)] is alive) Equal to True
        • Then - Actions
          • Set missle_collisionloc[(Integer A)] = (Position of missle_unit[(Integer A)])
          • Set missle_unitgroup[(Integer A)] = (Units within 130.00 of missle_collisionloc[(Integer A)])
          • Unit Group - Pick every unit in missle_unitgroup[(Integer A)] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • ((Picked unit) is dead) Equal to True
                      • ((Picked unit) belongs to an ally of (Owner of missle_unit[(Integer A)])) Equal to True
                • Then - Actions
                • Else - Actions
                  • Unit - Make missle_unit[(Integer A)] Vulnerable
                  • Unit - Cause (Picked unit) to damage missle_unit[(Integer A)], dealing 1.00 damage of attack type Normal and damage type Normal
          • Custom script: call RemoveLocation(udg_missle_collisionloc[GetForLoopIndexA()])
          • Custom script: call DestroyGroup(udg_missle_unitgroup[GetForLoopIndexA()])
        • Else - Actions
 
Level 19
Joined
Aug 16, 2007
Messages
881
It is MUI?...
This is not MUI. It's MPI.

Also, I can't really see why you've got
  • Set missle_boolean[(Player number of (Owner of (Triggering unit)))] = True
. You don't use it. You never turn off the loop trigger and that's really bad. Also, you don't need three triggers to do this.

Don't use
  • Unit - Cause (Dying unit) to damage circular area after 0.01 seconds of radius 200.00 at temploc[(Player number of (Owner of (Dying unit)))], dealing 100.00 damage of attack type Spells and damage type Normal
, use UNIT damage UNIT instead.

Remove those BJ's too
JASS:
call RemoveLocation(udg_temploc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
(The red colored, just use GetPlayerID).
 
Level 5
Joined
Apr 17, 2010
Messages
124
This is not MUI. It's MPI.

Also, I can't really see why you've got
  • Set missle_boolean[(Player number of (Owner of (Triggering unit)))] = True
. You don't use it. You never turn off the loop trigger and that's really bad. Also, you don't need three triggers to do this.

Don't use
  • Unit - Cause (Dying unit) to damage circular area after 0.01 seconds of radius 200.00 at temploc[(Player number of (Owner of (Dying unit)))], dealing 100.00 damage of attack type Spells and damage type Normal
, use UNIT damage UNIT instead.

Remove those BJ's too
JASS:
call RemoveLocation(udg_temploc[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
(The red colored, just use GetPlayerID).
First off, I forget what I was going to use boolean for; I'll update+remove it. Next, I fixed the loop trigger part. Why do unit damage unit if its exploding and damaging an AREA? Fixed the BJS.
 
Level 8
Joined
Jun 30, 2010
Messages
259
Ok, I will help you, here is how you make this MUI and to look good:
Use Hashtables, save all your variables as Hashtable data, points is not nesseccary thought, then add the missile unit to a unit group, and every 0.03 seconds, pick all units in that group and make the unit "walk" using point variables.
Looks good and it is MUI!
EDIT 2:
Tried the spell now...
It does not work all the time, and it is not a good way of casting the spell.
Points:
Triggering: 2/5
Effects: 3.5/5
MUI: 0/5
Casting way: 1/5
Overall: 2/5

The effects are OK, but you could add some more fire to it.
 
Level 19
Joined
Aug 16, 2007
Messages
881
Well, half of it is. I didn't saw that you had
  • Unit - Order (Last created unit) to Move To temploc2[(Player number of (Owner of (Triggering unit)))]
to move the dummy unit. This isn't a good solution anyway for a missile movement.

BUT, your Missile Collision isn't MUI. This only affects ONE missile per player at time, not multiple for a player.

Also, why all those imports?
 
Level 5
Joined
Apr 17, 2010
Messages
124
Well, half of it is. I didn't saw that you had
  • Unit - Order (Last created unit) to Move To temploc2[(Player number of (Owner of (Triggering unit)))]
to move the dummy unit. This isn't a good solution anyway for a missile movement.

BUT, your Missile Collision isn't MUI. This only affects ONE missile per player at time, not multiple for a player.

Also, why all those imports?
Uhm; Theres a cooldown on it, so multiple missiles wouldn't matter; and also, this is a SINGLE missile spell. As easily as it could be made multiple, it works with every single caster that has the spell. And as many of them at a time, as well.
EDIT: And you mean the sounds, on import? They were on the map already, they were sounds I used to use in my TD's. I apologize; I used one of my TD's for a start, even though I erased everything, down to the imports apparently.
 
Last edited:
Level 8
Joined
Jun 30, 2010
Messages
259
Uhm; Theres a cooldown on it, so multiple missiles wouldn't matter; and also, this is a SINGLE missile spell. As easily as it could be made multiple, it works with every single caster that has the spell. And as many of them at a time, as well.

Wrong. If one player has 2 units which uses the spell at the same time, it would not work.
Also, the spells that you upload should be MUI.
Just add a unit group and it would work just fine, but it would still look terrible.
 
Level 5
Joined
Apr 17, 2010
Messages
124
Wrong. If one player has 2 units which uses the spell at the same time, it would not work.
Also, the spells that you upload should be MUI.
Just add a unit group and it would work just fine, but it would still look terrible.

One player shouldn't have two heros, and also how would it look terrible?.. This is actually one of my well put-together spells. I don't see all too many ways to make this more efficient, or as you want, pretty.
~~DooM
 
Last edited:
Level 12
Joined
Apr 16, 2010
Messages
584
One player shouldn't have two heros
never heard something like that, maybe you haven't played meele maps or other.
Okay example for you: i'm playing DotA (i bet you played it) and mode is -sh or -mm or -wtf, and i need to cast spell multiple times, so what i get is: i cast it and it will stop when another casts it, yeah would be really nice bug. Please make it MUI, i gave tutorial on the first post.
Oh btw i like maps where i control more then 1 hero, and I'm not the only one...
So i hope this will help you to understand that all spells need to be MUI, even i make every spell MUI, but in my map, i don't even need them to be MPI.
 
First off, I forget what I was going to use boolean for; I'll update+remove it. Next, I fixed the loop trigger part. Why do unit damage unit if its exploding and damaging an AREA? Fixed the BJS.

unit damage area damages everyone...

Doom_AngeaL said:
One player shouldn't have two heros, and also how would it look terrible?..

Its against the rules to upload non-MUI spell... and there are users who would want to have multiple units to have this spell, and that's exactly why spells uploaded here are supposed to be fully MUI...


if you dont want to make it MUI, don't upload it on the spells section (if you dont want to make it MUI because you just made it for a specific person who asked for it, use the pastebin instead...)

and its a good practice to always try to make spells MUI...



Doom_AngeaL said:
This is actually one of my well put-together spells. I don't see all too many ways to make this more efficient, or as you want, pretty.

that is what you think which is different from what we think

Stanley said:
So i hope this will help you to understand that all spells need to be MUI, even i make every spell MUI, but in my map, i don't even need them to be MPI.

yeah, me too, I always see to it that they are MUI (at least the main spell codes) even if my map is an SG map with only one hero... ^_^

Suggestion:[r]
-change [Unit - A unit Begins casting an ability] into [Unit - A unit Starts the effect of an ability]

-learn indexing or hashtable to make it MUI

-use a movement system rather than ordering the missile to move coz it looks bad

currently I vote for rejection
 
Last edited:
Level 8
Joined
Jun 30, 2010
Messages
259
One player shouldn't have two heros, and also how would it look terrible?.. This is actually one of my well put-together spells. I don't see all too many ways to make this more efficient, or as you want, pretty.
~~DooM

Wrong. You need to make it MUI!!!
It would still look terrible, but add a movement system, and it won't!
I believe that it is not well made, since it is not MUI and it does not have a good movement system, therefore, my current opinion is:
Rejection.
 
Level 5
Joined
Apr 17, 2010
Messages
124
Wrong. You need to make it MUI!!!
It would still look terrible, but add a movement system, and it won't!
How do I make it MUI, I've read the tutorial stanley linked to and it didn't really help altogether. And I experimented with a movement system, but it doesn't work. Help me a little;

  • Missle Movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set missle_range[(Integer A)] = (missle_range[(Integer A)] - 10)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in missle_units[(Integer A)] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • missle_range[(Integer A)] Equal to 0
                    • Then - Actions
                      • Skip remaining actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                      • Set missle_collisionloc[(Integer A)] = (Position of (Picked unit))
                      • Set temploc4[(Integer A)] = (missle_collisionloc[(Integer A)] offset by 13.00 towards (Facing of (Picked unit)) degrees)
                      • Unit - Move (Picked unit) instantly to temploc4[(Integer A)], facing (Facing of (Picked unit)) degrees
                • Else - Actions
 
Level 8
Joined
Jun 30, 2010
Messages
259
How do I make it MUI, I've read the tutorial stanley linked to and it didn't really help altogether. And I experimented with a movement system, but it doesn't work. Help me a little;

  • Missle Movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set missle_range[(Integer A)] = (missle_range[(Integer A)] - 10)
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in missle_units[(Integer A)] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • missle_range[(Integer A)] Equal to 0
                    • Then - Actions
                      • Skip remaining actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                      • Set missle_collisionloc[(Integer A)] = (Position of (Picked unit))
                      • Set temploc4[(Integer A)] = (missle_collisionloc[(Integer A)] offset by 13.00 towards (Facing of (Picked unit)) degrees)
                      • Unit - Move (Picked unit) instantly to temploc4[(Integer A)], facing (Facing of (Picked unit)) degrees
                • Else - Actions

Ok, ok, here is a little something:
1. Add an "add unit to unit group" to the cast trigger.
2. Create a Hashtable
3. Create 2 point variables and add them to the cast trigger: Cast point (Point of ability being cast) and Casting Unit Point (Position of (triggering unit))
4. Add the action:
  • Hashtable - Save (Key (Angle from Cast_Point to Casting_Unit_Point)) as (Key Degrees) of (Key (Last Created Unit) in Hashtable
to the cast trigger
This is how the movement trigger should look:
  • MUI movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in missle_units and do (Actions)
        • Loop - Actions
          • Set Cast_Point - Position of (Picked unit)
          • Set Cast_Unit_Point - Cast_Point offset by 4.00 towards (Hashtable - load (Key Degrees) of (Key (Picked Unit)) in Hashtable
          • Unit - Move (Picked unit) instantly to Cast_Unit_Point
Done! But don't forget to fix leaks and also, add this trigger:
  • Death
    • Events
      • Unit - A unit dies
    • Conditions
      • Unit type of (Dying unit) Equal to Missile
    • Actions
      • Hashtable - Clear all child hashtables of (Key (Dying unit))
EDIT: This should be in the first trigger, right after you pick the unit group:
  • For each integer A, from 1 to (Number of units in missile_units), do Actions
And this should be in the last trigger aswell:
  • Unit Group - Remove (Dying unit) from missile_units
That should be all!
Hope this helps!
 
Level 5
Joined
Apr 17, 2010
Messages
124
Ok, ok, here is a little something:
1. Add an "add unit to unit group" to the cast trigger.
2. Create a Hashtable
3. Create 2 point variables and add them to the cast trigger: Cast point (Point of ability being cast) and Casting Unit Point (Position of (triggering unit))
4. Add the action:
  • Hashtable - Save (Key (Angle from Cast_Point to Casting_Unit_Point)) as (Key Degrees) of (Key (Last Created Unit) in Hashtable
to the cast trigger
This is how the movement trigger should look:
  • MUI movement
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in missle_units and do (Actions)
        • Loop - Actions
          • Set Cast_Point - Position of (Picked unit)
          • Set Cast_Unit_Point - Cast_Point offset by 4.00 towards (Hashtable - load (Key Degrees) of (Key (Picked Unit)) in Hashtable
          • Unit - Move (Picked unit) instantly to Cast_Unit_Point
Done! But don't forget to fix leaks and also, add this trigger:
  • Death
    • Events
      • Unit - A unit dies
    • Conditions
      • Unit type of (Dying unit) Equal to Missile
    • Actions
      • Hashtable - Clear all child hashtables of (Key (Dying unit))
EDIT: This should be in the first trigger, right after you pick the unit group:
  • For each integer A, from 1 to (Number of units in missile_units), do Actions
And this should be in the last trigger aswell:
  • Unit Group - Remove (Dying unit) from missile_units
That should be all!
Hope this helps!

I found out how to make the movement trigger basically right after you said to use a new one, after I posted my attempt, I figured it out but I didn't reply, I was deadbeat and almost asleep. I tried using three heroes, and all three of the missiles advance and collide on path with something. NOW, the problem is getting it to do the damage. It won't work. Any help?
 
Last edited:
Level 8
Joined
Jun 30, 2010
Messages
259
I found out how to make the movement trigger basically right after you said to use a new one, after I posted my attempt, I figured it out but I didn't reply, I was deadbeat and almost asleep. I tried using three heroes, and all three of the missiles advance and collide on path with something. NOW, the problem is getting it to do the damage. It won't work. Any help?

Same thing as before.
Save the damage you want as an Integer, use the Hashtable - Save Integer action
  • Hashtable - Save (Level of Missile for (Triggering unit) x 100) as (Key Damage) of (Key (Triggering unit)) in Hashtable
And when the event of the collision occours in the movement loop using an if/then/else action with the condition:
  • (Number of units in (Number of units within 200.00 range of Missile_Move_Point)) Greater than 0
Then do this in the then part:
  • Set Damaging_Unit - (Picked unit)
  • Unit group - Pick all units in (Units within 200.00 range of Missile_Move_Point) and to (Actions)
    • Set Damage_Group (Last Created Unit Group)
    • Unit - Make (Picked unit) damage (Triggering unit) dealing (Load (Key Damage) of (Key Damaging_unit)...
    • Unit - Remove Damaging_unit from the game
    • Hashtabe - Clear all child hashtables of Damaging_Unit
Using that action, you can make the unit only deal damage to enemy units using a owner of unit conditon.
But, if you want to do it the easy way:
  • If
    • (Number of units in (Number of units within 200.00 range of Missile_Move_Point)) Greater than 0
  • Then
    • Unit - Make (Picked unit) damage Missile_Move_Point dealing (Load (Key Damage) of (Key Damaging_unit) in a 200.00 area...
    • Unit - Remove (Picked unit) from the game
Remember to use the attack type you want.
Universal for full damage, no armor resistance.
That is all!
Hope this helps!
 
Level 5
Joined
Apr 17, 2010
Messages
124
Same thing as before.
Save the damage you want as an Integer, use the Hashtable - Save Integer action
  • Hashtable - Save (Level of Missile for (Triggering unit) x 100) as (Key Damage) of (Key (Triggering unit)) in Hashtable
And when the event of the collision occours in the movement loop using an if/then/else action with the condition:
  • (Number of units in (Number of units within 200.00 range of Missile_Move_Point)) Greater than 0
Then do this in the then part:
  • Set Damaging_Unit - (Picked unit)
  • Unit group - Pick all units in (Units within 200.00 range of Missile_Move_Point) and to (Actions)
    • Set Damage_Group (Last Created Unit Group)
    • Unit - Make (Picked unit) damage (Triggering unit) dealing (Load (Key Damage) of (Key Damaging_unit)...
    • Unit - Remove Damaging_unit from the game
    • Hashtabe - Clear all child hashtables of Damaging_Unit
Using that action, you can make the unit only deal damage to enemy units using a owner of unit conditon.
But, if you want to do it the easy way:
  • If
    • (Number of units in (Number of units within 200.00 range of Missile_Move_Point)) Greater than 0
  • Then
    • Unit - Make (Picked unit) damage Missile_Move_Point dealing (Load (Key Damage) of (Key Damaging_unit) in a 200.00 area...
    • Unit - Remove (Picked unit) from the game
Remember to use the attack type you want.
Universal for full damage, no armor resistance.
That is all!
Hope this helps!
I made it work with multiple units w/o hashtables my own way before I read this, I'm not home to reupload now though.
 
Level 8
Joined
Jun 30, 2010
Messages
259
Checked the new version, and it is STILL bugged and leaks:

-You leak a unit group in the movement trigger!
-You have a "Do Nothing" action in the movement trigger!
-It is not good to pick every unit in the whole map, in the cast, add the Missile to a unit group and pick the unit group instead!
-It is not MUI!! If another unit uses the ability who is owned by the same player, the first one will bug up and the ability level won't work.
Example: I cast it with one unit which has the ability level 3. I then cast it with another unit before the first missile has colided. This unit has ability level 1. When the first missile hits, it will only deal the level 1 damage, which is 100.
Therefore it is not MUI.

So, let's summarize the points:
MUI - 0/5 - It is not MUI.
Effects - 3/5 - The same as before the update.
Leaks - 0/5 - Many leaks.
Triggering - 1/5 - It can be done using less then half the space you have used, and you are using one unesseccary trigger, since the colide and movement trigger can be summarized into 1.

I guess that's it. I still don't think it is good enough. Try to use Hashtables as I suggested!
Good luck!
Hope this helps!
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
why you first loop for all players then loop for all units? just worthless sorry but mui have nothing to do with players, it just works for all players and all units (unless hashtable crap if you do it the simple way)

temploc3 doesnt need to be an array variable as it's used instantly and removed instantly

you leak as laser said

the do nothing is pointless, doesnt it says so, DO NOTHING?

the mui part... I just wonder

too many triggers for a simple spell, you just need two triggers, cast and loop that's it, the damage should be in this loop

damage should be configure able, not damage area but damage target in a unit group so you can filter out units which you dont want to get damaged
 
Level 8
Joined
Jun 30, 2010
Messages
259
why you first loop for all players then loop for all units? just worthless sorry but mui have nothing to do with players, it just works for all players and all units (unless hashtable crap if you do it the simple way)

Why do you think that Hashtables is crap? Or was that just an expression? Just wondering what ways you would like to improve the spell. Do you rather use an indexing system or do you have a complicated way of doing MUI in GUI?

To Doom_Angel: Just so you know, MUI means Multi Unit Instanceable, which means infinite units can cast it at the same time ("almost")
MPI is what you have made: Multi Player Instanceable. All players can cast it at once, but only with one unit at a time.
The rules are that all spells MUST be MUI, atleast as far as I know.
Therefore, I highly reccommend you to use my Hashtable hints in order to make this spell MUI A.S.A.P. so that it won't get rejected.
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
I'm born with indexing, that's why I say that hashtables suck :D (they do in speed).

Also if you store an instance with the handle id of the casting unit, it makes sense that if the unit casts again while the previous instance is still on, will be overwritten (and leak?).
 
Level 8
Joined
Jun 30, 2010
Messages
259
I'm born with indexing, that's why I say that hashtables suck :D (they do in speed).

Also if you store an instance with the handle id of the casting unit, it makes sense that if the unit casts again while the previous instance is still on, will be overwritten (and leak?).

No. It will never leak if you do it correctly. You must make a trigger to turn off the ability, for instance, if you make a spell which gives a unit some power, and then the same unit casts it again, you simply clear the previous cast.
 
Level 8
Joined
Jun 30, 2010
Messages
259
Why should it cleared the next cast? That would be insane wouldn't it? If I cast a missile that lasts 5 seconds and fire another 1 second later, the first missile shouldn't be destroyed or am I wrong?

I meant if you were using a buff.
If you want to create missiles, create a Unit Group and add all the missiles in that group, and save the movement direction in a hashtable to the created missile, aswell as the damage.
  • Hashtable - Save (Angle from CastPoint to TargetPoint) as (Key (Degrees)) of (Key (Last created unit)) in Hashtable
  • Hashtable - Save (Level of Missile for (Triggering unit) x 100) as (Key (Damage)) of (Key (Last created unit)) In Hashtable
  • Unit - Add (Last created unit) to MissileGroup
And then you move all of them using a Unit Group and a periodic event trigger!
 
Level 8
Joined
Jun 30, 2010
Messages
259
Ah cool never thought about adding the actual missile :D

Anyways a buff should be renewed not remove the previous instance, atleast that's kinda common in vJASS ;) (but this is not, seems that I got used to it).

I guess so, since from what I know, EVERYTHING (!) that you can do in JASS, you can also do in GUI, some thing might require custom scripts thought.
Not on this spell, however. And what I want to ask, is when you are going to update the spell?
 
Level 5
Joined
Apr 17, 2010
Messages
124
I guess so, since from what I know, EVERYTHING (!) that you can do in JASS, you can also do in GUI, some thing might require custom scripts thought.
Not on this spell, however. And what I want to ask, is when you are going to update the spell?

I'm trying to use the hashtables for damage right now. But when I load it to do the damage, I load it as key damage of what? I don't understand.
~~DooM
 
Level 8
Joined
Jun 30, 2010
Messages
259
I'm trying to use the hashtables for damage right now. But when I load it to do the damage, I load it as key damage of what? I don't understand.
~~DooM

First, use the Hashtable - Save INTEGER function, and set the SAVE value to 100 x (level of missile for (triggering unit). Then, set the first value in the saving section to STRING and type in anything, for example DAMAGE, then set the second value to VALUE and set it to TRIGERING UNIT, in the Hashtable of your name, for example HASHTABLE. (NOTE!!! YOU MUST CREATE A TRIGGER WHICH CREATES AND SETS A HASHTABLE!!! To do this, use the time elapsed and value 0.01 and the action Create a Hashtable and the set variable - Set Hashtable - Last created hashtable)
The save should look like this:
  • Hashtable - Save handle of ((Level of Missile for (Triggering unit)) x 100) as (Key (Damage)) of (Key (Triggering unit)) in Hashtable
Now you have successfully saved the damage! Now, to load it.
  • Unit - Make (Picked unit) ((--I assume you are using this in a pick all units in unit group action--)) damage Damage_Unit ((--The unit within range--)) dealing ((--This is the loading--)) (Load (Key (Damage)) of (Key (Picked unit))) of attack type (Something) and damage type (Something)
  • ---
  • ---
This is how it should look
  • Unit - Make (Picked unit) damage Damage_Unit dealing (Load (Key (Damage)) of (Key (Picked unit))) of attack type Chaos and damage type Universal
Now, if you want an AoE effect, use the same thing, except you set the position of the missile to Damage_Point when a unit is within range, and then do this:
  • Unit - Make (Picked unit) damage all units within 300 of Damage_Point dealing (Load (Key (Damage)) of (Key (Picked unit))) of attack type Chaos and damage type Universal
Note that these actions does not include the time that the real action damage target and area does have, and they might not be saying the exact text I am using here, but I hope you get the point.
That's all!
Hope this helps!
 
Level 5
Joined
Apr 17, 2010
Messages
124
  • Missile DeathIDamage
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Missle
    • Actions
      • Set temploc = (Position of (Dying unit))
      • Special Effect - Create a special effect at temploc using Objects\Spawnmodels\Other\NeutralBuildingExplosion\NeutralBuildingExplosion.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_temploc)
      • Unit - Cause (Dying unit) to damage circular area after 0.00 seconds of radius 200.00 at temploc, dealing (Load (Key Damage) of (Key (Dying unit)) from (Last created hashtable)) damage of attack type Spells and damage type Normal
      • Destructible - Pick every destructible within 200.00 of temploc and do (Actions)
        • Loop - Actions
          • Destructible - Kill (Picked destructible)
      • Unit Group - Remove (Dying unit) from missle_unit[(Player number of (Owner of (Dying unit)))]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in missle_unit[(Player number of (Owner of (Dying unit)))]) Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Missle Movement <gen>
        • Else - Actions
Theres the trigger. Whats wrong, I don't get it.
 
Level 5
Joined
Apr 17, 2010
Messages
124
does not work properly, leaks
very bad

Nice biased opinion, friendly.

Anywho, it does indeed work properly, and there are few leaks. It isn't, as you say, 'very bad'.

If your going to rate a spell, rate it because of it, not because of past conflicts with its creator.

I'm honestly doubting you're even thirteen, if that.

And when you rate a spell, don't just go about spouting nonsense about the general idea of whats wrong, tell me WHERE the leaks are, if you even know what a leak is, or what isn't working 'properly', as you said.
 
Last edited:
Level 8
Joined
Jun 30, 2010
Messages
259
No but the previous instance is overwritten, haven't you read what I've told you?

That is the point, it shall be overwritten. The value for the MISSILE, which is the one that counts, NEVER changes, no matter what, therefore, it does not matter if the CASTING UNIT's value changes, since it does not affect the Missiles, except for the newly casted ones.

If you are talking about the fact that all the values are saved in (Key (Triggering unit)), then maybe you should know that this saves the value to the unit itself, and it can only be overwritten if another value of the same name is saved, or if it is cleared by the action Hashtable - Clear child hashtables.
However, each time a missile dies, you have to clear the hashtable for that unit.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Missile Movement

You forgot:

Custom script: set bj_wantDestroyGroup = true

And...

Do nothing

Missile Death

(Dying unit)

- Spammed again and again... should be (Triggering unit)

Unit - Cause (Dying unit) to damage circular area after 0.00 seconds of radius 200.00 at temploc, dealing 200.00 damage of attack type Spells and damage type Normal

- Whoops, that crashes Mac computers. And friendly units. And... just do a "pick all units" action instead.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of units in missle_unit[(Player number of (Owner of (Dying unit)))]) Equal to 0
    • Then - Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Missile Collision <gen>
      • Trigger - Turn off Missle Movement <gen>
    • Else - Actions
You realize that if another player had missiles in-progress this will stop everything in its tracks?
 
Level 11
Joined
Nov 1, 2008
Messages
828
I really like this spell, although I cant seem to fix this problem. I'm not sure if everyone else had this but only player 1 can shoot missiles that actually hit a target. Player 2 to 12 shoots and missess everyone. Not sure how to fix that, i've examened it so many times and it doesn't get past the first line of code "missile is alive", I have no idea what's going on. Please help.

Edit: I'm going to change everything see if it works better.
Edit2: Ok It works now, changed unitgroup to just unit.
 
Last edited:
Top