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

[Spell] How to move a unit (dummy), like projection in a missile

Status
Not open for further replies.
Level 7
Joined
Sep 16, 2016
Messages
185
Whats the function to use to move my dummy unit from caster to target? The ability work essentially like Shockwave

The moving itself will be in a loop, every 0.03s
 
Level 6
Joined
Mar 27, 2019
Messages
51
Here is a short Trigger that works how you described it, atleast I think so

Point = Temp_Point
Point = Temp_Point2
Unit = Temp_Unit
Unit Group = Temp_Group
Unit Group = Shockwave_Group


--Create Unit named Shockwave (Dummy)--
--Create Ability named Shockwave--
  • Shockwave Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave Dummy
    • Actions
      • Set VariableSet Temp_Point = (Target point of ability being cast)
      • Set VariableSet Temp_Point2 = (Position of (Triggering unit))
      • Unit - Create 1 Shockwave (Dummy) for Neutral Passive at Temp_Point2 facing (Angle from Temp_Point2 to Temp_Point) degrees
      • Unit - Move (Last created unit) instantly to Temp_Point2, facing Temp_Point
      • Custom script: call UnitAddAbilityBJ( 'Aloc', GetLastCreatedUnit() )
      • Unit - Change ownership of (Last created unit) to (Owner of (Triggering unit)) and Retain color
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Add (Last created unit) to Shockwave_Group
      • Trigger - Turn on Shockwave Group <gen>
      • Custom script: call RemoveLocation(udg_Temp_Point)
      • Custom script: call RemoveLocation(udg_Temp_Point2)
  • Shockwave Group
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Shockwave_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet Temp_Point = (Position of (Picked unit))
          • Set VariableSet Temp_Point2 = (Temp_Point offset by 10.00 towards (Facing of (Picked unit)) degrees.)
          • Unit - Move (Picked unit) instantly to Temp_Point2, facing (Facing of (Picked unit)) degrees
          • -------- You can add the Damage Part here --------
          • Set VariableSet Temp_Group = (Units within 128.00 of Temp_Point matching ((((Matching unit) is alive) Equal to Wahr) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit)).) Equal to Wahr)).)
          • Set VariableSet Temp_Unit = (Picked unit)
          • Unit Group - Pick every unit in Temp_Group and do (Actions)
            • Loop - Actions
              • Unit - Cause Temp_Unit to damage (Picked unit), dealing 5.00 damage of attack type Spells and damage type Normal
              • -------- Maybe add an Checkup if Target was already damaged. --------
          • Custom script: call DestroyGroup(udg_Temp_Group)
          • Custom script: call RemoveLocation(udg_Temp_Point)
          • Custom script: call RemoveLocation(udg_Temp_Point2)
  • Shockwave Expiration
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Shockwave (Dummy)
    • Actions
      • Unit Group - Remove (Triggering unit) from Shockwave_Group.
      • Unit - Remove (Triggering unit) from the game
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Shockwave_Group) Less than or equal to 0
        • Then - Actions
          • Trigger - Turn off Shockwave Group <gen>
        • Else - Actions

If that's too complicated download the Map I attached to get a proper look, if you still do not understand how this works at all, refer to look up some Tutorials!
Have a good day.
 

Attachments

  • Shockwave Dummy.w3m
    20.7 KB · Views: 6
Level 39
Joined
Feb 27, 2007
Messages
5,050
Don't reinvent the wheel if you don't have to:

 
Status
Not open for further replies.
Top