• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Trying to make a projectile spell.

Status
Not open for further replies.
Level 6
Joined
May 9, 2010
Messages
127
Here's the deal, I want my fireball to explode when it "hits" the location I set
when I began to cast the spell. I tried many ways before coming here. I think
its either I made a mistake somewhere or it cannot be made that way. I don't
really know so I'm asking people here to check it out and see what can be
done or if this is off the limit GUI can do.

Thanks.


  • NewUnitAddToTrigg
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fireball Dummy
    • Actions
      • Trigger - Add to FireballDamage <gen> the event (Unit - A unit comes within 25.00 of (Triggering unit))
  • Fireball
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Burning - Fireball
    • Actions
      • Custom script: local unit udg_Fireball_Caster
      • Custom script: local unit udg_Fireball_Loc
      • Set Fireball_Caster = (Triggering unit)
      • Set Temp_Loc = (Target point of ability being cast)
      • Unit - Create 1 Fireball Dummy for (Owner of Fireball_Caster) at Temp_Loc facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Unit - Add a 15.00 second Generic expiration timer to (Last created unit)
      • Set Fireball_Loc = (Last created unit)
      • Wait 2.30 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of Fireball_Caster) Equal to (Order("coldarrows"))
        • Then - Actions
          • Set Temp_Loc = (Position of Fireball_Caster)
          • Special Effect - Create a special effect at Temp_Loc using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Create 1 Fireball Unit for (Owner of Fireball_Caster) at Temp_Loc facing Default building facing degrees
          • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
          • Custom script: call RemoveLocation(udg_Temp_Loc)
          • Set Temp_Loc = (Position of Fireball_Loc)
          • Unit - Order (Last created unit) to Move To Temp_Loc
          • Custom script: call RemoveLocation(udg_Temp_Loc)
        • Else - Actions
      • Set Fireball_Caster = No unit
      • Set Fireball_Loc = No unit
  • FireballDamage
    • Events
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Fireball Unit
    • Actions
      • Set Temp_Loc = (Position of (Triggering unit))
      • Set Temp_Group = (Units within 300.00 of Temp_Loc matching (((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True))
      • Unit - Kill (Triggering unit)
      • Special Effect - Create a special effect at Temp_Loc using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 90.00)
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Custom script: call DestroyGroup(udg_Temp_Group)
 
Last edited:
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Fireball Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to <Ability>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_Int[1] Equal to 0
        • Then - Actions
          • Trigger - Turn on Fireball Move <gen>
        • Else - Actions
      • Set MUI_Int[1] = (MUI_Int[1] + 1)
      • Set MUI_Int[2] = (MUI_Int[2] + 1)
      • Set casterPos[MUI_Int[2]] = (Position of (Triggering unit))
      • Set targetPos[MUI_Int[2]] = (Target of ability being cast)
      • Set damage[MUI_Int[2]] = 100.00
      • Set maxDist[MUI_Int[2]] = 1000.00
      • Unit - Create 1 Bullet for (Owner of (Triggering unit)) at casterPos[MUI_Int[2]] facing targetPos[MUI_Int[2]]
      • Set dummyUnit[MUI_Int[2]] = (Last created unit)
      • Trigger - Turn on Missle Move <gen>
      • Set curDist[MUI_Int[2]] = 0.00
      • Custom script: call RemoveLocation (udg_casterPos[udg_MUI_Int[2]])
      • Custom script: call RemoveLocation (udg_targetPos[udg_MUI_Int[2]])
  • Fireball Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MUI_Int[3]) from 1 to MUI_Int[2], do (Actions)
        • Loop - Actions
          • Set dummyPos[MUI_Int[3]] = (Position of dummyUnit[MUI_Int[3]])
          • Set movePos[MUI_Int[3]] = (dummyPos[MUI_Int[3]] offset by 20.00 towards (Facing of dummyUnit[MUI_Int[3]]) degrees)
          • Unit - Move dummyUnit[MUI_Int[3]] instantly to movePos[MUI_Int[3]]
          • Set curDist[MUI_Int[3]] = (curDist[MUI_Int[3]] + 20.00)
          • Set damageGroup[MUI_Int[3]] = (Random 1 units from (Units within 150.00 of dummyPos[MUI_Int[3]]))
          • Unit Group - Pick every unit in damageGroup[MUI_Int[3]] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • ((Picked unit) is A structure) Equal to False
                      • ((Picked unit) is alive) Equal to True
                      • ((Picked unit) belongs to an enemy of (Owner of dummyUnit[MUI_Int[3]])) Equal to True
                • Then - Actions
                  • Unit - Cause dummyUnit[MUI_Int[3]] to damage (Picked unit), dealing damage[MUI_Int[3]] damage of attack type Spells and damage type Unknown
                  • Unit - Add a 0.01 second Generic expiration timer to dummyUnit[MUI_Int[3]]
                  • Special Effect - Create a special effect at dummyPos[MUI_Int[3]] using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation (udg_targetPos[udg_MUI_Int[3]])
                  • Set dummyUnit[MUI_Int[3]] = No unit
                  • Set MUI_Int[1] = (MUI_Int[1] - 1)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • curDist[MUI_Int[3]] Greater than or equal to maxDist[MUI_Int[3]]
                    • Then - Actions
                      • Unit - Add a 0.01 second Generic expiration timer to dummyUnit[MUI_Int[3]]
                      • Special Effect - Create a special effect at dummyPos[MUI_Int[3]] using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Custom script: call RemoveLocation (udg_targetPos[udg_MUI_Int[3]])
                      • Set dummyUnit[MUI_Int[3]] = No unit
                      • Set MUI_Int[1] = (MUI_Int[1] - 1)
                    • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MUI_Int[1] Equal to 0
            • Then - Actions
              • Set MUI_Int[2] = 0
              • Trigger - Turn off (This trigger)
            • Else - Actions
          • Custom script: call RemoveLocation (udg_dummyPos[udg_MUI_Int[3]])
          • Custom script: call RemoveLocation (udg_movePos[udg_MUI_Int[3]])
          • Custom script: call DestroyGroup (udg_damageGroup[udg_MUI_Int[3]])
 
Level 13
Joined
Mar 24, 2010
Messages
950
GUI can pretty much do anything jass can except maybe not as efficiently and leak free :)

Ok first off i just took a real fast look and it seems its not a target unit spell? so using points in that way i assume you wanted it to be a aoe spell perhaps? then why do you have the dummy unit heat seeking the target point?
Also if this is not what you were intending to do and you did want it to be a unit targeted ability such as storm bolt then you need to change your tp var's

And for the Event on FireballDamage i think you may have not assigned conditions right.
((Target unit of ability being cast) instead of triggering unit might be what you want for both the event and the condition, also that will make sure its an enemy also depending on the spells allowed targets.

get some of those kinks out and let me know where your at after that, or if i am assuming wrong let me know more of what you want it to do :)

Edit: nvm he posted a sec before me, go ahead and try that out first if you want lol
 
Level 6
Joined
May 9, 2010
Messages
127
what Mortar posted is a insta-cast.

if you check my triggers, it has a 2.3 seconds cast.

So I want is to cast for 2.5 seconds then create a fireball at the caster location
going toward the designed location [where the dummy unit is at] then when it
comes within range of it, explode and deal the damage.

Edit: I found some mistakes already, correcting them in the first post.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,204
GUI can pretty much do anything jass can except maybe not as efficiently and leak free :)
Nope, you can not use an ability type as a key to a hashtable which you can do in JASS.

Also the event only runs when the effect of the ability starts, which basially means after casting delays when it begins to channel (if ability supports that) and before cooldown is started (interupting ability will cause cooldown not to start).
 
Level 6
Joined
May 9, 2010
Messages
127
Actually, the spell works wonder until it comes to the explosion. I think the
non-working trigger is the fireballdamage, but I can't get where it goes wrong.
It looks like the fireball unit does not trigger the "comes within reach of fireball
dummy".
 
Level 13
Joined
Mar 24, 2010
Messages
950
Nope, you can not use an ability type as a key to a hashtable which you can do in JASS.
I said pretty much do anything.. lol


I dont think locust ability allows the unit to use spells at all unless its a passive like true sight or something.

Also remove the casting Art animation and blend time on your dummy unit, it will dramatically increase the reaction time for its casting with your trigger.
 
Level 6
Joined
May 9, 2010
Messages
127
I still have a bug here.

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Current order of Fireball_Caster) Equal to (Order("coldarrows"))
    • Then - Actions
      • Set Temp_Loc = (Position of Fireball_Caster)
      • Special Effect - Create a special effect at Temp_Loc using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Create 1 Fireball Unit for (Owner of Fireball_Caster) at Temp_Loc facing Default building facing degrees
      • Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Set Temp_Loc = (Position of Fireball_Loc)
      • Unit - Order (Last created unit) to Move To Temp_Loc
      • Custom script: call RemoveLocation(udg_Temp_Loc)
    • Else - Actions
I don't get it sometimes a little something turns everything wrong. If I remove
the "s in (current order("coldarrows")) and make it (current order(coldarrows))
I get no effect. But when the "s are there, everything work except for the
fact that I can "cancel" the ability and it still will work. That's what I want to
know about. What can I do to make this not triggered when the spell is canceled
or interupted.

Thanks.
 
Status
Not open for further replies.
Top