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

Unit coordinates change but unit model doesn't move

Status
Not open for further replies.
Level 9
Joined
Apr 19, 2011
Messages
447
Hi.

I've recently started working again on my proyects, and I was doing fine until I found a problem I can't understand. I was using this trigger to move a unit:

  • Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Custom script: call SetUnitY(udg_TempUnit, GetUnitY(udg_TempUnit) - udg_REAL)
TempUnit: Unit variable. It's the unit I'm trying to move.
REAL: Obviously, a real variable.

Basicly, the unit should slowly move down in the map. Alright, I tested it, and the unit didn't move at all. I used the following trigger to periodically check the REAL variable and the unit's coordinates:

  • Check
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (REAL: + (String(REAL)))
      • Game - Display to (All players) the text: (X: + (String((X of (Position of TempUnit)))))
      • Game - Display to (All players) the text: (Y: + (String((Y of (Position of TempUnit)))))
To my surprise, I found that the unit's coordinates were correctly changing as they should be. But the unit's model didn't move! REAL had a value of about 6, so the movement should be noticeable.
The game says that the unit is moving, but my eyes say it's not. I don't really not what's going on. Anyone knows what can I do with this?

Kind Regards
 
Level 25
Joined
Sep 26, 2009
Messages
2,388
Is temp unit correctly set? Try adding to your check trigger also the unit name of tempunit to see - maybe some other trigger nulls temp unit.

Another thing you can try is calculate the y first hand and then move unit there.
Also, where do you set "Real" and value do you give it? In your check trigger I see that you check what value "real" has, but you don't check the "y" you're trying to calculate... you only check the y coordinate of your unit
 
Btw, you can not use the "SetUnitMoveSpeed" native to change a units move speed if the object editor data has "0" for movespeed.
What you can do, is setting the move speed in object editor to 1 and then set the movespeed via trigger back to 0.
if you then adjust the move speed again, you can even set it so something else than 0.
Seems that object editor overrides some internal data here.
 
Status
Not open for further replies.
Top