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

Updating position of unit?

Status
Not open for further replies.
Level 2
Joined
Mar 8, 2011
Messages
9
Hello, currently I'm finishing a new spell, and there's just one matter from keeping it from being finished.

The spell creates units that move around the target unit of the spell in a circular pattern (if you played zelda:eek:carina of time think of it like the ghosts/poes miniboss from the forest temple), every so seconds the units close their distance to the target a little.

The problem is that once the target moves, the units keep circling/closing the target original position instead of circling the target's new position.

I have tried without sucess to create a trigger that every 0.01 seconds sets a variable = position of target and then use a custom script from Bribe's GUI tips thread to remove it.

Any suggestions?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Never use "every 0.01" seconds in the first place. Warcraft's default maximum framerate can't even show images that fast, so why would you use it?

This is what Baassee said:

  • Whirl
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Set Angle = (Angle + 4.00)
      • Set Loc1 = (Position of Mover)
      • Set Loc2 = (Loc1 offset by Offset towards Angle degrees)
      • Unit - Move MovingGuy instantly to Loc2
      • Custom script: call RemoveLocation(udg_Loc1)
      • Custom script: call RemoveLocation(udg_Loc2)
This is the BASIC trigger for it.
Do not just copy/paste it: select what you need.

The unit that's moving is "MovingGuy", the unit around which he is moving is "Mover".
The variables Offset and Angle speak for themselves...


Basically you set the first location to the position of the mover and based on that location, you decide where Loc2 should be.
Additional features could be a dynamic offset, the facing of the units that change aaand... that's all I can think of right now.
 
Status
Not open for further replies.
Top