I am having a similar problem when attempting to customize the front facade of my buildings. I need 2 global static variables to serve as flags to customize my front facade. I used the comp(f) functionality to split my single-family home into front, sides, back and roof. Being that I am working with single-family homes, they are often irregular shaped and thus many parts of the house are part of the "front facade." I checked the scope.sx of each comp.index of the front facade and decided, based on that size, which tile element I should place on that comp.index piece of the front. I managed to do this in 3-4 different ways, but the problem with such a simple check is that I often end up with multiple front doors or multiple garage doors on one house, when I only want 1 door and 1 garage door. I initially assumed I'd be able to toggle two bool attributes from false to true when a comp.index side was assigned a door or garage tile (so then, no more comp.index sides would be assigned door or garage tiles). Despite my best efforts, I am unable to find a way to save the "true" flag value to my "doorused" and "garageused" attributes in a global static state, to be used continually as I go from one comp.index side to the next. The CityEngine documentation says that Attributes are a set of static global variables, but this does not seem to be the case, as changes to an attribute made within a case do not hold when the next iteration of the comp.index side is checked. I feel like a check of this nature should be easy to code with the cga rules, as it would be exceptionally useful for designing more detailed and varied buildings. Am I missing something here? Is there a way to do what I am trying to do? I'll also note that I attempted to use a = instead of : for the front facade comp(f) declaration to make it one continuous shape, but that doesn't work for such irregular shaped buildings. I don't want doors or windows wrapped around corners.
... View more