The documentation and examples for editor scripts, especially all the stringly-typed stuff, is pretty sparse. I’m muddling through a script right now to build convex hull collision objects for tilemaps, and I’ve run into these errors that seem to contradict the docs:
ERROR:EXT: Create collision hulls's "run" in /main/levels/level_tiles.editor_script failed: /main/levels/level_tiles.editor_script:178 EmbeddedGOInstanceNode does not define "components"
ERROR:EXT: Create collision hulls's "run" in /main/levels/level_tiles.editor_script failed: /main/levels/level_tiles.editor_script:178 ReferencedGOInstanceNode does not define "components"
Initially I thought maybe it was due to using an embedded GO, so I extracted it, but as you can see both types of game object yield the same error. This is when trying to execute code based on Editor scripts, specifically this example:
editor.tx.add("/npc.go", "components", {
type = "collisionobject",
id = "collision",
shapes = {
{
type = "shape-type-box",
dimensions = {32, 32, 32}
}
}
}),
The line that’s failing is:
editor.tx.add(go_node, "components", {
type = "collisionobject",
id = component_id,
collision_shape = file_path,
})
go_node
is an entry in opts.selection
.
Has the mechanism for adding a “collisionobject” component to a game object node changed from how it’s documented?
Thanks!