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

[General] Kill/ressurect bridge path

Status
Not open for further replies.
Level 5
Joined
May 15, 2008
Messages
105
A: ground ------------ bridge ---------- ground
B: ground - ramp - shallow water - ramp - ground

What I want to do:
Triggers (each of them able to be used several times) that change from A to B and back.

Solutions that doesn't work:
a) "killing the bridge" gives B without paths
b) "removing the bridge" gives B adds paths also where it shouldn't and doesn't let to resurrect bridge

I would appreciate your help.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
u might be able to make a unit with the model of the bridge and a unit of a model with the dead bridge. place them on top of each other. when bridge is alive show the one unit. when its dead show the other. now to get this to work u can place an invisible platform when bridge is alive. when its dead place pathing blockers so a unit cant go onto the bridge.
 
Level 5
Joined
May 15, 2008
Messages
105
Problematic.
I have tried another way: add path blockers + remove bridge. That works but I cannot recreate the bridge.

  • Initialize
    • Map initialization
    • Action
      • Set OsgiliathBridge = Bridge 2378 <gen>
      • Set OsgiliathBridgeXY = (Position of OsgiliathBridge)
      • Set OsgiliathBridgeX = (X of OsgiliathBridgeXY)
      • Set OsgiliathBridgeY = (Y of OsgiliathBridgeXY)
      • Custom script: set udg_OsgiliathBridgeId = GetHandleId(udg_OsgiliathBridge)
JASS:
function Trig_Bridge_Osgiliath takes nothing returns nothing
  local destructable bridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
  call CreateTextTagLocBJ( I2S(udg_OsgiliathBridgeId), udg_OsgiliathBridgeXY, 300, 10, 100.00, 100.00, 100.00, 0)
endfunction

function InitTrig_Bridge takes nothing returns nothing
    set gg_trg_Bridge = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Bridge, function Trig_Bridge_Osgiliath )
endfunction

I have tested usage of
  • Trigger - Run Bridge <gen> (checking conditions)
in Initialize trigger and in another trigger, after the bridge was removed. In both cases only the text was displayed (I use CreateTextTagLocBJ for tests only).

I can program but I don't know JASS and I have no idea what's wrong.
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
ur jass isnt working because there is no initialization
change this
JASS:
function Trig_Bridge_Osgiliath takes nothing returns nothing
  local destructable bridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
  call CreateTextTagLocBJ( I2S(udg_OsgiliathBridgeId), udg_OsgiliathBridgeXY, 300, 10, 100.00, 100.00, 100.00, 0)
endfunction

function InitTrig_Bridge takes nothing returns nothing
    set gg_trg_Bridge = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Bridge, function Trig_Bridge_Osgiliath )
endfunction

to this

JASS:
function InitTrig_Bridge takes nothing returns nothing
  local destructable bridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
  call CreateTextTagLocBJ( I2S(udg_OsgiliathBridgeId), udg_OsgiliathBridgeXY, 300, 10, 100.00, 100.00, 100.00, 0)
endfunction

ur top trigger should be working.
 
Level 5
Joined
May 15, 2008
Messages
105
JASS:
function InitTrig_Bridge takes nothing returns nothing
   set udg_OsgiliathBridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
endfunction
Qustion: why the bridge doesn't appear?
 
Level 5
Joined
May 15, 2008
Messages
105
Trigger Initialize
  • Initialize
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set OsgiliathBridge = Long wooden bridge (Horizontal) 2378 <gen>
    • Set OsgiliathBridgeXY = (Position of OsgiliathBridge)
    • Set OsgiliathBridgeX = (X of OsgiliathBridgeXY)
    • Set OsgiliathBridgeY = (Y of OsgiliathBridgeXY)
    • Custom script: set udg_OsgiliathBridgeId = GetHandleId(udg_OsgiliathBridge)
    • Trigger - Run Bridge <gen> (checking conditions)
Function Bridge
JASS:
function InitTrig_Bridge takes nothing returns nothing
    set udg_OsgiliathBridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
endfunction

For this bridge destructible editor displays
Art - Model File - Variations: 1
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
It will not work like that then. u will need to change the jass to this.

JASS:
function Bridge_Actions takes nothing returns nothing
    set udg_OsgiliathBridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
endfunction

//===========================================================================
function InitTrig_Bridge takes nothing returns nothing
    set gg_trg_Bridge = CreateTrigger()
    call TriggerAddAction( Bridge_Actions)
endfunction

The one u have now runs on map init. This one runs only when u call the trigger run action. Also change run trigger checking condition to the run trigger ignoring conditions.
 
Level 5
Joined
May 15, 2008
Messages
105
I have modified a bit so it become compilable. Still does not work anyway.

JASS:
function Bridge_Actions takes nothing returns nothing
     set udg_OsgiliathBridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
endfunction

function InitTrig_Bridge takes nothing returns nothing
     set gg_trg_Bridge = CreateTrigger()
     call TriggerAddAction(gg_trg_Bridge, function Bridge_Actions)
endfunction



I have made some test including this one:
  • Trigger - Run BridgeInit <gen> (ignoring conditions)
  • Custom script: set udg_OsgiliathBridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
  • Game - Display to (Player group(Player 1 (Red))) for 10.00 seconds the text: (Name of OsgiliathBridge)
  • Destructible - Remove OsgiliathBridge
A new bridge is not created, displayed text is (null) but OsgiliathBridge reference is changed so the old bridge is not removed.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Thats because ur removing the new bridge ur creating. Change it to this.

  • Trigger - Run BridgeInit <gen> (ignoring conditions)
  • Destructible - Remove OsgiliathBridge
  • Custom script: set udg_OsgiliathBridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 0.0, 1.0, 1)
  • Game - Display to (Player group(Player 1 (Red))) for 10.00 seconds the text: (Name of OsgiliathBridge)
 
Level 5
Joined
May 15, 2008
Messages
105
JASS:
function Bridge_Actions takes nothing returns nothing
     set udg_OsgiliathBridge = CreateDestructableZ(udg_OsgiliathBridgeId, udg_OsgiliathBridgeX, udg_OsgiliathBridgeY, 300.0, 90.0, 1.0, 1)
endfunction

function InitTrig_Bridge takes nothing returns nothing
     set gg_trg_Bridge = CreateTrigger()
     call TriggerAddAction(gg_trg_Bridge, function Bridge_Actions)
endfunction

  • BridgeInit
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set OsgiliathBridge = Long wooden bridge (Horizontal) 2378 <gen>
    • Set OsgiliathBridgeXY = (Position of OsgiliathBridge)
    • Set OsgiliathBridgeX = (X of OsgiliathBridgeXY)
    • Set OsgiliathBridgeY = (Y of OsgiliathBridgeXY)
    • Custom script: set udg_OsgiliathBridgeId = GetHandleId(udg_OsgiliathBridge)
  • TestBridge
  • Events
    • Jednostka - A unit enters OsgiliathW <gen>
  • Conditions
  • Actions
    • Trigger - Run BridgeInit <gen> (ignoring conditions)
    • Player - Display to (Player group(Player 1 (Red))) for 10.00 seconds the text: (Name of OsgiliathBridge)
    • Trigger - Run Bridge <gen> (ignoring conditions)
    • Player - Display to (Player group(Player 1 (Red))) for 10.00 seconds the text: (Name of OsgiliathBridge)
When I run TestBridge displayed is:
Long wooden bridge
(null)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
I don't think so. U should just switch to using a unit and change the model. U might be able to use one unit. Just kill the unit. Make sure it does not decay. And revive it when u want the bridge to work. U kill the unit when u want the dead bridge to show. It should work if the bridge model has a death and life animation. Otherwise u could just tell the unit to play the different animations then u don't have to kill the unit.

Edit: actually u could try to play the destructibles animations. If the destructible is a doodad u know none of this will work right.
 
Level 5
Joined
May 15, 2008
Messages
105
Kamulec said:
Is it impossible to place destructible in place where one already exists?
deathismyfriend said:
I don't think so.
I don't understand this answer. You think it is possible or not?

I don't need an invisible platform. I can set the bridge to be invisible as well. It doesn't matter in fact. In both cases I have a path over the river so I have to remove it to let units go through the ford and recreate to let them move over the river again.
 
Level 5
Joined
May 15, 2008
Messages
105
Do you mean:
1. I place a paused unit with bridge model and without collision instead of the bridge.
2. I place an invisible platform in the same place.
3. I kill the unit.
4. I resurrect the unit.
?

If yes then invisible platform is all the time in place so units will go through it, not under the bridge, even while unit is killed.
 
Level 5
Joined
May 15, 2008
Messages
105
When bridge is killed u can remove the invisible platforms. Or u can place pathing blockers so units can't go over dead bridge
So I would have to recreate them with the same function that I use to create bridge. And this function doesn't work. You have my thanks for trying anyway.

And the solution is… ROTFL. I have just created the new bridge with
Paths - path texture path (dead) = null
and it worked.

problem SOLVED
 
Status
Not open for further replies.
Top