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

Translation from vJass to JASS

Status
Not open for further replies.
Level 10
Joined
Sep 16, 2016
Messages
269
That system is very restricted, because it is used only in Single Player and does not work when the view is near map's border. I don't know JASS so this is my extents.

  • Press BackBar Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set PSE_BackspaceEnable = False
      • Set PSE_SpaceEnable = False
      • Set PSE_BackspaceX = 100000000.00
      • Set PSE_BackspaceY = 100000000.00
      • Set PSE_SpaceX = 100000000.00
      • Set PSE_SpaceY = 100000000.00
      • Set PSE_LockX = 0.00
      • Set PSE_LockY = 0.00
      • Set PSE_LockMode = 0
      • Set PSE_TownHall = PSE_TOWNHALL
      • Trigger - Add to Press BackBar Event <gen> the event (Time - Every (1.00 / 64.00) seconds of game time)
  • Press BackBar Event
    • Events
    • Conditions
    • Actions
      • Set PSE_x = (Target X of current camera view)
      • Set PSE_y = (Target Y of current camera view)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PSE_LockMode Equal to 1
        • Then - Actions
          • Custom script: set udg_PSE_LockX = GetUnitX( udg_PSE_LockUnit )
          • Custom script: set udg_PSE_LockY = GetUnitY( udg_PSE_LockUnit )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PSE_SpaceEnable Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PSE_x Equal to PSE_SpaceX
              • PSE_y Equal to PSE_SpaceY
            • Then - Actions
              • Trigger - Run Press Spacebar <gen> (ignoring conditions)
            • Else - Actions
              • Set PSE_SpaceX = PSE_x
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PSE_LockMode Greater than 0
                • Then - Actions
                  • Custom script: call PanCameraTo( udg_PSE_LockX, udg_PSE_LockY )
                • Else - Actions
          • Set PSE_SpaceY = (PSE_y + 0.01)
          • Custom script: call SetCameraQuickPosition( udg_PSE_SpaceX, udg_PSE_SpaceY)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PSE_BackspaceEnable Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PSE_x Equal to PSE_BackspaceX
              • PSE_y Equal to PSE_BackspaceY
            • Then - Actions
              • Trigger - Run Press Backspace <gen> (ignoring conditions)
            • Else - Actions
              • Set PSE_BackspaceY = PSE_y
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PSE_LockMode Greater than 0
                • Then - Actions
                  • Custom script: call PanCameraTo( udg_PSE_LockX, udg_PSE_LockY )
                • Else - Actions
          • Set PSE_BackspaceX = (PSE_x + 0.01)
          • Unit - Remove PSE_BackspaceUnit from the game
          • Custom script: set udg_PSE_BackspaceUnit = CreateUnit( GetLocalPlayer(), udg_PSE_TownHall, udg_PSE_BackspaceX, udg_PSE_BackspaceY, 270.0)
          • Custom script: call SetUnitPosition( udg_PSE_BackspaceUnit, udg_PSE_BackspaceX, udg_PSE_BackspaceY)
        • Else - Actions
  • Press Spacebar
    • Events
    • Conditions
    • Actions
      • Set count = (count + 1)
      • Game - Display to (All players) for 5.00 seconds the text: ((String(count)) + line: You pressed Spacebar)
  • Press Backspace
    • Events
    • Conditions
    • Actions
      • Set count = (count + 1)
      • Game - Display to (All players) for 5.00 seconds the text: ((String(count)) + line: You pressed Backspace)
 

Attachments

  • GUI_PressSpacebarEvent.w3x
    15.6 KB · Views: 21
Last edited:
Status
Not open for further replies.
Top