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

[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 37
Joined
Mar 6, 2006
Messages
9,240
Use the same temp points for every player. You could loop the thing to make the trigger shorter

loop integer x from 1 to 6
--if carInt[x] >= 1 then
----set point
----distance check
----move hero[x]
--endif

And null the variables in the end: Custom script: set udg_TEMPCartPoint[1] = null
 
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