Infintive loop problem

eatbeaver

New Member
Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
        (Unit-type of (Triggering unit)) Not equal to Microorganism
    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)
I only want 1 Microorgansim...
 

Azlier

Old World Ghost
Too bad we don't have a delete post function. I can't figure it out.
 

Jolly chap*

New Member
Why did you put turn off this trigger and turn on this trigger straight away? It would cancel each other out ... maybe that is your problem? Sorry don't have WE open ... again. :(
 

Kazuga

Let the game begin...
Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
        (Unit-type of (Triggering unit)) Not equal to Microorganism
    Actions
        Set Temppoint = (Center of Reds area <gen>)
        Set tempgroup = (Units owned by Player 1 (Red) of type Multicellular)
        [B]Unit Group - Pick every unit in tempgroup and do (Actions)[/B]
            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)
It's because of the unit group loop. It loops through all your unit and for each unit it checks if the unit group contains 3 or more of the unit.
 

Jolly chap*

New Member
Right. Take the If Then Else out of the Unit Group Action and then delete the Unit Group Action. You won't need it anymore.
 

darkbeer

Beer is Good!
in other words:

Code:
Microorganism
    Events
        Unit - A unit enters Reds area <gen>
    Conditions
        (Unit-type of (Triggering unit)) Not equal to Microorganism
    Actions
        Set Temppoint = (Center of Reds area <gen>)
        Set tempgroup = (Units owned by Player 1 (Red) of type Multicellular)
                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
                        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)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    it is all percolating man
  • The Helper The Helper:
    TheHelper.net #1!
  • Wizard Wizard:
    #1
  • The Helper The Helper:
    LOL I love this place
  • Wizard Wizard:
    ;D
  • Wizard Wizard:
    We all do.
  • O Old Mountain Shadow:
    So what is next for thehelper.net? Is there a new set goals yet?
  • The Helper The Helper:
    yes we are going to be expanding
    +1
  • The Helper The Helper:
    help more people
  • The Helper The Helper:
    thank you for asking Old Mountain Shadow hell ya@
  • The Helper The Helper:
    Look at Mountain Shadow in the chat!
  • The Helper The Helper:
    welcome to thehelper.net
  • O Old Mountain Shadow:
    thanks although I'm really kind of regretting this name lol ... is there a way to change it out or will I need to make a new account?
    +1
  • Wizard Wizard:
    One of us can change it for you, I believe. Just send me a PM on what you want.
  • Ghan Ghan:
    Some day we should get the feature where you can change your own name.
  • Wizard Wizard:
    Soon!
  • The Helper The Helper:
    did the mountain shadow get his name changed? personally I think Old Mountain Shadow is a kickass name
  • The Helper The Helper:
    but what do i know lol
  • Wizard Wizard:
    No they haven't had their name changed, it is badass xD
    +1
  • O Old Mountain Shadow:
    Thanks, lol! I haven't quite come up with a good new one yet. I was gonna default to one of my older usernames: Cha Zui = tea drunk in Chinese but then decided it too didn't quite fit right. I'm not asian lol... But I am tall, and old spirited which is sort of where the Old Mountain Shadow came about.
  • O Old Mountain Shadow:
    Either way I appreciate the willingness to help me change it! Should I discover something better I'll swap it, but for now ill stay with what I got.
  • The Helper The Helper:
    If you want a change like they said earlier just let us know
    +1
  • Ghan Ghan:
    Patched and rebooted the server this morning.
  • Ghan Ghan:
  • The Helper The Helper:
    dam pwnkit what a name probably perfectly describes it

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome
    Top