Another Borked Trigger, involves Event: Time of Day

Effane

Save/Load Code Tutorial
Reaction score
51
Code:
CityFarmWorkersWakeup
    Events
        Game - The in-game time of day becomes Equal to 6.00
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                Set RefPoint = (Random point in FarmerHousing <gen>)
                Unit - Create 1 Farm Worker for Player 12 (Brown) at RefPoint facing (Random angle) degrees
                Unit Group - Add (Last created unit) to TownColorUnitGroup[1]
                Custom script:   call RemoveLocation (udg_RefPoint)
                Set RefPoint = (Center of FarmPath0 <gen>)
                Unit - Order (Last created unit) to Move To (Center of FarmPath0 <gen>)
                Custom script:   call RemoveLocation (udg_RefPoint)
                Wait (Random real number between 1.00 and 4.00) seconds
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                Set RefPoint = (Random point in FarmerHousing <gen>)
                Unit - Create 1 Farm Child for Player 12 (Brown) at RefPoint facing (Random angle) degrees
                Unit Group - Add (Last created unit) to TownColorUnitGroup[1]
                Custom script:   call RemoveLocation (udg_RefPoint)
                Set RefPoint = (Center of FarmPath0 <gen>)
                Unit - Order (Last created unit) to Move To (Center of FarmPath0 <gen>)
                Custom script:   call RemoveLocation (udg_RefPoint)
                Wait (Random real number between 1.00 and 4.00) seconds

Needs to create 12 "Farm Worker" units and send each down a path (Plus adding them to a unitgroup so I can track these things) then create 3 "Farm Child" units and send them off to work as well. Sadly these mildly migrant workers refuse to come out to get ready for work in the morning. The trigger seems to not reliably fire off at all. I created test triggers that had alot of the same features and the generic Time of Day events that just ping the map work solidly. When I toss a create unit into the mix, it fails almost everytime.
 
M

Mister

Guest
Set RefPoint = (Random point in FarmerHousing <gen>)
Custom script: call RemoveLocation (udg_RefPoint)
Set RefPoint = (Center of FarmPath0 <gen>)
Custom script: call RemoveLocation (udg_RefPoint)


You did this 4 times in part 1 and part 2
How about to just make 2 differnt regions? instead of relocate them
That saves space maybe some bytes and is faster to load.

Why the units doesnt goto work, well, that beats me, But at least make a code clear nice and sweet to look at it for hours while scripting.

Also, Just waiting it bugged my map doing things right after they where created.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top