Skip to content
Snippets Groups Projects
Commit b50b700e authored by TenPlus1's avatar TenPlus1
Browse files

Added pad facing direction after use

parent 475360b8
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ https://forum.minetest.net/viewtopic.php?f=9&t=9234 ...@@ -7,6 +7,7 @@ https://forum.minetest.net/viewtopic.php?f=9&t=9234
Change log: Change log:
- 0.8 - Teleport pads now have arrows showing direction player will face after use
- 0.7 - Can now enter descriptions for teleport pads e.g. (0,12,0,Home) - 0.7 - Can now enter descriptions for teleport pads e.g. (0,12,0,Home)
- 0.6 - Tweaked and tidied code, added map_generation_limit's - 0.6 - Tweaked and tidied code, added map_generation_limit's
- 0.5 - Added throwable potions - 0.5 - Added throwable potions
......
--= Teleport Potion mod 0.7 by TenPlus1 --= Teleport Potion mod 0.8 by TenPlus1
-- Create teleport potion or pad, place then right-click to enter coords -- Create teleport potion or pad, place then right-click to enter coords
-- and step onto pad or walk into the blue portal light, portal closes after -- and step onto pad or walk into the blue portal light, portal closes after
...@@ -206,10 +206,10 @@ minetest.register_craft({ ...@@ -206,10 +206,10 @@ minetest.register_craft({
-- teleport pad -- teleport pad
minetest.register_node("teleport_potion:pad", { minetest.register_node("teleport_potion:pad", {
tiles = {"padd.png"}, tiles = {"padd.png", "padd.png^[transformFY"},
drawtype = 'nodebox', drawtype = "nodebox",
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "facedir",
legacy_wallmounted = true, legacy_wallmounted = true,
walkable = true, walkable = true,
sunlight_propagates = true, sunlight_propagates = true,
...@@ -219,12 +219,13 @@ minetest.register_node("teleport_potion:pad", { ...@@ -219,12 +219,13 @@ minetest.register_node("teleport_potion:pad", {
light_source = 5, light_source = 5,
groups = {snappy = 3}, groups = {snappy = 3},
node_box = { node_box = {
type = "wallmounted", type = "fixed",
wall_top = {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5}
wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}, },
wall_side = {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}, selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5}
}, },
selection_box = {type = "wallmounted"},
on_construct = function(pos) on_construct = function(pos)
...@@ -343,6 +344,25 @@ minetest.register_abm({ ...@@ -343,6 +344,25 @@ minetest.register_abm({
gain = 1.0, gain = 1.0,
max_hear_distance = 5 max_hear_distance = 5
}) })
-- rotate player to look in pad placement direction
if objs[n]:is_player() then
local rot = node.param2
local yaw = 0
if rot == 0 or rot == 20 then
yaw = 0 -- north
elseif rot == 2 or rot == 22 then
yaw = 3.14 -- south
elseif rot == 1 or rot == 23 then
yaw = 4.71 -- west
elseif rot == 3 or rot == 21 then
yaw = 1.57 -- east
end
objs[n]:set_look_yaw(yaw)
end
end end
end end
end end
......
textures/padd.png

225 B | W: | H:

textures/padd.png

201 B | W: | H:

textures/padd.png
textures/padd.png
textures/padd.png
textures/padd.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment