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

Buildable bridges

Status
Not open for further replies.
Level 11
Joined
Jun 2, 2004
Messages
849
The dummy building idea could work, though any building that could be built over a river could be built literally anywhere (though I think you could restrict it from being built on blight). Most restrictions would have to be triggered.

Or you could just let people build bridges anywhere. It'd be pretty hilarious. I might try it.


EDIT: My tests show that only pre-placed bridges affect the pathing map. You'll likely have to have pre-set bridge building areas.
 
Last edited:
Level 19
Joined
Jan 22, 2011
Messages
3,980
The dummy building idea could work, though any building that could be built over a river could be built literally anywhere (though I think you could restrict it from being built on blight). Most restrictions would have to be triggered.

Or you could just let people build bridges anywhere. It'd be pretty hilarious. I might try it.

That if only trigger created bridges would work... here is what happens:

http://www.hiveworkshop.com/pastebin/f41624acc291cdd941f2bfc8010b41247794/

The bridges rotate (as intended) but noone work.
 
Level 24
Joined
Aug 1, 2013
Messages
4,658
Well... if you forget about the placement thingy, you could create a dummy structure (with the bridge model) then, when it is created, you replace it with a dummy unit with an invisible bridge (still selectable) and you place a destructable bridge there.
Then... you have a "unit" bridge.

That still comes back to placement.
I think you can make it require water (only the bridge part) and then use triggers to actually check if there is land next to it.

The actual problem is, how do you rotate it?
That problem is the same a with walls, it is not really nice to work with.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
That if only trigger created bridges would work... here is what happens:

http://www.hiveworkshop.com/pastebin/f41624acc291cdd941f2bfc8010b41247794/

The bridges rotate (as intended) but noone work.
After some testing it appears bridge and platform object types (not category) are hard coded by the editor to clear or overwrite the global pathing under them. If one removes (not kills) a bridge that was placed in the editor units can still walk into the water.

Trigger created bridges do not do this as they apply normal destructible pathing overlay like trees do. To make trigger created bridges that work one has to also trigger modify the pathing to "walkability on" for all cells under the bridge. This pathing modification operation is probably quite computationally expensive as it will require several hundred calls (a cell is a tiny area).

Likewise when bridges are removed (not killed) then a similar inverse pathing fill operation is required to make the area under the bridge not walkable.
 
Level 11
Joined
Jun 2, 2004
Messages
849
It might be feasible to make rivers (or whatever you're bridging) walkable by default, place pathing blocker doodads over them, and remove the pathing blockers when a bridge is built in that area (and re-add them if the bridge is somehow removed).
 
Level 19
Joined
Jan 22, 2011
Messages
3,980
It might be feasible to make rivers (or whatever you're bridging) walkable by default, place pathing blocker doodads over them, and remove the pathing blockers when a bridge is built in that area (and re-add them if the bridge is somehow removed).

Well, the idea was to make dynamic paths for units to walk over (the player decides where to build this paths "bridges") But as it is now, it is impossible.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
It might be feasible to make rivers (or whatever you're bridging) walkable by default, place pathing blocker doodads over them, and remove the pathing blockers when a bridge is built in that area (and re-add them if the bridge is somehow removed).
Far easier/efficient to iteratively fill all cells in a rect under the bridge with the appropriate pathing.

But as it is now, it is impossible.
It is completely possible. One can dynamically create bridge destructables with triggers as long as one fills the pathing under them with walkable enabled and when they are destroyed (if possible) fill under them with walkable disabled.
 
Level 25
Joined
Oct 18, 2008
Messages
945
Trigger created bridges do not do this as they apply normal destructible pathing overlay like trees do. To make trigger created bridges that work one has to also trigger modify the pathing to "walkability on" for all cells under the bridge. This pathing modification operation is probably quite computationally expensive as it will require several hundred calls (a cell is a tiny area).

I always thought that did nothing. You're saying if I cover the map with invisible bridge type destructibles I can just use it to modify pathing at will?

what is a "cell", exactly? the trigger seems to ask for a point, but even those have decimals...
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
You're saying if I cover the map with invisible bridge type destructibles I can just use it to modify pathing at will?
I am saying one can use the pathing modification native, which has a GUI action under Environment, to modify the pathing of the cells to dynamically create functional bridges.

what is a "cell", exactly?
Not entirely sure, but it is either 32*32 or 64*64 in area and in a uniform grid which each time either containing 4*4 or 2*2 cells. Regions (not rects) are made up of cells.

the trigger seems to ask for a point, but even those have decimals...
It alters the pathing of the cell containing the location.

No idea what you mean by "even those have decimals". A cell is an area of the map where as a location is a point on the map.
 
Level 19
Joined
Jan 22, 2011
Messages
3,980
Not sure what you mean by "work". One will need to use triggers to make the water walkable and still need a walkable destructable bridge so that the units appear to walk on it rather than under it.

How about an aura buff? when the unit has the buff it will:
A) be able to walk on water
B) walk a little higher so that it looks like the unit is actually walking in the bridge
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,287
How about an aura buff? when the unit has the buff it will:
A) be able to walk on water
B) walk a little higher so that it looks like the unit is actually walking in the bridge
Or a bridge destructable could be placed for the unit to walk on. A dummy unit bridge can exist which is interacted with like all units.
 
Level 25
Joined
Oct 18, 2008
Messages
945
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TPoint = (Point(-3288.00, 3035.00))
      • For each (Integer A) from 1 to 200, do (Actions)
        • Loop - Actions
          • Set TPoint = (TPoint offset by (32.00, 0.00))
          • Set MPoint[1] = TPoint
          • Trigger - Run Untitled Trigger 001 <gen> (ignoring conditions)
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • For each (Integer B) from 1 to 200, do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: ((String((Integer A))) + ( /// + (String((Integer B)))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (MPoint[1] is blighted) Equal to True
            • Then - Actions
              • Environment - Set terrain pathing at MPoint[1] of type Walkability to Off
            • Else - Actions
              • Environment - Set terrain pathing at MPoint[1] of type Flyability to Off
              • Environment - Set terrain pathing at MPoint[1] of type Walkability to On
          • Set MPoint[1] = (MPoint[1] offset by (0.00, -32.00))
something as simple as this seems to work. I never knew lol.

VTSrBJD.jpg
 
Last edited:
Level 11
Joined
Jun 2, 2004
Messages
849
The posted trigger leaks constantly, and due to how many times it will be run, it will be an actual problem.

Each generated point variable will be left in memory and start slowing down the game considerably. This can be solved by destroying the point with a simple custom script after it's done being used. (the script being "call RemoveLocation(udg_variablename)")
 
Status
Not open for further replies.
Top