• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Updating position of unit?

Status
Not open for further replies.

Lune722

L

Lune722

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:ocarina 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?
 
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.
 
Okay after some tweaks I got it working, thanks for your time guys.

+rep
 
Status
Not open for further replies.
Back
Top