• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Attaching one unit to another unit

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I want to give one of my star wars ships a turret that is attached to it, but can turn and fire as needed. I'm very close.

What I've done:

I've made the regular ship unit that is moved through triggers. I've made a second "turret" unit with the locust ability and I move it exactly where the regular ship is every time I move the regular ship and make it face the same direction +/- whatever the turret facing is. Both units have zero collision, and both have 0 for sample point in the object editor. The flying heights are static and do not change (the turret is 30 higher than the ship).

Everything works almost perfectly. The only problem is when the ships flies over hills. Whenever that happens the turret's height appears to differ just a bit from the ship's height, so the turret appears to grow upward when you're flying around a cliff, or dip low into the ship. Since their positions are identical, and their flying height is identical, something else is making the turret or ship move vertically.

Does anyone know what this could be?
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Can you attach a picture of how it looks like ?
If the turret and the ship aren't really attached to each other, maybe you have to set the turret's flying height to (Ship's + 50) for example, or (Ship's - 50)
I don't know the exact problem because your way is the only way to attach an unit ;)
Still, you should really post the picture
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
^
As mentioned above, post a picture so we can know what is really happening.

Maybe the models of those units act differently when going through a different phase of Z heights.
If that's the case, you need to alter the flying height of either Turret or the Ship to "correct" the flying height error.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Thanks guys.

I've attached a .jpg of the ship with its turret overhead. It seems like the ship works fine, but the turret raises or falls when their are hills or - especially - doodads nearby.

Incidentally, how do I get a picture that I've attached to appear here in the text?

Thanks guys.

P.S. I forgot to answer some of your questions. The turret does have its flying height set to +30 of the flying height of the ship. Neither of their flying heights are adjusted when over terrain...they just go up and down naturally (unlike, say, lasers). I also noticed that if I fly into a cliff, the turret raises much higher than the ship.


UPDATE:

I tried the following. I copied and pasted the ship's unit so that the turret and the ship were identical in all respects. The problem still remains. In other words, it's not that the model or the unit have different settings...they are identical in all respects, and yet you can see one edge up over the other from time to time.

This suggests that I can't fix the problem in the unit editor (unless . The trigger, though is really simple...I just SetUnitX and SetUnitY to the same x/y coordinates for both ships.

UPDATE 2:

I've attached 2 pictures with the stats of the ship so people can look at it and see if anything is set wrong.
 

Attachments

  • blastboat.jpg
    blastboat.jpg
    45.3 KB · Views: 119
  • blastboat1.jpg
    blastboat1.jpg
    173.4 KB · Views: 74
  • blastboat2.jpg
    blastboat2.jpg
    155 KB · Views: 65
Last edited:
Level 14
Joined
Aug 30, 2004
Messages
909
Beautiful, Anvil! I have no idea why that would work... but it does!

It looks almost perfect now. The only problem is the swaying up/down of the original ship's animation, but I know how to fix that.

Thanks a bunch!

+rep all the way around.
 
Status
Not open for further replies.
Top