Craft The World

Craft The World

Customize your dwarf sandbox!
Create and upload your own mods, add new items and worlds to Craft The World. Explore new ways to survive, or create new challenges for yourself and others.
??? 2 30 Dec, 2023 @ 3:05pm
LUA scripting and/or Behaviors Documentation?
I've been wanting to make a more mechanically-impressive mod for a while now, but I keep running into the problem that there's no examples, documentation, or, well, ANY information about the inner workings of the LUA/scripting API, nor the Behaviors system, which the game supports through XML files.

What's worse is that the editor that comes with the game itself has no menus for editing creature data, scripts, or any other such features, and scripts/event callbacks and behavior settings aren't shown as an editable property on the few items/blocks/creatures that actually use them, such as the cannons in the Heart of Evil DLC (which extensively use different behaviors to work), or the rat-spawning-from-destroyed-furniture mechanic in the Lonely Mountain DLC (which uses a LUA script to spawn them, fired from an event when a special helper item is dropped).

Maybe I'm just blind, but I've looked everywhere and there's no explanation as to how you're supposed to use these tools in a mod beyond the few usecases in the base game, despite how powerful/useful they seem, from making custom AIs to more advanced blocks/buildables, maybe even entirely new game mechanics...

So, does anyone know where more information on how to work with them can be found, like event callbacks and provided helper functions for the LUA API, or a lookup for what behaviors are available/what they do, and how to apply them to entities?
< >
Showing 1-2 of 2 comments
steeamdreck 31 30 Dec, 2023 @ 3:58pm 
If you found somting, please tell me. But the rat drop is very usefull, I used it with other game meachanik for my imp mod.
??? 2 26 Apr, 2024 @ 2:57pm 
Originally posted by Walter253:
LUA isn't a language specific to CTW. https://www.lua.org/start.html
That isn't quite what I meant.
I know well enough that LUA is a much greater language than just what Craft the World does with it, and I know how to use the language overall. The problem here is that there's zero documentation of the unique functions that CtW implements that would allow LUA scripts to modify the game's state, like methods that would let me read/write blocks to the world, create custom enemy AIs and functionality, machines that could have new interactions with items beyond default built-in ones, not even any info on event callbacks that the game engine might give that could trigger custom LUA functions on the scripting end of things... it's severely lacking in that front.
< >
Showing 1-2 of 2 comments
Per page: 1530 50