1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] Kill/ressurect bridge path

Discussion in 'World Editor Help Zone' started by Kamulec, May 15, 2013.

  1. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  2. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    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.
     
  3. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    What do you mean by "invisible platform"?
     
  4. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    its a destructible. its in the bridges / ramps folder.
     
  5. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    If I block the pass, unit's won't be able to use ramps as well, will they?
     
  6. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    if u use pathing blockers then no. it blocks the path for them to wlk.
     
  7. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I cannot imagine it. Where should I place these pathblockers to block the bridge only?
     
  8. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    were the ramp meets the bridge.
     
  9. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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)


    Code (vJASS):
    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: May 16, 2013
  10. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
  11. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
  12. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    well ur problem is that they arent units. Make them units then change the model to a bridge and pause both of the units. Then hide one and unhide the other one. one u place pathing blockers the other u dont.
     
  13. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    May you tell me where my code/trigger is corrupted (why the bridge is not created by CreateDestructable)?
     
  14. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    ur jass isnt working because there is no initialization
    change this
    Code (vJASS):
    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

    Code (vJASS):
    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.
     
  15. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Code (vJASS):
    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?
     
  16. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    are u using the right variation ? is this script running b4 the x and y values are set ? if it is that can be a problem.
     
  17. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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
    Code (vJASS):
    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
     
  18. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    It will not work like that then. u will need to change the jass to this.

    Code (vJASS):
    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.
     
  19. Kamulec

    Kamulec

    Joined:
    May 15, 2008
    Messages:
    104
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I have modified a bit so it become compilable. Still does not work anyway.

    Code (vJASS):
    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.
     
  20. deathismyfriend

    deathismyfriend

    Joined:
    Oct 24, 2012
    Messages:
    6,529
    Resources:
    14
    Spells:
    12
    Tutorials:
    2
    Resources:
    14
    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)