My playground sidebar
Game Basics
Features
Mapmaking
My playground sidebar
Game Basics
Features
Mapmaking
====== SandDef ======
`SandDef` is a byte value (ranging from 1 to 255) that defines the type of sand to be created. Each value corresponds to a specific type of sand with unique properties (e.g., color, density, behavior). A value of 255 indicates “empty” or no sand, but it is not considered null.
`SandDef` is used as an input parameter in various sand creation commands, such as:
* CreateSand * CreateSandInRoundArea * CreateSandInAreaRand * CreateSandInArea
1 ->sandDef // Creates sand of type 1 5 ->sandDef // Creates sand of type 5 255 ->sandDef // Creates "empty" sand (no sand)
====== CreateSand ====== CreateSand(<-x <-y <-sandDef)
Creates sand at the specified coordinates (x, y) using the provided sand definition (`sandDef`).
10 20 1 ->sandDef ->y ->x CreateSand(<-x <-y <-sandDef)
====== CreateSandInRoundArea ====== CreateSandInRoundArea(<-rect <-probability <-sandDef)
Creates sand within a rectangular area defined by a vector (`rect`) containing the bottom-left (x,y) and top-right (x,y) corner coordinates. The `probability` value (between 0 and 1) determines the chance of sand being created at each cell within the area. Sand is created using the specified sand definition (`sandDef`).
{0 0 10 10} ->rect 0.5 ->probability 1 ->sandDef CreateSandInRoundArea(<-rect <-probability <-sandDef)
====== CreateSandInAreaRand ====== CreateSandInAreaRand(<-rect <-probability <-sandDef)
Creates sand within a rectangular area defined by a vector (`rect`) containing the bottom-left (x,y) and top-right (x,y) corner coordinates. The `probability` value (between 0 and 1) determines the chance of sand being created at each cell within the area. The distribution of sand is randomized. Sand is created using the specified sand definition (`sandDef`).
{0 0 10 10} ->rect 0.5 ->probability 1 ->sandDef CreateSandInAreaRand(<-rect <-probability <-sandDef)
====== CreateSandInArea ====== CreateSandInArea(<-rect <-sandDef)
Creates sand within a rectangular area defined by a vector (`rect`) containing the bottom-left (x,y) and top-right (x,y) corner coordinates. Sand is created at every cell within the area using the specified sand definition (`sandDef`).
{0 0 10 10} ->rect 1 ->sandDef CreateSandInArea(<-rect <-sandDef)
====== SetSandColor ====== SetSandColor(<-x <-y <-colors)
Sets the color and glow of the sand at the specified coordinates (x, y) using a vector (`colors`) containing two colors. The first color in the vector sets the base color of the sand, and the second color sets the glow color.
10 20 ->y ->x { {1 0 0 1} {0 1 0 1} } ->colors // Set sand color to red and glow to green SetSandColor(<-x <-y <-colors)
====== GetSandDef ====== GetSandDef(<-sandName) ->sandDef
Retrieves the sand definition (`sandDef`) associated with the given `sandName`.
"SandType1" ->sandName GetSandDef(<-sandName) ->sandDef
====== GetMapSandCount ====== GetMapSandCount(<-sandDef) ->count
Returns the total number of sand particles of the specified type (`sandDef`) present on the map. The input `sandDef` value is clamped between 0 and 255.
1 ->sandDef // Get the count of sand particles with SandDef 1 GetMapSandCount(<-sandDef) ->count
====== CountSandInArea ====== CountSandInArea(<-rect <-sandDef) ->count
Counts the number of sand particles of the specified type (`sandDef`) within a rectangular area defined by a vector (`rect`) containing the bottom-left (x,y) and top-right (x,y) corner coordinates.
{0 0 10 10} ->rect 1 ->sandDef // Count sand particles with SandDef 1 within the area CountSandInArea(<-rect <-sandDef) ->count
====== GetSandInArea ====== GetSandInArea(<-rect <-isRound <-sandDefs <-inclusive) ->sandList
Retrieves a list (`sandList`) of sand particles within a specified area. The area is defined by a vector (`rect`) containing the bottom-left (x,y) and top-right (x,y) corner coordinates. `isRound` (boolean) determines if the area is treated as a rounded rectangle. `sandDefs` is a list of sand definitions to include in the search. `inclusive` (boolean) determines if only the specified `sandDefs` should be included or if all other types should be included.
{0 0 10 10} ->rect false ->isRound {1 2 3} ->sandDefs // List of SandDefs true ->inclusive // Include only sand particles with SandDef 1, 2, or 3 GetSandInArea(<-rect <-isRound <-sandDefs <-inclusive) ->sandList
====== DestroySandInArea ====== DestroySandInArea(<-rect <-isRound <-sandDefs <-inclusive)
Destroys sand particles within a specified area. The area is defined by a vector (`rect`) containing the bottom-left (x,y) and top-right (x,y) corner coordinates. `isRound` (boolean) determines if the area is treated as a rounded rectangle. `sandDefs` is a list of sand definitions to target for destruction. `inclusive` (boolean) determines if only the specified `sandDefs` should be destroyed or if all other types should be destroyed.
{0 0 10 10} ->rect false ->isRound {1 2 3} ->sandDefs // List of SandDefs true ->inclusive // Destroy only sand particles with SandDef 1, 2, or 3 DestroySandInArea(<-rect <-isRound <-sandDefs <-inclusive)
====== DestroySandFromList ====== DestroySandFromList(<-sandList)
Destroys sand particles from a given list (`sandList`). This list could be obtained from commands like `GetSandInArea`.
// Assuming 'sandList' was obtained from a previous command DestroySandFromList(<-sandList)
====== GetSandDefData ====== GetSandDefData(<-sandDef) ->sandDefData
Retrieves data associated with a specific sand definition (`sandDef`). The returned `sandDefData` may contain various properties of the sand type, such as color, density, and behavior.
1 ->sandDef // Get data for sand with SandDef 1 GetSandDefData(<-sandDef) ->sandDefData