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

How to make a bridge that can be crossed underneath?

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

How can we make it so a bridge can be crossed underneath it, e.g. if the bridge is spanning a gap in a canyon, the floor of the canyon down below should also be passable (since the units would go under the bridge).

WC3 bridges seem to defy this logic--bridges AFAIK are only walkable in one direction.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
This is afaik not possible unless some real obscure complex solution is used. This is because you want to prevent units walking off of bridges, therefore requiring pathing blockers. And as we all know, pathing map is 2 dimensional so it will block everything at any height(assuming flying blocker)
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
I've made something like this before, but as mentioned above it's very obscure.

My method was to have a set of "entry" regions, which will tell me if a unit is entering the bridge from above or below. If entering from above, the flying height will be increased so that the unit appears on top of the bridge. This cannot be done very smoothly, so the unit's height appears jump-y when entering/exiting.

Further complicating matters:
  • Ground units will block each other on/under the bridge. You'll need to make a custom collision system.
  • Melee units can attack each other on/under the bridge. Ranged units can attack through the bridge. You'll need to catch these orders. Not particularly hard, but it gets messy.
  • You won't be able to click *on* the bridge. So if you want to move to a point on the bridge, the click goes "through" the bridge and the order is given to a spot underneath.
  • Also as mentioned above, preventing units walking off the bridge in the wrong place. Pathing blockers isn't an option, so you'll need to use a looping SetUnitX/Y to prevent units walking off.
 
Status
Not open for further replies.
Top