Level Editor/Scripting/Reference/Sandbox

From TeamSpec Wiki
Jump to navigation Jump to search

Besides its api and its own variables and functions, a map script may use these names and no others. A script that uses anything else is refused when the map loads, and the map does not load. See Sandbox limits for what that means in practice.

Keywords

and, as, assert, await, break, breakpoint, class, const, continue, elif, else, enum, extends, for, func, if, in, is, match, not, or, pass, return, signal, static, super, var, void, when, while, yield

Types

AABB, Array, Basis, Color, Dictionary, PackedByteArray, PackedFloat32Array, PackedInt32Array, PackedStringArray, PackedVector3Array, Plane, Quaternion, Rect2, String, StringName, Transform3D, Vector2, Vector2i, Vector3, Vector3i, bool, float, int

Global functions

abs, absf, absi, acos, asin, atan, atan2, ceil, ceili, clamp, clampf, clampi, cos, deg_to_rad, ease, exp, floor, floori, fmod, inverse_lerp, is_equal_approx, is_finite, is_zero_approx, len, lerp, lerpf, log, max, maxf, maxi, min, minf, mini, move_toward, posmod, pow, print, push_error, push_warning, rad_to_deg, randf, randf_range, randi, randi_range, range, remap, round, roundi, sign, signf, signi, sin, smoothstep, snapped, snappedf, sqrt, str, tan, typeof, wrapf, wrapi

Constants

INF, NAN, PI, TAU, false, null, self, true

Constants on value types

Written after the type, as in Vector3.ZERO or Color.WHITE.

AXIS_X, AXIS_Y, AXIS_Z, BACK, BLACK, BLUE, DOWN, FORWARD, GREEN, IDENTITY, INF, LEFT, MAX, MIN, MODEL_BOTTOM, MODEL_FRONT, MODEL_LEFT, MODEL_REAR, MODEL_RIGHT, MODEL_TOP, ONE, RED, RIGHT, TRANSPARENT, UP, WHITE, YELLOW, ZERO

Methods on values

Called on a value: an Array, a Dictionary, a String or a vector, as in players.size().

abs, affine_inverse, all, angle_to, any, append, append_array, back, begins_with, bounce, ceil, clamp, clear, contains, count, cross, direction_to, distance_squared_to, distance_to, dot, duplicate, ends_with, erase, filter, find, floor, format, front, get_or_add, has, has_all, insert, inverse, is_empty, is_equal_approx, is_finite, is_normalized, is_zero_approx, join, keys, left, length, length_squared, lerp, limit_length, looking_at, map, max, merge, min, move_toward, normalized, num, orthonormalized, pad_zeros, pick_random, pop_back, pop_front, project, push_back, push_front, reduce, reflect, remove_at, replace, resize, reverse, rfind, right, rotated, rotated_local, round, scaled, sign, size, slerp, slice, snapped, sort, sort_custom, split, strip_edges, substr, to_float, to_int, to_lower, to_upper, translated, translated_local, values

TeamSpec Level Editor
Basics Getting started · Interface · Viewport and camera · Selecting and hiding · Keyboard shortcuts · Settings · Map Config · Troubleshooting
Menus File · Edit · View · Tools · Functional
Panels Scene tree · Inspector · Materials · Props · Snapping · UV editor · Displacement · Terrain
Tools Move, Rotate and Scale · Box · Sphere · Cylinder · Prism · Stairs · Spiral Stairs · Spiral Tower · Arch · Path Brush · Plane · Terrain · Clip · Duplicate · Ruler and Cordon · Edit Vertex and Edge · Edit Face · Loop Cut · Material Brush · Vertex Color Brush · Displacement · Prop Path
Entities Brush · Zone · Group · Mirror Node · Prop · Spawn Point · Supply Pickup · World Boundary · Lights · Water · Sounds · Anchor Platform · Payload Track · Boss Spawn · Map Marker · World Text · Decal · Door · Button · Logic entities · 3D Skybox · Nav Region
Workflows Your first map · Brushes and CSG · Materials and UVs · Lighting and lightmaps · Bots and navigation · Mirrored maps · Outputs and logic · Custom assets · Playtesting · Exporting and publishing · Importing Source maps
Scripting Overview · Server rules · Client HUD · Bots · Teams and spawning · Zones · Pickups · Payload tracks · Map entities · Sandbox limits · Testing · King of the Hill · Team Deathmatch · API reference · What a script may use