ac-minetest / basic_robot

Write mods without server restart while playing. Create custom machines that can build, dig, produce... Create your own games like minesweeper, sokoban,ctf, hide and seek...
26 stars 21 forks source link

two peculiarities #32

Open ksandronline opened 3 years ago

ksandronline commented 3 years ago

Good time.

I really like your basic_robot mod, I hope you will develop it further and support it.

I noticed a few peculiarities.

  1. self. listen_msg () - works only in single-user mode. On the server, I can't use this function.

  2. self.set_properties({ visual = "mesh", mesh = "character.b3d", textures = {"character.png"} })

    • when using different meshes, textures are loaded at different "heights". If mesh = "character. b3d" - then the robot "hangs" on the floor of the block above. And for example mesh = "mobs_spider. b3d", will be on the floor of the block in the ground. And this mesh = "mobs_panda. b3d", the robot works correctly.

You have turned out a very interesting mod. I really hope that it will not be difficult for you to solve these features.

ac-minetest commented 3 years ago

in 'HELP' button you can see use: speaker,msg = self.listen_msg(). That means that self.listen_msg returns 2 strings as output. if there was no new chat message it returns nil. So you can use it like:

if not init then init = true self.listen(1) end -- this will run only 1x and make robot start to listen speaker,msg = self.listen_msg() if msg then say(string.format("message from %s : %s", speaker,msg)) end

ac-minetest commented 3 years ago

self.set_properties just uses minetest built-in function object:set_properties(object property table). So all problems are coming from there.