i am trying to reduce the height of the ground in a region using the create carter deformation using this trigger:
loop A should calculate Y and then run loop B which will create the crater on the right point's by increasing X by 1 every time loop B runs and creates a new crater on the new X,Y .. then Y increases one and and it should do the same... the only thing it does now is run the correct X worth and not the Y..
so i only get 1 line of lowered ground instead of a whole square.
Trigger:
- Events
- terrain
- Events
- Time - Elapsed game time is 5.00 seconds
- Conditions
- Actions
- Set Xtimes = 0.00
- Set Ytimes = 0.00
- -------- Set X --------
- Set MinX = (Integer((Min X of Region 000 <gen>)))
- Set MaxX = (Integer((Max X of Region 000 <gen>)))
- -------- Set Y --------
- Set MinY = (Integer((Min Y of Region 000 <gen>)))
- Set MaxY = (Integer((Max Y of Region 000 <gen>)))
- -------- Calculate lenght --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MaxY Less than 0
- Then - Actions
- Set MaxY = (MaxY x -1)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MinY Less than 0
- Then - Actions
- Set MinY = (MinY x -1)
- Else - Actions
- If - Conditions
- Set Lenght = (MaxY + MinY)
- -------- Calculaye width --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MaxX Less than 0
- Then - Actions
- Set MaxX = (MaxX x -1)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- MinX Less than 0
- Then - Actions
- Set MinX = (MinX x -1)
- Else - Actions
- If - Conditions
- Set Width = (MaxX + MinX)
- For each (Integer A) from 1 to Lenght, do (Actions)
- Loop - Actions
- Set Ytimes = (Ytimes + 1.00)
- Set PointY = ((Min Y of Region 000 <gen>) + Ytimes)
- For each (Integer B) from 1 to Width, do (Actions)
- Loop - Actions
- Set Xtimes = (Xtimes + 1.00)
- Set PointX = ((Min X of Region 000 <gen>) + Xtimes)
- Environment - Create a 0.50 second Permanent crater deformation at (Point(PointX, PointY)) with radius 50.00 and depth 10.00
- Loop - Actions
- Loop - Actions
loop A should calculate Y and then run loop B which will create the crater on the right point's by increasing X by 1 every time loop B runs and creates a new crater on the new X,Y .. then Y increases one and and it should do the same... the only thing it does now is run the correct X worth and not the Y..
so i only get 1 line of lowered ground instead of a whole square.