Show
condition nameDescription
Code: Select all
"condition":{"type":"condition name",...},
id, x, y, z, min, max, frame, level, inner, invert, code
Show
buildingChecks for a building. If id and/or frame is provided they will checked on that building. The result is true iff there's a building that meets the given id/frame.
Show
buildableChecks if the building given by ID is buildable by user at given x/y.
Show
building nearbyA description will follow.
Show
wireIs true if a wire with given ID is built at given x/y. If the ID is not defined, game will check for any building with wire type.
Show
roadA description will follow.
Show
road decorationChecks whether there's a road decoration (if provided: of the given id) at x, y.
Show
road occupationReserved for future use.
Show
fenceChecks whether there's a fence on the given tile. If frame is provided it will be interpreted as edge index to check.
Show
pipeChecks whether there's a pipe (if provided: of the given id) at x, y.
Show
treeChecks whether there's a tree (if provided, of the given id) at x, y.
Show
andIs only true if all inner conditions are true (or if there are no inner conditions).
Show
orIs true if at least one inner condition is true.
Show
trueIs always true. If you don't provide any condition this one will be the default one
Show
falseIs always false.
Show
countCounts the number of true inner conditions. The number x is hen checked against min + z <= x <= max + z.
Show
nearbyApplies the inner condition (only one) on all 8 neighboring tiles. The number of fulfilled ones x is then checked against min + z <= x <= max + z.
Show
frameChecks whether the frame of the building at x, y fulfilled min + z <= frame <= max + z. Also works for roads but checks for the alignment (0<=alignment<=15) rather than the frame. Specify "code":"f" to check for the actual frame (to detect one-way directions).
Show
landChecks whether the tile at x, y is land (if specified, of the given id).
Show
waterChecks whether the tile at x, y is water (if specified, of the given id).
Show
road usageEvaluates the road usage at the current position and checks whether it's in the provided range. Values range from 0 to 100.
Show
zoneChecks whether the zone - given by id - is set at the current position.
Show
building countCounts how often the building - given by id - is built in the current city.
Show
valueChecks whether the value of an evaluated code is in a certain range. The string provided in "code" is evaluated to a value. The condition is true iff
is fullfilled. Default values for min, max and z are 0. So you usually only provide min and max or z. If you only provide z the condition basically is
Example:
This condition is only fullfilled if date is within first year.
See https://theotown.com/forum/viewtopic.php?f=81&t=5736 and https://theotown.com/forum/viewtopic.php?f=81&t=5959 for more information.
Code: Select all
min + z <= code <= max + z
Code: Select all
z = code
Code: Select all
"condition":{"type":"value","code":"day/360"}
See https://theotown.com/forum/viewtopic.php?f=81&t=5736 and https://theotown.com/forum/viewtopic.php?f=81&t=5959 for more information.
Show
burningReturns true if the building at the current position is burning.
Show
upgradeChecks whether the upgrade - given by id - is applied to the building at the current position.
Show
dateIs true if the current game day is the given number. Possible values are "z":0-359. min and max can be used to specify a range. See here for more information.
Show
sandboxIs true if the current city is in sandbox mode.
Show
groundChecks whether there's ground of the given id at the current position.
Show
map sizeA description will follow.
Show
animation runningTrue if animation of the building's animation slot specified by attribute level is running, false otherwhise.
Show
performanceEvaluates the performance of the building at position x, y and checks it against =z or >=min and <=max. Values range from 0 to 100.
Show
rnd
Can be used to make random numbers
Code: Select all
"condition":{
// A number in [0,9] is generated and checked to be >= min and <= max
"type":"rnd","min":0,"max":3,"frame":10
}