• 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.

[General] Place units on invisible platforms with fixed Z

Status
Not open for further replies.
Level 27
Joined
Feb 2, 2006
Messages
1,571
Hi, in my current map I place trebuchets on invisible platforms which have a fixed Z value like 520 or something else. Units should walk on these platforms and the units which I place in my map on the platforms should also appear on top of the platforms. The unit type is building. In most of the games it works perfectly. I have created a trigger which replaces the units with the same unit type after the game has started to assure that the units are recreated on the platforms. However, in some games it doesn't work. The units are under the platforms.

How can I make sure that the units are on top of the invisible platforms. They are also under the platforms in the world editor :(

I could assign a fixed Z value to the units in the beginning of the game? Can I retrieve the Z value of the invisible platform and use it for the unit? The Reforged editor shows a Z value and a checked box with Fixed Z. This is the exact value I would need to take. I don't want to set it for every trebuchet manually but maybe this will be the only way?
 
Level 27
Joined
Feb 2, 2006
Messages
1,571
TrebuchetOnFloatingStuff.png

I have removed the walls so you can see the trebuchet and the invisible platforms. they should cover the whole area and as I wrote. Most of the times it works but sometimes it doesn't. The trebuchet unit is a building so it is not flying. I could make it flying and change the flying height. I don't want to set a fixed movement height in the object editor since there are different levels of the walls with different heights and I would like to use the same unit type for all trebuchets on all levels.
 
Personally I'd make the walls walkable destructibles, that way the texture determines the pathing.

Also if you do insist on going the invisible platform route I suggest you use the small one tightly stacked together. You can follow what I did here: [Mapping] - Walking under Bridges Tutorial

Although it's not entirely the same, the same concept should still apply.
 
Level 27
Joined
Feb 2, 2006
Messages
1,571
Hm I didn't want to make it walkable since it gives me more freedom on placing it etc. I think that even I use the small ones sometimes when the map starts ALL trebuchets are inside the towers, so it seems to be a more general problem. Maybe when I have some more time I can create a small example map with some invisible platforms and a unit on top and start the game several times until the problem occurs. I though that a fixed Z position would work the best.
 
Level 27
Joined
Feb 2, 2006
Messages
1,571
Sry to "rebump" this thread but I still have no satisfying solution. The Trebucht units are mechanical units and I set a fixed height, so they appear at the correct position in the World Editor. However, they are still standing on platforms since when they get destroyed units should be able to walk on the towers. Sometimes it looks good from the beginning but sometimes they are still inside of the towers. I recreate them all at the start of the game but it doesn't always help.

I had some ideas about setting a fixed Z to the units with a custom function:

Code:
function SetUnitZ takes unit whichUnit, real z returns nothing
    local real unitZ = BlzGetLocalUnitZ(whichUnit)
    local real diff = z - unitZ
    if (unitZ > z) then
        set diff = unitZ - z
    endif
    call UnitAddAbility(whichUnit, 'Arav')
    call UnitRemoveAbility(whichUnit, 'Arav')
    call SetUnitFlyHeight(whichUnit, diff, 0)
endfunction

However, this seems to lead setting the unit heights too high and I had to set the movement type to "hover" or something before. Then the selection circle appeared in the air. Isn't there already a function like that which I can use to set the unit's Z to a fixed value which always works?
 

Attachments

  • BuildingHeights.png
    BuildingHeights.png
    15.5 KB · Views: 24
  • BuildingTrebuchets.png
    BuildingTrebuchets.png
    1.3 MB · Views: 29
Last edited:
I think that even I use the small ones sometimes when the map starts ALL trebuchets are inside the towers
Have you tried it? I use small invisible platforms literally all the time and I don't have any of the problems you have described, but I have had problems with the large invisible platforms.
 
So if I understand correctly the unit doesn't react to the invisible platforms at all and is standing under them instead of on them? Here are some things that I personally would try doing to troubleshoot the issue:

  • Make sure the invisible platforms are alive by killing them and instantly resurrecting them.
  • Move the unit to its current location to see if that makes it appear on top.
  • Make the unit able to move and try moving it around to make sure it doesn't stand inside the cracks of the invisible platforms.
  • Make doodads invisible and press "P" to see the pathing to make sure the invisible platforms are in fact covering the whole area.
  • Try with different kinds of invisible platforms.
  • Try with custom pathing.
  • Make custom walkable destructibles right underneath the walls (so they're not visible) and shut them off from other walkable areas with pathing blockers.
 
Level 27
Joined
Feb 2, 2006
Messages
1,571
Hey, I tried your solution with the small invisible platforms again and it seemed to work. All Trebuchets of the towers I have already updated with only small invisible platforms had their position from the World editor with a fixed height and the others didn't have it. So there is definitely a difference. It really feels good now man.

I think I will rework all towers now and look in a few hundered games if the bug does appear again or not.

edit:
I was too early. It still doesn't work with small invisible platforms and strangely it worked for the other towers in this game:
TowerMinasTirith.png
 
Last edited:
Level 27
Joined
Feb 2, 2006
Messages
1,571
Did you recreate the units/create the units dynamically during the game on top of the invisible platforms? Did your units have a fixed height? Were they buildings or regular units? Did they have a movement type?

My units are not buildings, have a fixed height, so they appear on top in the editor. Strangely, even with the fixed unit height, they appear inside of the tower?! Actually they should either appear on top of the tower due to their fixed height or even higher due to the invisible platform. I really don't know how they can even appear inside the tower now?! I recreate them all but maybe I recreate them with a unit type without a fixed height.

I can still try more solutions you suggested: "invisible platforms are alive by killing them and instantly resurrecting them".

Did the units for you appear on top of the invisible platforms even in the World Editor nor not?

edit:
I could try some trick by creating the trebuchets outside of the invisible platform and move it to its position and remove the posibility to move.
I think when units enter the invisible platforms during the game it does always work correctly.
 
I don't recreate the units. My units mostly don't have any fixed height. They are regular units, not buildings.

To have a unit with fixed height appear above ground level it needs to have movement type flying. If it doesn't have movement type flying the height won't matter.

Alternatively you can use Retera's model studio to actually attach a trebuchet to a wall :p
 
Last edited:
Level 27
Joined
Feb 2, 2006
Messages
1,571
I have tried the following solutions now:
  • Use only small invisible platforms.
  • Recreate the small invisible platforms and units after the game has started.
  • Give the Trebuchets the movement type flying, move them away from the platform and back and replace them with a Trebuchet without any movement type.
  • Using a fixed flying height.
All solutions did not work. In some games they disappeared inside the invisible platforms except for the last one where they were sometimes at the correct height or on top of the invisible platform. The collision size is rather small like 20 or something and the Trebuchet has no pathing texture.
I have no Doodad which is walkable under the invisible platforms. I cannot make them walkable. I think only destructibles can be walkable.

It is really random when the disappear under the invisible platforms and when it happens it happens for all of them.

I think that the fixed Z value is really the only solution but then they have to ignore the invisible platform under them. So the real question is now how can certain units ignore the invisible platform under them? It seems that flying units do not ignore them. If I could make a unit/building make ignore them always it would work fine with a fixed flying height. Other units still need them since you must be able to walk there.

If this does not work I can only try to replace by Doodads with Destructibles which are walkable.
 
I have tried the following solutions now:
  • Use only small invisible platforms.
  • Recreate the small invisible platforms and units after the game has started.
  • Give the Trebuchets the movement type flying, move them away from the platform and back and replace them with a Trebuchet without any movement type.
  • Using a fixed flying height.
All solutions did not work. In some games they disappeared inside the invisible platforms except for the last one where they were sometimes at the correct height or on top of the invisible platform. The collision size is rather small like 20 or something and the Trebuchet has no pathing texture.
I have no Doodad which is walkable under the invisible platforms. I cannot make them walkable. I think only destructibles can be walkable.

It is really random when the disappear under the invisible platforms and when it happens it happens for all of them.

I think that the fixed Z value is really the only solution but then they have to ignore the invisible platform under them. So the real question is now how can certain units ignore the invisible platform under them? It seems that flying units do not ignore them. If I could make a unit/building make ignore them always it would work fine with a fixed flying height. Other units still need them since you must be able to walk there.

If this does not work I can only try to replace by Doodads with Destructibles which are walkable.
At this point I think you'd just be better off posting your map here so someone can inspect it and try to see if you're doing something wrong.
 
I'm not really sure what's wrong, it should work fine.

I suggest you try to replicate this issue in a test map to see if you get the same results. Also try different things, like only putting them on invisible platforms (without the walls), only putting them on walls (without the invisible platforms), and with both like you have it now.
 
I can do that. I am not sure if "Walkable" should work for Doodads. Does it have the same effect as "Is Walkable" for Destructibles? What about the pathing texture? My Gondor walls have NO pathing texture. Maybe this is required for "Walkable" to work?
Walkable only works on destructibles. The pathing follows the mesh, and it does not need a custom pathing map so any model should be fine, and the pathing texture shouldn't matter.

EDIT: Also I really liked the Grond model in there, so I added some animations to it :p
 

Attachments

  • Grond.blp
    466.5 KB · Views: 19
  • GrondSpikes.blp
    8.8 KB · Views: 16
  • GrondWood.blp
    150.1 KB · Views: 16
  • Grond Animated.mdx
    163 KB · Views: 24
Status
Not open for further replies.
Top