| 09-03-2006, 08:17 AM | #1 |
I recently encountered another strange stuff and I was wondering if it ever happened to you too. I have been trying to move missile units (no caster system, I make these functions by myself) circling around an unit. Well, this whole blah blah is not important. However, I noticed that even though I moved the units with SetUnitX and SetUnitY, their shadow would move but the model itself (appearance) would stay in place. When I tried with other units it worked even with the model so I was certain there was something wrong with my missile unit. I tried changing some fields here and there, and in the end I discovered that the problem was the fact that unit's movement speed was set to 0. If I set it to 1, the model would also be moved. SetUnitPosition works perfectly in both cases. I know it is a minor stuff and pathetically simple to avoid, but out of pure curiosity just wondering if there is an explanation for this or it is just weird WE behavior? ~Daelin |
| 09-03-2006, 08:34 AM | #2 |
Same with set WidgetLife() it will revive trees but they will stay "dead". This is not bug, unit with 0 move speed cant move, it have static position, soo changing X or Y you do not change its position. |
| 09-03-2006, 08:49 AM | #3 |
umm.... By what you said it would sound as if SetUnitPosition should not work and SetUnitX & SetUnitY should work, when unit's movement speed is set to 0. Static position => Unit's position cannot be changed. ~Daelin |
| 09-03-2006, 09:02 AM | #4 |
Just weird WE behaviour, imo. I also hit it once sometime last year. |
| 09-03-2006, 01:14 PM | #5 |
Same goes for changing flyheight, units must have a movement speed. |
| 09-03-2006, 02:27 PM | #6 |
Yeah, moving units doesn't work if they don't have a move speed, and that's probably one of the most odd things you can find in wc3. I can't find a logical explanation for this. |
| 09-04-2006, 02:11 AM | #7 | |
Quote:
I don't see that that is true. Cause I always use a dummy unit with no movement speed, yet it seems to change height just fine. |
| 09-04-2006, 03:50 AM | #8 |
The weirder thing is... if you do something like: JASS:call ClearTextMessages() call BJDebugMsg( "X: " + R2S(GetUnitX(u)) ) call BJDebugMsg( "Y: " + R2S(GetUnitY(u)) ) You can see the values of the unit's position changing while the model stays in place. For my dummy, there was no shadow, so I didn't figure out that it had nothing to do with my code until I tried that. |
| 09-04-2006, 08:58 AM | #9 |
Perhaps it is because Blizzard uses a similar piece of code to move units on the map? After all, they did not include these two functions into GUI, did they? And yes Naakaloh, I know that the unit itself is moving. So the result of the text is logical. What is not logical is the model stuff. :P ~Daelin |
| 09-04-2006, 11:53 AM | #10 | |
Vexorian Quote:
|
| 09-04-2006, 02:08 PM | #11 |
That's because buildings also have movement speed of 0. I have a theory. Since it is the model itself, it has something to do with unit's move animation. Considering that depending on the movement speed the animation is executed faster or slower (or I may be wrong about this, and only attack reacts like this). So if it is set to 0, the animation practically freezes => when trying to move such an unit (and not changing its position) all animations are frozen to 0 speed. ~Daelin |
| 09-06-2006, 02:02 PM | #12 |
And units with movespeed 0 can't attack, too. I've tried making a spell in which the unit flies and can attack from anywhere, but can't move. I used Metamorphosis as base and, whoala, no damage thingy. And no fly-fly. Erm... wth about NE buildings o_O I think the damage thingy is wrong, but I know I saw it -_- |
| 09-06-2006, 04:31 PM | #13 |
towers have 0 move speed and they seem kind of good at attacking. |
| 09-07-2006, 01:17 AM | #14 |
Im pretty sure the reason isnt because of the animations, this is my reasoning behind the problem I have always said that SetUnitPosition works like an order, it pauses the unit and when being moved they cant actually cast any spells or do anything else (essentially they are disabled). We obviously all know this, and SetUnitX/Y just changes the position and nothing else. Taking this into account you can assume that SetUnitX/Y actually moves (i.e. if you order a unit to move) the unit which is why they are not disabled and can still attack/do actions. The move is obviously instant, so this is most likely the same reason why you cannot move a unit with movespeed of 0. SetUnitPosition works more like a teleport (or an ability) so it will work regardless of the movespeed. Likewise I think the same thing goes for buildings |
