Warcraft 3 frezzes when trigger i activatded

eatbeaver

New Member
Reaction score
7
Infinite loop maybe?



Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by Player 1 (Red) of type Multicellular) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in (Units owned by Player 1 (Red) of type Multicellular)) Greater than or equal to 3
                    Then - Actions
                        Unit - Create 1 Microorganism for Player 1 (Red) at (Position of (Random unit from (Units owned by Player 1 (Red) of type Multicellular))) facing Default building facing degrees
                    Else - Actions
                        Do nothing
 

Expelliarmus

Where to change the sig?
Reaction score
48
Yer, by the first second after you have 3, you will have more than 10,000 Multicellular.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
may it be that you create the units inside the region and trigger the event again?
 

Flow

New Member
Reaction score
4
Yup, the created units enter the region and since you have 3 or more Multicellular (since the trigger was activated in the first place) it'll keep running and running... like Expelliarmus said, except I think he meant to say Microorganisms.

If you tell us exactly what you want for the trigger to do, we could probably help you modify it and make it work.
 

neckface

terrain contest winner! :) dance contest loser. :(
Reaction score
34
Not to mention the leaks! ;)

offtopic: TeeHee Im soo happy that I can finally identify leaks!!! :D
 

darkbeer

Beer is Good!
Reaction score
84
cleaned:

Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
    Actions
        set TempLoc = Center of Res area <gen>
        set TempGroup = Units owned by Player 1 (Red) of type Multicellular
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in TempGroup) Greater than or equal to 3
                    Then - Actions
                        CustomScript: call RemoveLocation(udg-TempLoc)
                        set TempLoc = Position of (Random unit from TempGroup)
[COLOR="Red"]                        Trigger - Turn off (this Trigger)[/COLOR]
                        Unit - Create 1 Microorganism for Player 1 (Red) at TempLoc facing Default building facing degrees
[COLOR="Red"]                        Trigger - Turn on (this Trigger)       [/COLOR]              
                    Else - Actions
        CustomScript: call DestroyGroup(udg_TempGroup)
        CustomScript: call RemoveLocation(udg-TempLoc)

leakless and removed infinite loop
 

eatbeaver

New Member
Reaction score
7
It crashed again....

Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
    Actions
        Set Temppoint = (Center of Reds area <gen>)
        Set tempgroup = (Units owned by Player 1 (Red) of type Multicellular)
        Unit Group - Pick every unit in tempgroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in tempgroup) Greater than or equal to 3
                    Then - Actions
                        Custom script:   call RemoveLocation(udg_Temppoint)
                        Set Temppoint = (Position of (Random unit from tempgroup))
                        Trigger - Turn off (This trigger)
                        Unit - Create 1 Microorganism for Player 1 (Red) at Temppoint facing Default building facing degrees
                        Trigger - Turn on (This trigger)
                    Else - Actions
        Custom script:   call DestroyGroup(udg_tempgroup)
        Custom script:   call RemoveLocation(udg_Temppoint)
 

darkbeer

Beer is Good!
Reaction score
84
try:

Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
    Actions
        Trigger - Turn off (This trigger)
        Set Temppoint = (Center of Reds area <gen>)
        Set tempgroup = (Units owned by Player 1 (Red) of type Multicellular)
        Unit Group - Pick every unit in tempgroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in tempgroup) Greater than or equal to 3
                    Then - Actions
                        Custom script:   call RemoveLocation(udg_Temppoint)
                        Set Temppoint = (Position of (Random unit from tempgroup))
                        Unit - Create 1 Microorganism for Player 1 (Red) at Temppoint facing Default building facing degrees
                    Else - Actions
        Custom script:   call DestroyGroup(udg_tempgroup)
        Custom script:   call RemoveLocation(udg_Temppoint)
         Trigger - Turn on (This trigger)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
hm, the trigger seems right for me, try adding a condition to test if its still running an infinite loop because of the spawns:

Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
       [COLOR="Red"] (unit type of (triggering unit)) not equal to Microorganism[/COLOR] [COLOR="Cyan"](Added by me)[/COLOR]
    Actions
        Set Temppoint = (Center of Reds area <gen>)
        Set tempgroup = (Units owned by Player 1 (Red) of type Multicellular)
        Unit Group - Pick every unit in tempgroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Number of units in tempgroup) Greater than or equal to 3
                    Then - Actions
                        Custom script:   call RemoveLocation(udg_Temppoint)
                        Set Temppoint = (Position of (Random unit from tempgroup))
                        Trigger - Turn off (This trigger)
                        Unit - Create 1 Microorganism for Player 1 (Red) at Temppoint facing Default building facing degrees
                        Trigger - Turn on (This trigger)
                    Else - Actions
        Custom script:   call DestroyGroup(udg_tempgroup)
        Custom script:   call RemoveLocation(udg_Temppoint)
 

eatbeaver

New Member
Reaction score
7
Now it's at least creating Microorgansim but it never stops... It creating 3 at the time.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top