Region Group?

KingTobiazZz

New Member
Reaction score
1
but that would only work if the array is full or if I know which index numbers are full,

Trigger:
  • Ground Target Veranderen (100 seconds)
    • Events
      • Timer - Every 100.0 seconds of Game Time
    • Local Variables
      • LocalRandomIntegerForRegionArray = 1 <Integer>
    • Conditions
    • Actions
      • Variable - Set LocalRandomIntegerForRegionArray = (Random integer between 1 and 40)
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • RegionArray[LocalRandomIntegerForRegionArray] == Anywhere
        • Then
          • UI - Display (Combine ((Text(LocalRandomIntegerForRegionArray)), " Is the index of the region found!")) for (All players) to Chat area
          • Variable - Set GroundTarget = RegionArray[LocalRandomIntegerForRegionArray]
        • Else
          • UI - Display "No Region Found!" for (All players) to Chat area
          • Trigger - Run Ground Target Veranderen (100 seconds) (Check Conditions, Wait until it finishes)


the trigger above should pick a random region in a region variable array (max index = 40) and than check if it is a region or if it picked nothing (only index 1-4 are filled) and if it picked nothing it will run again and show me a message untill it has found one and it will show me a message containing the index the founded region has. but the following condition doesnt work as I would want it to be do:(
Trigger:
  • If
    • RegionArray[LocalRandomIntegerForRegionArray] == Anywhere


it accepts everything (for example the variable ''RandomRegion[31]'' even if its an ampty veriable
 
Reaction score
54
You can use a separate array of booleans. Whenever you "fill" one of your region, you set the same index of the boolean array to true. So, your If check is going to be in the boolean array instead.
 
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