Skip to content
Gardenly3D
User Guide
User Guide

How Do I… Tab

The How do I… tab is a built-in reference panel inside the Automation panel. Browse every GardenlyScript API method, read a Lua syntax guide, and paste code examples directly into your script.

The How do I… tab is the third tab in the Automation panel (after My Automations and Editor). It provides:

  • API Reference — a complete, searchable list of all GardenlyScript namespaces and methods
  • Lua Guide — a quick-reference for Lua 5.5 syntax

You can use the tab while the IDE is open — it is designed to be consulted during active coding without switching context.

1

Browse and search the API reference

The API Reference section lists every GardenlyScript namespace (find, place, edit, measure, layers, selection, costs, terrain, etc.) and all their methods.

Each method entry shows:

  • Method signature — name, parameter names and types
  • Parameter table — each parameter with its type, whether it is required or optional, any allowed range or constraint, and its default value
  • Return type — what the method returns
  • Error table — possible errors thrown and when they occur
  • Code example — a working snippet you can paste into your script

Use the search bar at the top to filter by namespace, method name, or description keyword. Type find to see all find methods, place.plant to jump straight to the plant-placement method, etc.

Each method is also annotated with a budget badge (read, mutation, creation, or none) so you know which operations count against the run limits.

2

Use the Lua quick-reference guide

The Lua Guide section below the API Reference is a compact Lua 5.5 cheatsheet for designers who are new to the language.

It is organised into collapsible sections:

  • Variables and types — nil, boolean, number, string, table
  • Truthiness — only nil and false are falsy; 0 and "" are truthy
  • Strings — concatenation (..), string.format, string.len, string.sub
  • Type conversions — tostring(), tonumber()
  • Tables — arrays and dictionaries, table.insert, table.remove, #
  • Loops — numeric for, ipairs, pairs, while, repeat … until
  • Conditionals — if / elseif / else / end
  • Functions — multiple return values, closures
  • Error handling — pcall for safe calls that may error
  • Math — math.floor, math.ceil, math.random, math.sqrt, etc.
  • Nil safety — x = x or default pattern, optional chaining with and
  • Scope — local vs. global variables

Each section includes short code examples. Click a section header to expand or collapse it.

TIP

If you come from JavaScript or Python, the biggest Lua gotchas are: arrays start at index 1, != is written ~=, and string concatenation uses .. not +.

3

Expand a namespace to browse its methods

All namespaces (such as find, place, edit, measure, layers, selection, costs, and terrain) are expanded by default. Click a namespace header to collapse or expand it. Each method row shows the method signature and return type inline so you can scan available methods at a glance without opening individual entries.

4

Read a method's full detail

Click any method row to expand its detail panel. The panel shows the full parameter table — each parameter with its type, whether it is required or optional, allowed range or constraint, and default value. Below the parameters you will find the return type, a return detail description explaining the shape and fields of the returned value, and a throws table listing every error the method may raise and the condition that triggers it.

5

Insert a code example into your script

Each expanded method detail includes a working code example. Click the Insert into script button on the example to paste it at your current cursor position in the Code editor — no copy-and-paste required. Switch to the Editor tab to see the inserted snippet and continue editing from there.

TIP

Position your cursor at the correct insertion point in the Code editor before switching to the Help tab. The Insert button always pastes at the last known cursor position.

6

Check budget badges and stability labels

Each method displays a budget badge indicating its operation category: read (counts against read limits), mutation (modifies existing entities), creation (adds new entities), or none (free operation). Methods also carry a stability label — stable, beta, alpha, experimental, or deprecated — so you know what to rely on for production automations. Methods gated to a higher subscription tier are greyed out with a tier label.

7

Use the Lua quick-reference guide

Click the Lua Guide pill to switch to the Lua 5.5 cheatsheet. The guide is organised into collapsible sections covering variables and types, truthiness rules, strings, type conversions, tables, loops, conditionals, functions, error handling with pcall, math helpers, nil safety patterns, and variable scope. Each section includes short code examples. Click a section header to expand or collapse it.

TIP

If you come from JavaScript or Python, the three most common Lua surprises are: arrays are 1-indexed, inequality is written ~= not !=, and string concatenation uses .. not +.

INFO

The API Reference always reflects the methods your account tier can call — any available method appears here automatically. Methods from a higher tier are shown but greyed out, so you can see what is available if you upgrade.

TIP

Keep the Help tab open in a second browser tab or monitor while writing your first automations. The API Reference is faster to consult than external documentation and always reflects the exact methods your account can call.

Frequently Asked Questions

Where is the full GardenlyScript documentation?

The in-panel API Reference is the complete documentation for the methods available to your scripts — each entry lists the signature, parameters, return shape, errors, budget category, and a runnable example. For the Lua language itself, the Lua Guide sub-section links to the official Lua 5.5 reference manual, which opens in a new browser tab.

Can I search by what a method does rather than knowing its name?

Yes. The search bar matches against both method names and their descriptions. Typing 'measure area' returns measure.area and related methods even if you do not know the exact name. Typing a namespace like 'find' shows every method in that namespace.

Why are some methods greyed out in the API reference?

Methods greyed out with a tier label require a higher subscription tier than your current account. You can read their documentation to plan future automations, but attempting to call them in a script will raise a permission error at runtime.

What does the budget badge on a method mean?

Each script run has operation budgets that prevent runaway automations. A 'read' badge means the call counts against your read-operation limit, 'mutation' against your entity-modification limit, and 'creation' against your entity-creation limit. 'none' means the operation is free and does not count toward any limit.

The Insert button pasted code in the wrong place — how do I fix this?

The Insert button pastes at the last cursor position in the Code editor. To control where the snippet lands, click in the Code editor to place your cursor exactly where you want the code inserted, then switch back to the Help tab and click Insert.