• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Trigger Makes Wc3 Freeze

Status
Not open for further replies.
Level 6
Joined
Aug 19, 2007
Messages
109
I'm working on a castle defense kinda map and 1 trigger i need is a TP one(i cant use waygate coz then the spawned comp units will use it too) and this trigger is making wc3 freeze everytime i test it. Whats wrong with it?(Dont say anything about how inefficient it is lol).:eekani:
  • PR to Entrance
    • Events
      • Unit - A unit enters PR to Entrance <gen>
    • Conditions
    • Actions
      • Set Temp_Point = (Position of Castle Passageways (Gate to Keep) 0189 <gen>)
      • Unit - Create 1 TP Dummy (PR to Entrance) for Player 9 (Gray) at Temp_Point facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
  • PR to Farms
    • Events
      • Unit - A unit enters PR to Farms <gen>
    • Conditions
    • Actions
      • Set Temp_Point = (Position of Castle Passageways (Farms to Keep) 0246 <gen>)
      • Unit - Create 1 TP Dummy (PR to Farms) for Player 9 (Gray) at Temp_Point facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
  • PR to Church
    • Events
      • Unit - A unit enters PR to Church <gen>
    • Conditions
    • Actions
      • Set Temp_Point = (Position of Castle Passageways (Houses to Keep) 0248 <gen>)
      • Unit - Create 1 TP Dummy (PR to Church) for Player 9 (Gray) at Temp_Point facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
  • PR to Keep
    • Events
      • Unit - A unit enters PR to Keep <gen>
    • Conditions
    • Actions
      • Set Temp_Point = (Position of Castle Passageways (Church to Entrance) 0250 <gen>)
      • Unit - Create 1 TP Dummy (PR to Keep) for Player 9 (Gray) at Temp_Point facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
  • All to PR
    • Events
      • Unit - A unit enters Entrance to PR <gen>
      • Unit - A unit enters Farms to PR <gen>
      • Unit - A unit enters Church to PR <gen>
      • Unit - A unit enters Keep to PR <gen>
    • Conditions
    • Actions
      • Set Temp_Point = (Position of (Triggering unit))
      • Unit - Create 1 TP Dummy (All to PR) for Player 9 (Gray) at Temp_Point facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
Note:pR=Passage Room(There are the "PR to _____" regions in it)
  • TP Unit
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Entrance)
          • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Farms)
          • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Keep)
          • (Unit-type of (Dying unit)) Equal to TP Dummy (All to PR)
          • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Church)
    • Actions
      • Set Temp_Point = (Position of (Dying unit))
      • Set Temp_Unit_Group = (Units within 300.00 of Temp_Point)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Entrance)
        • Then - Actions
          • Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
            • Loop - Actions
              • Unit - Move (Picked unit) instantly to (Center of Entrance To <gen>)
          • Custom script: call DestroyGroup (udg_Temp_Unit_Group)
          • Custom script: call RemoveLocation (udg_Temp_Point)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Farms)
            • Then - Actions
              • Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
                • Loop - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Farms To <gen>)
              • Custom script: call DestroyGroup (udg_Temp_Unit_Group)
              • Custom script: call RemoveLocation (udg_Temp_Point)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Church)
                • Then - Actions
                  • Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
                    • Loop - Actions
                      • Unit - Move (Picked unit) instantly to (Center of Church To <gen>)
                  • Custom script: call DestroyGroup (udg_Temp_Unit_Group)
                  • Custom script: call RemoveLocation (udg_Temp_Point)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Dying unit)) Equal to TP Dummy (PR to Keep)
                    • Then - Actions
                      • Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
                        • Loop - Actions
                          • Unit - Move (Picked unit) instantly to (Center of Keep To <gen>)
                      • Custom script: call DestroyGroup (udg_Temp_Unit_Group)
                      • Custom script: call RemoveLocation (udg_Temp_Point)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Unit-type of (Dying unit)) Equal to TP Dummy (All to PR)
                        • Then - Actions
                          • Unit Group - Pick every unit in Temp_Unit_Group and do (Actions)
                            • Loop - Actions
                              • Unit - Move (Picked unit) instantly to (Center of To Passage Room <gen>)
                          • Custom script: call DestroyGroup (udg_Temp_Unit_Group)
                          • Custom script: call RemoveLocation (udg_Temp_Point)
                        • Else - Actions
                          • Do nothing
-So basically if a unit enters a region, i made it create a unit,
e.g."Dummy (PR to Entrance)
and then give that unit an expiration timer.
-When the expiration timer runs out, the unit dies and the last trigger is activated which transports all within 300 range of the dying unit to another region.
-BUT WTF when my hero just enters the region, wc3 freezes. no dummy unit is created... just freeze.
Help please!:cry:
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I think it's because of your first trigger. The trigger activates when a unit enters the region. Then you create a unit in that region (which is I believe similiar to entering the region), which causes another unit to be created, which activates the trigger again, and again, and again. You computer can't take it because there are unlimited amounts of units created all at once.

Make the unit spawn at another place then the place you need to enter to activate the trigger.
 
Level 6
Joined
Aug 19, 2007
Messages
109
OHOHOOHHO! THANK YOU! lol your common sense and logic is outstanding! YES of course! lol, and to think a simple adding of 1 condition could fix it :eekani:. tyvm +rep (if you figure out my other Q lol, thats the major one:grin:). Im thankful.
  • PR to Entrance
    • Events
      • Unit - A unit enters PR to Entrance <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set Temp_Point = (Position of Castle Passageways (Gate to Keep) 0189 <gen>)
      • Unit - Create 1 TP Dummy (PR to Entrance) for Player 9 (Gray) at Temp_Point facing Default building facing degrees
      • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_Temp_Point)
lol unit is a hero equal to true -_- because Dummy (PR to Entrance) aint a hero. it works!
 
Status
Not open for further replies.
Top