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

[Trigger] Gui homing trigger

Status
Not open for further replies.
Level 9
Joined
Aug 15, 2007
Messages
261
You will need to explain in more detail what you are after...

I do not think what you are after is possible with GUI alone. You will have to use some custom script for leak clean up and to use SetUnitX/Y.
Untitled Trigger 001
Events
Time - Every 0.01 seconds of game time
Conditions
(Caster has buff Homing Check ) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
ENEMY Equal to No unit
Then - Actions
Special Effect - Create a special effect attached to the chest of (Matching unit) using Phoenix_Missile2.mdx
Set Location[2] = ((Position of ENEMY) offset by Speed towards Angle degrees)
Unit - Move Caster instantly to Location[2]
Custom script: call RemoveLocation(udg_Location[2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Speed Less than 1.00
Then - Actions
Set Speed = (Speed + 0.02)
Set AnimationSpeed = (Speed + 0.02)
Else - Actions
Else - Actions
Special Effect - Create a special effect attached to the chest of (Matching unit) using Phoenix_Missile2.mdx
Set Location[2] = ((Position of Caster) offset by Speed towards Angle degrees)
Unit - Move Caster instantly to Location[2]
Custom script: call RemoveLocation(udg_Location[2])
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Speed Less than 1.00
Then - Actions
Set Speed = (Speed + 0.02)
Set AnimationSpeed = (Speed + 0.02)
Else - Actions


that moves the unit instantly once
doesnt move it more than 15 torwards i need something that moves the unit 200 torwards

and if there is unit equals enemy to be moving the caster to the enemy (150 torwards + 50 torwards after so it can set the enemy Variable to the next unit in line)

Allso if the caster comes to 150 torwards of enemy while the ability is cast to go to the unit + 50 torwards which can be done whit a simple 0.01 checking trigger thats turning on if Enemy = no unit and back off if enemy =unit

allso im ok whit custom scripts just no mui or jass

And as i allready posted in another topic im wiling to share my work whit someone whos willing to help
it has been a few eyers and im unable to fix my sonic system.
 
Last edited:
Level 12
Joined
Mar 24, 2011
Messages
1,082
First of all, learn how to post triggers properly here.

Now... read the comments I've left after ////
  • If - Conditions
    • ENEMY Equal to No unit
  • Then - Actions
    • Special Effect - Create a special effect attached to the chest of (Matching unit) using Phoenix_Missile2.mdx ////You have done no matching, (Matching unit) does not exist. Special effect leak.
    • Set Location[2] = ((Position of ENEMY) offset by Speed towards Angle degrees) ////The condition of this trigger is that ENEMY points to nothing ? As such (Position of ENEMY) would be always (Centre of map area). Also, position of ENEMY is a pont leak
    • Unit - Move Caster instantly to Location[2] ////I'd guess caster is set in another trigger... Use set unit X/Y instead of move unit.
    • Custom script: call RemoveLocation(udg_Location[2]) ////This makes me very happy :3
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Speed Less than 1.00
      • Then - Actions
        • Set Speed = (Speed + 0.02)
        • Set AnimationSpeed = (Speed + 0.02) ////If Speed and AnimationSpeed are with the same value, why don't you use a single variable?
      • Else - Actions
    • Else - Actions
      • Special Effect - Create a special effect attached to the chest of (Matching unit) using Phoenix_Missile2.mdx ////No matching unit again. Special effect leak.
      • Set Location[2] = ((Position of Caster) offset by Speed towards Angle degrees) ////Position of caster is a leak. Who is Caster again ?
      • Unit - Move Caster instantly to Location[2] ////Same as above
      • Custom script: call RemoveLocation(udg_Location[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Speed Less than 1.00
        • Then - Actions
          • Set Speed = (Speed + 0.02)
          • Set AnimationSpeed = (Speed + 0.02)
        • Else - Actions
I can't see anything that updates "Angle" ?
Caster should be in the initialization trigger?
I don't see any code that ends this loop/trigger ?

Also, "0.01" sec is a pretty bad time to use. It is a "do not use if not nessessary" rather go with "0.03" or "0.02".

PS: On another topic... should I understand you are Bulgarian ?
 
Level 9
Joined
Aug 15, 2007
Messages
261
First of all, learn how to post triggers properly here.

Now... read the comments I've left after ////
  • If - Conditions
    • ENEMY Equal to No unit
  • Then - Actions
    • Special Effect - Create a special effect attached to the chest of (Matching unit) using Phoenix_Missile2.mdx ////You have done no matching, (Matching unit) does not exist. Special effect leak.
    • Set Location[2] = ((Position of ENEMY) offset by Speed towards Angle degrees) ////The condition of this trigger is that ENEMY points to nothing ? As such (Position of ENEMY) would be always (Centre of map area). Also, position of ENEMY is a pont leak
    • Unit - Move Caster instantly to Location[2] ////I'd guess caster is set in another trigger... Use set unit X/Y instead of move unit.
    • Custom script: call RemoveLocation(udg_Location[2]) ////This makes me very happy :3
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Speed Less than 1.00
      • Then - Actions
        • Set Speed = (Speed + 0.02)
        • Set AnimationSpeed = (Speed + 0.02) ////If Speed and AnimationSpeed are with the same value, why don't you use a single variable?
      • Else - Actions
    • Else - Actions
      • Special Effect - Create a special effect attached to the chest of (Matching unit) using Phoenix_Missile2.mdx ////No matching unit again. Special effect leak.
      • Set Location[2] = ((Position of Caster) offset by Speed towards Angle degrees) ////Position of caster is a leak. Who is Caster again ?
      • Unit - Move Caster instantly to Location[2] ////Same as above
      • Custom script: call RemoveLocation(udg_Location[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Speed Less than 1.00
        • Then - Actions
          • Set Speed = (Speed + 0.02)
          • Set AnimationSpeed = (Speed + 0.02)
        • Else - Actions
I can't see anything that updates "Angle" ?
Caster should be in the initialization trigger?
I don't see any code that ends this loop/trigger ?

Also, "0.01" sec is a pretty bad time to use. It is a "do not use if not nessessary" rather go with "0.03" or "0.02".

PS: On another topic... should I understand you are Bulgarian ?
yes i am Bulgarian
i will check your sujestions in a second

ok first caster = unit that casts the ability in another trigger

  • Homing2 Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to homing3
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (GroupMissile is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on AnimationAttack <gen>
          • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Phoenix_Missile2.mdx
          • Set a13a = (Last created special effect)
          • Set speedMultiplier_Copy = (Random real number between 2.00 and 7.00)
          • Set int1 = (int1 + 1)
          • Set tempPoint1_Copy = (Position of Sonic 0001 <gen>)
          • Set tempPoint2_Copy = (tempPoint1_Copy offset by (speedMultiplier_Copy x ((Current movement speed of Sonic 0001 <gen>) / (Default movement speed of Sonic 0001 <gen>))) towards (Facing of ENEMY) degrees)
          • Unit - Order Sonic 0001 <gen> to Move To tempPoint2_Copy
          • Custom script: call RemoveLocation (udg_tempPoint1_Copy)
          • Custom script: call RemoveLocation (udg_tempPoint2_Copy)
          • Trigger - Turn off Speed Effect <gen>
          • Set Caster1 = (Triggering unit)
          • Wait 2.00 seconds
          • Set int1 = 0
          • Special Effect - Destroy a13a
          • Unit Group - Remove (Picked unit) from Frost_Group_Copy
          • Unit - Remove 11 buff from Sonic 0001 <gen>
          • Trigger - Turn off AnimationAttack <gen>
        • Else - Actions
          • Trigger - Turn on AnimationAttack <gen>
          • Special Effect - Create a special effect attached to the chest of (Triggering unit) using Phoenix_Missile2.mdx
          • Set a13a = (Last created special effect)
          • Set speedMultiplier_Copy = (Random real number between 2.00 and 7.00)
          • Set int1 = (int1 + 1)
          • Set tempPoint1_Copy = (Position of Sonic 0001 <gen>)
          • Set tempPoint2_Copy = ((Position of unit) offset by (speedMultiplier_Copy x ((Current movement speed of Sonic 0001 <gen>) / (Default movement speed of Sonic 0001 <gen>))) towards (Facing of ENEMY) degrees)
          • Unit - Move Sonic 0001 <gen> instantly to tempPoint2_Copy
          • Custom script: call RemoveLocation (udg_tempPoint1_Copy)
          • Custom script: call RemoveLocation (udg_tempPoint2_Copy)
          • Trigger - Turn off Speed Effect <gen>
          • Set Caster1 = (Triggering unit)
          • Wait 2.00 seconds
          • Set int1 = 0
          • Special Effect - Destroy a12a
          • Special Effect - Destroy a13a
          • Unit Group - Remove (Picked unit) from Frost_Group_Copy
          • Unit - Remove 11 buff from Sonic 0001 <gen>
          • Trigger - Turn off AnimationAttack <gen>
every trigger is connected whit each other
matching unit is the unit thats maching conditions and y i havent set it in a variable uet but i will as soon as i fix the homing
special effect works but im not removing it anywhere

Usualy i used that but its buged somehow
  • HomingPush Copy
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Sonic 0001 <gen> has buff Homing Check ) Equal to True
        • Then - Actions
          • Set tempPoint1 = (Position of Sonic 0001 <gen>)
          • Set tempPoint2 = (tempPoint1 offset by (speedMultiplier x ((Current movement speed of Sonic 0001 <gen>) / (Default movement speed of Sonic 0001 <gen>))) towards (Facing of ENEMY) degrees)
          • Unit - Move Sonic 0001 <gen> instantly to (tempPoint2 offset by (0.00, 0.00))
          • Custom script: call RemoveLocation (udg_tempPoint1)
          • Custom script: call RemoveLocation (udg_tempPoint2)
          • Wait 0.50 seconds
          • Set ENEMY = No unit
          • Unit - Move Sonic 0001 <gen> instantly to ((Position of ENEMY) offset by 151.00 towards 0.00 degrees)
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top