Restricting Desctructables To A Certain Terrain Type[Looped]

WindexGlow

New Member
Reaction score
54
Alright, right off the bat; Do not ask why I am making this many destructibles.

Now, onto my question.
I Do not want the created doodads in water. Since the World editor doesn't realize where water is, I put terrain there (village fall trim grass).
Here is the code (this creates trees in water)
Code:
Untitled Trigger 001
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 5000, do (Actions)
            Loop - Actions
                Set L = (Random point in (Playable map area))
                Destructible - Create a Summer Tree Wall at L facing (Random angle) with scale (Random real number between 0.70 and 2.00) and variation (Random integer number between 0 and 7)
                Custom script:   call RemoveLocation(udg_L)

I tried setting a 'If Then Else' checking to see if L (point variable) was on Trim Grass (trim grass = underwater), if it was the trigger wouldn't make the desctructable.
It didn't work.
I than tried;
Code:
Untitled Trigger 001
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 5000, do (Actions)
            Loop - Actions
                Set L = (Random point in (Playable map area))
                Destructible - Create a Summer Tree Wall at L facing (Random angle) with scale (Random real number between 0.70 and 2.00) and variation (Random integer number between 0 and 7)
                Destructible - Pick every destructible within 50.00 of L and do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Terrain type at L) Equal to Village Fall - Short Grass
                            Then - Actions
                                Destructible - Remove (Picked destructible)
                            Else - Actions
                Custom script:   call RemoveLocation(udg_L)

It didn't work either.
Can anyone help me with this problem? +rep if you do.
 
Reaction score
149
I'd try re-arranging trigger so it doesn't create a tree at all if the point L is under water:

Code:
Untitled Trigger 001
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 5000, do (Actions)
            Loop - Actions
                Set tempPoint = (Random point in (Playable map area))
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Terrain type at tempPoint) Equal to Village Fall - Short Grass
                    Then - Actions
                        Do nothing
                    Else - Actions
                        Destructible - Create a Summer Tree Wall at tempPoint facing (Random angle) with scale (Random real number between 0.70 and 2.00) and variation (Random integer number between 0 and 7)
                Custom script:   call RemoveLocation(udg_tempPoint)
 
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