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

[Trigger] "Game time elapsed xx seconds" Use or Avoid ?

Status
Not open for further replies.
Level 5
Joined
Dec 3, 2012
Messages
117
I'm just wondering if it's alright to use the Periodic event "When xx time has passed" like right now, every 2 seconds I have ordered all the wisps to follow their respective players and teleport to that player if the distance between them is too great.

Does this cause leaking/lagging, or is it safe to use ?

Trigger:
  • Cart Follow
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • -------- Red --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KAFRARentaCartInt[1] Greater than or equal to 1
        • Then - Actions
          • Set TEMPCartPoint[1] = (Position of HEROPlayerHero[1])
          • Set TEMPCartPoint[2] = (Position of UNITRentaCart[1])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TEMPCartPoint[1] and TEMPCartPoint[2]) Greater than or equal to 650.00
            • Then - Actions
              • Set TEMPPoint = (Position of HEROPlayerHero[1])
              • Unit - Move UNITRentaCart[1] instantly to TEMPPoint
              • Custom script: call RemoveLocation(udg_TEMPPoint)
            • Else - Actions
              • Unit - Order UNITRentaCart[1] to Follow HEROPlayerHero[1]
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[1])
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[2])
        • Else - Actions
      • -------- Blue --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KAFRARentaCartInt[2] Greater than or equal to 1
        • Then - Actions
          • Set TEMPCartPoint[3] = (Position of HEROPlayerHero[2])
          • Set TEMPCartPoint[4] = (Position of UNITRentaCart[2])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TEMPCartPoint[3] and TEMPCartPoint[4]) Greater than or equal to 650.00
            • Then - Actions
              • Set TEMPPoint = (Position of HEROPlayerHero[2])
              • Unit - Move UNITRentaCart[2] instantly to TEMPPoint
              • Custom script: call RemoveLocation(udg_TEMPPoint)
            • Else - Actions
              • Unit - Order UNITRentaCart[2] to Follow HEROPlayerHero[2]
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[3])
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[4])
        • Else - Actions
      • -------- Teal --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KAFRARentaCartInt[3] Greater than or equal to 1
        • Then - Actions
          • Set TEMPCartPoint[5] = (Position of HEROPlayerHero[3])
          • Set TEMPCartPoint[6] = (Position of UNITRentaCart[3])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TEMPCartPoint[5] and TEMPCartPoint[6]) Greater than or equal to 650.00
            • Then - Actions
              • Set TEMPPoint = (Position of HEROPlayerHero[3])
              • Unit - Move UNITRentaCart[3] instantly to TEMPPoint
              • Custom script: call RemoveLocation(udg_TEMPPoint)
            • Else - Actions
              • Unit - Order UNITRentaCart[3] to Follow HEROPlayerHero[3]
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[5])
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[6])
        • Else - Actions
      • -------- Purple --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KAFRARentaCartInt[4] Greater than or equal to 1
        • Then - Actions
          • Set TEMPCartPoint[7] = (Position of HEROPlayerHero[4])
          • Set TEMPCartPoint[8] = (Position of UNITRentaCart[4])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TEMPCartPoint[7] and TEMPCartPoint[8]) Greater than or equal to 650.00
            • Then - Actions
              • Set TEMPPoint = (Position of HEROPlayerHero[4])
              • Unit - Move UNITRentaCart[4] instantly to TEMPPoint
              • Custom script: call RemoveLocation(udg_TEMPPoint)
            • Else - Actions
              • Unit - Order UNITRentaCart[4] to Follow HEROPlayerHero[4]
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[7])
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[8])
        • Else - Actions
      • -------- Yellow --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KAFRARentaCartInt[5] Greater than or equal to 1
        • Then - Actions
          • Set TEMPCartPoint[9] = (Position of HEROPlayerHero[5])
          • Set TEMPCartPoint[10] = (Position of UNITRentaCart[5])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TEMPCartPoint[9] and TEMPCartPoint[10]) Greater than or equal to 650.00
            • Then - Actions
              • Set TEMPPoint = (Position of HEROPlayerHero[5])
              • Unit - Move UNITRentaCart[5] instantly to TEMPPoint
              • Custom script: call RemoveLocation(udg_TEMPPoint)
            • Else - Actions
              • Unit - Order UNITRentaCart[5] to Follow HEROPlayerHero[5]
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[9])
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[10])
        • Else - Actions
      • -------- Orange --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KAFRARentaCartInt[6] Greater than or equal to 1
        • Then - Actions
          • Set TEMPCartPoint[11] = (Position of HEROPlayerHero[6])
          • Set TEMPCartPoint[12] = (Position of UNITRentaCart[6])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Distance between TEMPCartPoint[11] and TEMPCartPoint[12]) Greater than or equal to 650.00
            • Then - Actions
              • Set TEMPPoint = (Position of HEROPlayerHero[6])
              • Unit - Move UNITRentaCart[6] instantly to TEMPPoint
              • Custom script: call RemoveLocation(udg_TEMPPoint)
            • Else - Actions
              • Unit - Order UNITRentaCart[6] to Follow HEROPlayerHero[6]
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[11])
          • Custom script: call RemoveLocation(udg_TEMPCartPoint[12])
        • Else - Actions
 
Level 5
Joined
Dec 3, 2012
Messages
117
Right now I've got it changed to this:

  • Cart Follow
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • -------- Red --------
      • For each (Integer TEMPInteger) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • KAFRARentaCartInt[TEMPInteger] Greater than or equal to 1
            • Then - Actions
              • Set TEMPCartPoint[TEMPInteger] = (Position of HEROPlayerHero[TEMPInteger])
              • Set TEMPCartPoint[(TEMPInteger + 6)] = (Position of UNITRentaCart[TEMPInteger])
              • -------- Unleakify with Location Variables and finish, tele cart to player if too far away --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between TEMPCartPoint[TEMPInteger] and TEMPCartPoint[(TEMPInteger + 6)]) Greater than or equal to 650.00
                • Then - Actions
                  • Set TEMPPoint = (Position of HEROPlayerHero[TEMPInteger])
                  • Unit - Move UNITRentaCart[TEMPInteger] instantly to TEMPPoint
                  • Custom script: call RemoveLocation(udg_TEMPPoint)
                • Else - Actions
                  • Unit - Order UNITRentaCart[TEMPInteger] to Follow HEROPlayerHero[TEMPInteger]
              • Custom script: call RemoveLocation(udg_TEMPCartPoint[udg_TEMPInteger])
              • Custom script: call RemoveLocation(udg_TEMPCartPoint[udg_TEMPInteger+6])
            • Else - Actions
Only I think the last custom script line does not work, how do I put this?
 
Last edited:
Status
Not open for further replies.
Top