• 🏆 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] Trigger does not work how I intend it to.

Status
Not open for further replies.
Level 4
Joined
Nov 6, 2011
Messages
44
  • Ball Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set BallHitterDetect = (Units within 100.00 of (Position of Ball) matching (((Matching unit) is A ground unit) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in BallHitterDetect) Greater than or equal to 1
        • Then - Actions
          • Unit Group - Pick every unit in BallHitterDetect and do (Actions)
            • Loop - Actions
              • Set BallHitter = (Picked unit)
              • Set BallHitPoint = (Position of (Picked unit))
              • Set BallSpeed = 10.00
        • Else - Actions
      • If (BallSpeed Greater than 0.00) then do (Set BallSpeed = (BallSpeed - 0.25)) else do (Do nothing)
      • Unit Group - Pick every unit in BallHitterDetect and do (Actions)
        • Loop - Actions
          • Unit - Move Ball instantly to ((Position of Ball) offset by BallSpeed towards ((Angle from (Position of Ball) to (Position of BallHitter)) + 180.00) degrees)
I want the ball to move away from the one that hits(or touches) the ball at a rate of 10(BallSpeed) offset per 0.03 secs which is constantly reduced by .25 every 0.03 seconds until it is 0(Until it stops moving). What the ball actually does is just move away by 10 once when I touch it with a unit, so it just looks like the ball is just being pushed and stops when the unit stops.

What happens:


Excuse me for not clearing out leaks if there are any, I'm not good with them and I hope you'd provide help with fixing the leaks too if there are any.
 
Last edited:
Level 4
Joined
Nov 6, 2011
Messages
44
Because at the creation of the dummy you must re-position the dummy unit at it create position again, or make sure the the unit movement type is fly in the object editor.

It's not a dummy. The ball is a main thing in the map(The map is football). It was already set as a flying unit too.
 
Level 6
Joined
Oct 4, 2011
Messages
226
You're picking every unit in BallHitterDetecer group and then referring to "Ball" unit variable, I dont see this unit in this trigger I presume it is already set I dont think you need to use the unit group action at the end just refer to ball unit and ballhitter unit that gets set above. anyways why do you need this unit group? Your loop uses 10 as a max speed so it cant be faster then that. this means it takes 1.20 seconds for the ball to completely rest if it hits nothing. trigger hits 40 times.
 
Status
Not open for further replies.
Top