Skip to content

Latest commit

 

History

History
115 lines (78 loc) · 5.96 KB

scripting.md

File metadata and controls

115 lines (78 loc) · 5.96 KB

Scripting in Floptle (Lua)

Game logic in Floptle is written in Lua. A script is a .lua file in your project's scripts/ folder. Attach it to a node and it runs every frame while the game is playing. Scripts hot-reload — save the file and the running game picks it up immediately.

This page teaches; lua-api.md lists. The guide is in chapters: read one end to end and you have that part of the engine, or dip into one when you need it. The reference has every call the engine answers, grouped and searchable, for when you already know the name and want the signature.

The same chapters are in the editor — Scripting tab → § Docs → 📖 Guides, with the contents down the left — and every call shows up as autocomplete and hover hints as you type. All three are generated from one table, so they cannot disagree.

Section numbers are stable and are what the engine's own messages cite ("see scripting.md §16"), so they stay put even when a chapter is rearranged around them.

Your first script, the hooks the engine calls, and the globals every script has.

Moving things, finding things, and swapping the whole world out.

Bodies, collisions, and asking the world what is in front of you.

Keyboard, mouse, and the action map.

Models, textures, materials and data files, swapped while the game runs.

The three things that make a scene feel alive, driven from a script.

Vectors, terrain, water, scattered props, decals, and orbital time.

Replication, remote calls, rollback, and voice.

Saved games, timers, HTTP, the player's account, and the settings a game offers.

Leaderboards, lobbies, and the overlay.

The in-engine IDE, the profiler, the gotchas, and why some calls refuse.