EDIT: Ok, found the error, had a underscore in the message_id that caused it, used to be “set_tile” but simplified the code here with ‘test’ and therefor it worked.
Hey, finally got around to play with Defold a bit, now with Defold 2.0’s alpha, that looks so much better than the old one. But ran into a problem. Probably just a noob error on my part
I’m trying to build a level of blocks:
local function build_level(self)
print("Building level...")
local pos = vmath.vector3()
for y=12,0,-1 do
for x=0,16 do
pos.x = x * blocksize
pos.y = y * blocksize
local block_id = factory.create("#blockfactory", pos)
msg.post(block_id,"test"})
end
end
end
I got everything to work, level rendered just fine, except when I do the msg.post, then I get the following:
ERROR:SCRIPT: /main/level.script:26: Field layer_id not specified in table
Why is this, the error isn’t very helpful, at least not to a beginner like me.
Thanks,
Niklas