HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Model Doesn't move with the unit!

04-06-2008, 10:43 PM#1
Salbrismind
I'm getting a weird bug in with my map. My map has a arrow key movement system and recently I tried removing the units movement and replacing it with a variable. The problem is now when I make it move the model stays and does its animations at its start position but the unit and its shadow move around normally. Here's a screen shot to clarify:

Click image for larger version

Name:	Animation Bug.JPG
Views:	46
Size:	163.3 KB
ID:	33100

The teal foot man is the model/unit in question and the shadow is the actual unit.


Also, sort of related to this is another bug that I was hoping to fix later but I should now as well. When a unit dies it's model stays standing in it's place with no shadow. Not much testing I've done has been in this area but it seems like only when I am pressing keys (causing manual animations to go off).

Here's the map, because the code in question is too big (9+ triggers):
Mercenaries Battleground v0.1 (Jass).w3x

The triggers that control movement are ForwardOn, Forward, ForwardOff, LeftOn.... etc.
Attached Images
File type: jpgAnimation Bug.JPG (163.3 KB)
Attached Files
File type: w3xMercenaries Battleground v0.1 (Jass).w3x (190.1 KB)
04-06-2008, 11:15 PM#2
Rising_Dusk
Make sure your unit has at least 1 movement speed.
04-07-2008, 12:48 AM#3
Voi
I had a similar bug. I created some units without movement with triggers. When the trigger ran in game, the models would separate even if the units were still at the same place. Apparently, it was a "Movement - Group separation: true" in the unit editor that made them want to spread out even if they couldn't. I set this false and it worked fine.
I also move a unit without move in another place (slippery ice minigame), and it works fine with movement speed 0 and movement type 0. It is not a building though, I think I have had buildings bug like that previously.
04-07-2008, 01:56 AM#4
Salbrismind
It looks like it might be the way I set my unit's position. In your map you use
SetUnitPositionLoc, while I use SetUnitX/Y. I am going to try and change that, and hopefully it will work!

That group separation was already set to false so I don't think that is it!
04-07-2008, 02:07 AM#5
Rising_Dusk
In my maps, if I use SetUnitX/Y on a unit with 0 movement speed, it moves only the unit and not the shadow. Your bug symptoms seem incredibly close in nature to that, seriously, try giving it 1 movement speed and just removing the ability 'Amov', might fix it right up.
04-07-2008, 02:11 AM#6
Salbrismind
Quote:
Originally Posted by Rising_Dusk
In my maps, if I use SetUnitX/Y on a unit with 0 movement speed, it moves only the unit and not the shadow. Your bug symptoms seem incredibly close in nature to that, seriously, try giving it 1 movement speed and just removing the ability 'Amov', might fix it right up.

Would removing Amov prevent players from moving the unit, and right-clicking and pressing m? And the icon for movement?
04-07-2008, 02:13 AM#7
Rising_Dusk
Yes to all of the above.
04-07-2008, 02:20 AM#8
Salbrismind
Quote:
Originally Posted by Rising_Dusk
Yes to all of the above.

Ya, I know I just tried it XD. I should have asked after I tried, actually then not asked at all. In any case thanks a lot! Weird thing is I asked this before and no one gave me the answer...

I have another question though... I know there are a few other posts already asking but can you remove stop and attack commands the same way? I REALLY need to remove all the icons but custom ones and I can't find a way without removing the attack on the unit. Really all I want is to have a unit show its attack but not have an attack command! Possible?
04-07-2008, 02:21 AM#9
Rising_Dusk
Quote:
Originally Posted by Salbrismind
I have another question though... I know there are a few other posts already asking but can you remove stop and attack commands the same way?
Collapse JASS:
call UnitRemoveAbility(MyUnit, 'Aatk')
04-07-2008, 02:25 AM#10
Salbrismind
Quote:
Originally Posted by Rising_Dusk
Collapse JASS:
call UnitRemoveAbility(MyUnit, 'Aatk')

Any side-effects?

Also, this is interesting: I remove 'Amov' and apparently the unit also loses its movement speed. I know this because I was planning to use GetUnitMoveSpeed('unit') for my trigger, but I guess not.

Has this been found before?
04-07-2008, 02:39 AM#11
Rising_Dusk
Quote:
Originally Posted by Salbrismind
Any side-effects?
You can't re-add the attack ability later in the game, removing it once has permanent side effects. Otherwise, nothing of note.
Quote:
Originally Posted by Salbrismind
Also, this is interesting: I remove 'Amov' and apparently the unit also loses its movement speed. I know this because I was planning to use GetUnitMoveSpeed('unit') for my trigger, but I guess not.
If it can't move, I doubt it can retain any movement speed, so that makes sense to me. I think it has been found before though, so yes.
04-07-2008, 02:49 AM#12
Salbrismind
Quote:
Originally Posted by Rising_Dusk
You can't re-add the attack ability later in the game, removing it once has permanent side effects. Otherwise, nothing of note.

If it can't move, I doubt it can retain any movement speed, so that makes sense to me. I think it has been found before though, so yes.

K, thats all! Thanks Rising!
04-07-2008, 04:27 AM#13
Hydrolisk
I think you can use the Cargo Hold ability (or something along the lines of that) to disable the attack and then remove the Cargo Hold ability to enable the attack again.
04-07-2008, 06:59 PM#14
Salbrismind
Quote:
Originally Posted by Hydrolisk
I think you can use the Cargo Hold ability (or something along the lines of that) to disable the attack and then remove the Cargo Hold ability to enable the attack again.

Would it keep the damage icon on the unit that displays damage?