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

how to do a missile spell?

Status
Not open for further replies.
Level 19
Joined
Aug 24, 2007
Messages
2,888
aaaa shockwave ?, crushing wave ?, carrion swarm ?, breath of fire ?
I guess they will look like shooting if you make missle speed fast and projectile art a bullet one
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
My solution with GUI

well making elune arrow
you need 2 GUI triggers, 3 variables, 1 dummy unit
Information About Dummy Unit
It has Locust ability
Fly moment type
Moment speed that missle should have
Missle projectile model
Variables
A Point variable named TempLoc
An Unit variable named TempUnit
An Unit Group variable named MissleGroup
[trigger="First Trigger"]Missle Lunch
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to <Your Missle Ability>
Actions
Set TempLoc = (Position of (Triggering unit))
Unit - Create 1 <Dummy Missle Unit> for (Owner of (Triggering unit)) at TempLoc facing Default building facing degrees
Unit Group - Add (Last created unit) to MissleGroup
Custom script: call IssuePointOrder(bj_lastCreatedUnit,"move",GetUnitX(GetTriggerUnit())+Cos(GetUnitFacing(GetTriggerUnit())*bj_DEGTORAD)*5000,GetUnitY(GetTriggerUnit())+Sin(GetUnitFacing(GetTriggerUnit())*bj_DEGTORAD)*5000)
Custom script: call RemoveLocation(udg_TempLoc)
Custom script: call DestroyGroup(bj_lastCreatedGroup)
[/trigger]
[trigger="Second Trigger"]Missle Check
Events
Time - Every 0.50 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in MissleGroup and do (Actions)
Loop - Actions
Set TempLoc = (Position of (Picked unit))
Set TempUnit = (Picked unit)
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units within <Missle Area (200 would be fine)> of TempLoc) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit is alive) Equal to True
((Picked unit) is A structure) Equal to False
((Picked unit) belongs to an enemy of (Owner of TempUnit)) Equal to True
Then - Actions
Unit Group - Remove TempUnit from MissleGroup
Unit - Cause TempUnit to damage (Picked unit), dealing <Your Damage> damage of attack type Spells and damage type Normal
Unit - Kill TempUnit
Else - Actions
Custom script: call RemoveLocation(udg_TempLoc)
[/trigger]

This seems fine to me
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
Hmm then change timer interval to 0.03 and make projectile change position in timer trigger overtime

AND REPLEACE
[TRIGGER="THIS"]Set TempUnit = (Picked unit)
Custom script: set bj_wantDestroyGroup = true[/trigger]
[TRIGGER="WITH THIS"]Set TempUnit = (Picked unit)
Custom script: call SetUnitX(GetEnumUnit(),GetUnitX(GetEnumUnit())+Cos(GetUnitFacing(GetEnumUnit()*bj_DEGTORAD)*<speed>*0.03)
Custom script: call SetUnitY(GetEnumUnit(),GetUnitX(GetEnumUnit())+Cos(GetUnitFacing(GetEnumUnit()*bj_DEGTORAD)*<speed>*0.03)
Custom script: set bj_wantDestroyGroup = true[/Trigger]
Then change <speed> fileds

AND

[trigger="THIS"]Custom script: call IssuePointOrder(bj_lastCreatedUnit,"move",GetUnitX(GetTriggerUnit())+Cos(GetUnitFacing(GetTriggerUnit())*bj_DEGTORAD)*5000,GetUnitY(GetTriggerUnit())+Sin(GetUnitFacing(GetTriggerUnit())*bj_DEGTORAD)*5000)[/trigger]
[trigger="WITH THIS"]Custom script: call RemoveLocation(udg_TempLoc)
Custom script: set udg_TempLoc = GetSpellTargetLoc()
Custom script: call SetUnitFacing(bj_lastCreatedUnit,bj_RADTODEG*Atan2(GetLocationY(udg_TempLoc) - GetUnitY(GetTriggerUnit()), GetLocationX(udg_TempLoc) - GetUnitX(GetTriggerUnit())))[/trigger]
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
  • Custom script: call SetUnitX(GetEnumUnit(),GetUnitX(GetEnumUnit())+Cos(GetUnitFacing(GetEnumUnit()*bj_DEGTORAD)*<speed>*0.03)
  • Custom script: call SetUnitY(GetEnumUnit(),GetUnitX(GetEnumUnit())+Cos(GetUnitFacing(GetEnumUnit()*bj_DEGTORAD)*<speed>*0.03)
These doesn't work when you trying to save the map.... there's something wrong with them...
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
ups yuea you are right
[trigger="This is ok"]Custom script: call SetUnitX(GetEnumUnit(),GetUnitX(GetEnumUnit())+Cos(GetUnitFacing(GetEnumUnit())*bj_DEGTORAD)*<speed>*0.03)
Custom script: call SetUnitY(GetEnumUnit(),GetUnitY(GetEnumUnit())+Sin(GetUnitFacing(GetEnumUnit())*bj_DEGTORAD)*<speed>*0.03)[/trigger]
dont forget to change <speed>'s
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
Ok, if I want to move this "bullet" every 0.05 sec, and want a speed of 1000. Can I put 50, instead of <speed>*0.03 value?

Like this? So this will move the dummy in his faced direction. I assume this is working response for picked unit.

  • Custom script: call SetUnitX(GetEnumUnit(),GetUnitX(GetEnumUnit())+Cos(GetUnitFacing(GetEnumUnit())*bj_DEGTORAD)*50)
  • Custom script: call SetUnitY(GetEnumUnit(),GetUnitY(GetEnumUnit())+Sin(GetUnitFacing(GetEnumUnit())*bj_DEGTORAD)*50)
Edit_

I didn't see the projectile traveling using this. What's wrong here?
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
Need_O2 said:
:/ Idk it should work
check where you put it

I put it in the first loop. But the problem is, that it doesn't seem to work like instant move, not visible at least. Maybe a different MUI JASS code if possible....


I attempted to make a fireball, that explodes on impact, But I must make it MUI, which I doesn't know how. So far I made this...

  • Projectile Start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magma Ball
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Set Target_Point = (Target point of ability being cast)
      • Unit - Create 1 Dummy Fireball for (Owner of (Triggering unit)) at TempPoint facing (Angle from TempPoint to Target_Point) degrees
      • Unit Group - Add (Last created unit) to ProjectileGroup
      • Unit - Set the custom value of (Last created unit) to (Level of Magma Ball for (Triggering unit))
      • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call RemoveLocation(udg_Target_Point)
      • Custom script: call DestroyGroup(bj_lastCreatedGroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ProjectileGroup) Equal to 1
        • Then - Actions
          • Trigger - Turn on Projectile Travel <gen>
        • Else - Actions

  • Projectile Travel (Initially off)
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
      • (Number of units in ProjectileGroup) Greater than 0
    • Actions
      • Unit Group - Pick every unit in ProjectileGroup and do (Actions)
        • Loop - Actions
          • Set MagmaBall = (Picked unit)
          • Set TempPoint = (Position of (Picked unit))
          • Set TempPoint2 = (TempPoint offset by 50.00 towards (Facing of MagmaBall) degrees)
          • Unit - Move MagmaBall instantly to TempPoint2
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 66.00 of TempPoint) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (MagmaBall is alive) Equal to True
                  • ((Picked unit) belongs to an enemy of (Owner of MagmaBall)) Equal to True
                  • ((Picked unit) is alive) Equal to True
                • Then - Actions
                  • Unit - Create 1 Dummy for (Owner of MagmaBall) at TempPoint facing (Random angle) degrees
                  • Set Dummy2 = (Last created unit)
                  • Animation - Change Dummy2's size to (150.00%, 150.00%, 150.00%) of its original size
                  • Unit - Add Magma Ball (Fan) to Dummy2
                  • Unit - Set level of Magma Ball (Fan) for Dummy2 to (Custom value of MagmaBall)
                  • Unit - Order Dummy2 to Night Elf Warden - Fan Of Knives
                  • Unit - Kill Dummy2
                  • Set Dummy2 = No unit
                  • Unit - Create 1 Dummy for (Owner of MagmaBall) at TempPoint facing (Random angle) degrees
                  • Set Dummy1 = (Last created unit)
                  • Unit - Add Magma Flames (Magma Ball) to Dummy1
                  • Unit - Set level of Magma Flames (Magma Ball) for Dummy1 to (Custom value of MagmaBall)
                  • Unit - Order Dummy1 to Human Blood Mage - Flame Strike TempPoint
                  • Unit - Add a 7.00 second Generic expiration timer to Dummy1
                  • Unit - Create 1 ExplosionEffectDummy for (Owner of MagmaBall) at TempPoint facing (Random angle) degrees
                  • Set Dummy0 = (Last created unit)
                  • Animation - Change Dummy0's size to (260.00%, 260.00%, 500.00%) of its original size
                  • Unit - Kill Dummy0
                  • Unit Group - Remove MagmaBall from ProjectileGroup
                  • Unit - Kill MagmaBall
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in ProjectileGroup) Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Custom script: call RemoveLocation( udg_TempPoint2 )
                  • Skip remaining actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (MagmaBall is alive) Equal to False
                    • Then - Actions
                      • Unit - Create 1 Dummy for (Owner of MagmaBall) at TempPoint facing (Random angle) degrees
                      • Set Dummy2 = (Last created unit)
                      • Animation - Change Dummy2's size to (150.00%, 150.00%, 150.00%) of its original size
                      • Unit - Add Magma Ball (Fan) to Dummy2
                      • Unit - Set level of Magma Ball (Fan) for Dummy2 to (Custom value of MagmaBall)
                      • Unit - Order Dummy2 to Night Elf Warden - Fan Of Knives
                      • Unit - Kill Dummy2
                      • Set Dummy2 = No unit
                      • Unit - Create 1 ExplosionEffectDummy for (Owner of MagmaBall) at TempPoint facing (Random angle) degrees
                      • Set Dummy0 = (Last created unit)
                      • Animation - Change Dummy0's size to (260.00%, 260.00%, 500.00%) of its original size
                      • Unit - Kill Dummy0
                      • Unit - Create 1 Dummy for (Owner of MagmaBall) at TempPoint facing (Random angle) degrees
                      • Set Dummy1 = (Last created unit)
                      • Unit - Add Magma Flames (Magma Ball) to Dummy1
                      • Unit - Set level of Magma Flames (Magma Ball) for Dummy1 to (Custom value of MagmaBall)
                      • Unit - Order Dummy1 to Human Blood Mage - Flame Strike TempPoint
                      • Unit - Add a 5.00 second Generic expiration timer to Dummy1
                      • Unit Group - Remove MagmaBall from ProjectileGroup
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in ProjectileGroup) Equal to 0
                        • Then - Actions
                          • Trigger - Turn off (This trigger)
                        • Else - Actions
                    • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Custom script: call RemoveLocation( udg_TempPoint2 )
This is just a fireball kind of projectile.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
yours seems ok
I didnt pay much attention while checking

If you want me to give you a JASS code I dont make regular jass triggers anymore. Only vJass triggers that Jass NewGen supports
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
sry I was unspesific. I meant a MUI script, that allows MUI of the trigger.

  • --- This part make it non-MUI ---
  • Set MagmaBall = (Picked unit)
  • Set TempPoint = (Position of (Picked unit))
  • Set TempPoint2 = (TempPoint offset by 50.00 towards (Facing of MagmaBall) degrees)
  • Unit - Move MagmaBall instantly to TempPoint2
This prevents MUI. Your script doesn't make it instantly move so the eye can see it's projectile movement... I tested with it and could't see it's projectile movement :( Is there another instant move script that doesn't leak and make the projectile move visible at least...

Don't don't write JASS, so I have no idea about scripts....



1. Keep the trigger as it is (not MUI and quite leakfree)
2. Apply only to all picked units in group move and move them all together (MUI, but much more location leaks pr second)

3. Another solution....
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
your trigger is MUI already

you dont transfer single variables to another triggers
you dont use waits etc
so it is full MUI
(well these arent the only things that makes trigger MUI but it is full MUI anyway)

Unless you dont use variables with waits you dont need to fear of anything

I'll tell you what
if 9999999999999999999999999999999999999999999999999 casters casts this spell at sametime
only bad thing will happen is lag


About Moment: Really strange it should appear like projectile moment for a 0.03 timer
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
Doesn't point variables store only 1 point at the time?
Doesn't unit variables store only 1 unit at the time?

You have to explain this to me.... (Cuz I assumed those variables could only store 1 value at the time... not for every projectile in movement...) Maybe I learn something new ^^...

___________

Need_O2 said:
About Moment: Really strange it should appear like projectile moment for a 0.03 timer
?? huh? I use 0.05 timer in my trigger...
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
but you use variable right after you change it
so there is no moment between set and use
so nothing can change the variable while you are using it

Since you change variable in every usage it should be a problem

And since we are using unit group to store projectiles it can store-use more of them
 

TKF

TKF

Level 19
Joined
Nov 29, 2006
Messages
1,266
_______________

Need_O2 said:
Since you change variable in every usage it should be a problem
There's problem with what? Changing the values of variables every time trigger fires? Or did you miss the "'nt"

_______________


But If I understand my own system correct, only 1 projectile at the time can explode on every trigger fires. That would be that 2 fireballs colliding to each other, will not make both fireball explodes at same time. 1 will survive and travel on.... -.-

I'm wrong here in my assessment?
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
AH SORRY :p It shouldnt* be a problem :p:p:p
damn I hate myself

hmm colliding 2 fireballs yea 1 one survive and travel on
add them locust or game other one explode too if its a fireball
 
Status
Not open for further replies.
Top