• 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]enter-exit houses

Status
Not open for further replies.
Level 9
Joined
Jul 20, 2009
Messages
427
I made this trigger that automatically orders citizens to enter and exit houses..I would like to ask how can i Improve the trigger.Please check for leaks,and also if ever there's a better way to do this please post the triggers..In my map there would be lots of citizens so I want to make this trigger lagless and leakless as possible..thanks
  • enter house day rate
    • Events
      • Time - entertimer expires
    • Conditions
    • Actions
      • Set Temp_Group = (Random 1 units from (Units of type Citizen kid1))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to House) or (((Unit-type of (Matching unit)) Equal to House - Level 2) or (((Unit-type of (Matching unit)) Equal to House - Level 3) or (((Unit-type of (Match
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Board (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type Citizen kid2))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to House) or (((Unit-type of (Matching unit)) Equal to House - Level 2) or (((Unit-type of (Matching unit)) Equal to House - Level 3) or (((Unit-type of (Match
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Board (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type Citizen man1))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to House) or (((Unit-type of (Matching unit)) Equal to House - Level 2) or (((Unit-type of (Matching unit)) Equal to House - Level 3) or (((Unit-type of (Match
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Board (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type Citizen man2))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to House) or (((Unit-type of (Matching unit)) Equal to House - Level 2) or (((Unit-type of (Matching unit)) Equal to House - Level 3) or (((Unit-type of (Match
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Board (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type Citizen woman))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to House) or (((Unit-type of (Matching unit)) Equal to House - Level 2) or (((Unit-type of (Matching unit)) Equal to House - Level 3) or (((Unit-type of (Match
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Board (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
  • exit house
    • Events
      • Time - exitimer expires
    • Conditions
    • Actions
      • Set Temp_Group = (Random 3 units from (Units of type House))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Citizen kid1) or (((Unit-type of (Matching unit)) Equal to Citizen kid2) or (((Unit-type of (Matching unit)) Equal to Citizen man1) or (((Unit-type of (Matc
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Unload (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type House2))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Citizen kid1) or (((Unit-type of (Matching unit)) Equal to Citizen kid2) or (((Unit-type of (Matching unit)) Equal to Citizen man1) or (((Unit-type of (Matc
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Unload (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type House3))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Citizen kid1) or (((Unit-type of (Matching unit)) Equal to Citizen kid2) or (((Unit-type of (Matching unit)) Equal to Citizen man1) or (((Unit-type of (Matc
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Unload (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type House - Level 2))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Citizen kid1) or (((Unit-type of (Matching unit)) Equal to Citizen kid2) or (((Unit-type of (Matching unit)) Equal to Citizen man1) or (((Unit-type of (Matc
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Unload (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
      • Set Temp_Group = (Random 1 units from (Units of type House - Level 3))
      • Set Temp_Group2 = (Random 1 units from (Units owned by Player 1 (Red) matching (((Unit-type of (Matching unit)) Equal to Citizen kid1) or (((Unit-type of (Matching unit)) Equal to Citizen kid2) or (((Unit-type of (Matching unit)) Equal to Citizen man1) or (((Unit-type of (Matc
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Unload (Random unit from Temp_Group2)
      • Custom script: call DestroyGroup (udg_Temp_Group)
      • Custom script: call DestroyGroup (udg_Temp_Group2)
 
Status
Not open for further replies.
Top