PilzAdam wrote:1st: Is this compatible with the old system? (i.e. you load an old map and everything is rotated correctly)
2nd: Is this applied to paramtype2 = "facedir" or "wallmounted"? The current API uses facedir as horizontal only, and wallmounted also has vertical rotation.
This isnt a mod, but a source code containing a possible update.socramazibi wrote:Good Mod , works well .
Jordach wrote:This isnt a mod, but a source code containing a possible update.socramazibi wrote:Good Mod , works well .







Likwid H-Craft wrote:Talking about Facedir is there a way do the middle like how mc has it, Cauldron has a hole.
LionsDen wrote:... I am using the latest PilzAdam, sfan5 and BlockMen builds on Windows XP....
hoodedice wrote:LionsDen wrote:... I am using the latest PilzAdam, sfan5 and BlockMen builds on Windows XP....
LionsDen wrote:The command minetest.dir_to_facedir() needs to be updated. It only gives the x and z directions. It can't handle the y direction. I am using the latest PilzAdam, sfan5 and BlockMen builds on Windows XP and was trying to set up a mod that uses this function but couldn't get any y direction. I had to use the pitch and sort of override the facedir for any pitch greater than a certain amount. By the way, I was getting the players facedir if that makes any difference.
hdastwb wrote:I fixed that recently (https://github.com/minetest/minetest/pull/834), but in order to use the 6d version you'll have to pass the optional parameter at the end to enable it (it's disabled by default because it would break an awful lot of placing code). See https://github.com/VanessaE/pipeworks/blob/master/node_breaker.lua#L184 for a usage example.
minetest.dir_to_facedir(user:get_look_dir(), true)LionsDen wrote:I just tried this with the following code snippet:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.dir_to_facedir(user:get_look_dir(), true)
and still only got x and z coordinates. As far as I can tell from the pipeworks example you showed, I have the usage right.
EDIT: Just tried it without the minetest. in front and it crashed so that wasn't my problem.
hdastwb wrote:Assuming that your minetest version is from after about two weeks ago, if you call minetest.dir_to_facedir(dir, true) and the absolute value of dir's y component is greater than both the x and z components' absolute values, then your result should be some number > 3.
dir_to_facedir is implemented in Lua, so one easy way to check if your version is new enough would be to open up builtin/item.lua and scan down to around line 37; if you don't see the is6d parameter in the definition of dir_to_facedir, then your build doesn't support it yet. That said, though, since it's Lua you can change the definitions of those functions without having to rebuild. Another option would be to do what I did in pipeworks and define those functions as local functions at the top of every file that uses them, and then eventually switch to the standardized versions when 0.4.8 comes out.
Users browsing this forum: Bing [Bot] and 6 guests