System for changing terrain in region only works half.

X.Terror.X

New Member
Reaction score
10
I have createn a simple system in which it suppose to change all the tiles within the region to a specific terrain type.
Somehow the tiles are only changed on a single line (X)
The hight however (Y) does not continue after 1 square.

Code:
Terrain change
    Events
        Time - Elapsed game time is 5.00 seconds
    Conditions
    Actions
        Set TerrainForm = Barrens - Pebbles
        Set TempReg = Region 001 <gen>
        Set Left = (Integer((Min X of TempReg)))
        Set Right = (Integer((Max X of TempReg)))
        Set Top = (Integer((Max Y of TempReg)))
        Set Bot = (Integer((Min Y of TempReg)))
        Set XRegions = ((Right - Left) / 128)
        Set YRegions = ((Top - Bot) / 128)
        Set PointRegion = (Point((Real(Left)), (Real(Top))))
        For each (Integer Y) from 0 to YRegions, do (Actions)
            Loop - Actions
                For each (Integer X) from 0 to XRegions, do (Actions)
                    Loop - Actions
                        Environment - Change terrain type at (PointRegion offset by ((128.00 x (Real(X))), (Real(Y)))) to TerrainForm using variation -1 in an area of size 1 and shape Square

The region i made is 10 by 3 squares. but somehow it only gives 10 by 1 (X/Y)
 

Ryushi

"I will stand, or I will fall. I will not sit."
Reaction score
59
I think you would also need to multiply the Y coordinate by 128 in the action within the loop.
 
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