From b3ace8f19746b53f839e7b0bdff0843c83866f64 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 4 Sep 2020 20:49:50 +0200 Subject: Scale inventory image for scaled allfaces nodes (#10225) The inventory image size of the inventory image of nodes with drawtype allfaces (and related) is scaled as well if visual_scale is set (previously, the inventory image size was always the same) --- games/devtest/mods/testnodes/drawtypes.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'games/devtest/mods/testnodes') diff --git a/games/devtest/mods/testnodes/drawtypes.lua b/games/devtest/mods/testnodes/drawtypes.lua index 6bf57fa37..82d862819 100644 --- a/games/devtest/mods/testnodes/drawtypes.lua +++ b/games/devtest/mods/testnodes/drawtypes.lua @@ -514,6 +514,15 @@ local scale = function(subname, desc_double, desc_half) minetest.register_node("testnodes:"..subname.."_half", def) end +scale("allfaces", + S("Double-sized Allfaces Drawtype Test Node"), + S("Half-sized Allfaces Drawtype Test Node")) +scale("allfaces_optional", + S("Double-sized Allfaces Optional Drawtype Test Node"), + S("Half-sized Allfaces Optional Drawtype Test Node")) +scale("allfaces_optional_waving", + S("Double-sized Waving Allfaces Optional Drawtype Test Node"), + S("Half-sized Waving Allfaces Optional Drawtype Test Node")) scale("plantlike", S("Double-sized Plantlike Drawtype Test Node"), S("Half-sized Plantlike Drawtype Test Node")) -- cgit v1.2.3 From 9faeca329039f33f7e2af99eb021cea5b18beceb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 4 Sep 2020 20:50:03 +0200 Subject: Devtest: Extend tooltips of many items and tools (#10312) Also show error message when using tools wrong --- games/devtest/README.md | 2 +- games/devtest/mods/basenodes/init.lua | 23 +++++--- games/devtest/mods/basetools/init.lua | 72 ++++++++++++++++-------- games/devtest/mods/bucket/init.lua | 3 +- games/devtest/mods/chest/init.lua | 3 +- games/devtest/mods/chest_of_everything/init.lua | 3 +- games/devtest/mods/experimental/items.lua | 6 +- games/devtest/mods/soundstuff/init.lua | 7 ++- games/devtest/mods/testentities/armor.lua | 2 +- games/devtest/mods/testnodes/light.lua | 6 +- games/devtest/mods/testpathfinder/init.lua | 6 +- games/devtest/mods/testtools/init.lua | 74 +++++++++++++++++++------ 12 files changed, 147 insertions(+), 60 deletions(-) (limited to 'games/devtest/mods/testnodes') diff --git a/games/devtest/README.md b/games/devtest/README.md index a7e93cf11..8b71da625 100644 --- a/games/devtest/README.md +++ b/games/devtest/README.md @@ -25,7 +25,7 @@ Basically, just create a world and start. A few important things to note: * Check out the game settings and server commands for additional tests and features * Creative Mode does nothing (apart from default engine behavior) -Confused by a certain node or item? Check out for inline code comments. +Confused by a certain node or item? Check out for inline code comments. The usages of most tools are explained in their tooltips. ### Example tests diff --git a/games/devtest/mods/basenodes/init.lua b/games/devtest/mods/basenodes/init.lua index 8156c4bec..7ffbadbea 100644 --- a/games/devtest/mods/basenodes/init.lua +++ b/games/devtest/mods/basenodes/init.lua @@ -124,7 +124,8 @@ minetest.register_node("basenodes:pine_needles", { }) minetest.register_node("basenodes:water_source", { - description = "Water Source", + description = "Water Source".."\n".. + "Drowning damage: 1", drawtype = "liquid", tiles = {"default_water.png"}, special_tiles = { @@ -148,7 +149,8 @@ minetest.register_node("basenodes:water_source", { }) minetest.register_node("basenodes:water_flowing", { - description = "Flowing Water", + description = "Flowing Water".."\n".. + "Drowning damage: 1", drawtype = "flowingliquid", tiles = {"default_water_flowing.png"}, special_tiles = { @@ -173,7 +175,8 @@ minetest.register_node("basenodes:water_flowing", { }) minetest.register_node("basenodes:river_water_source", { - description = "River Water Source", + description = "River Water Source".."\n".. + "Drowning damage: 1", drawtype = "liquid", tiles = { "default_river_water.png" }, special_tiles = { @@ -199,7 +202,8 @@ minetest.register_node("basenodes:river_water_source", { }) minetest.register_node("basenodes:river_water_flowing", { - description = "Flowing River Water", + description = "Flowing River Water".."\n".. + "Drowning damage: 1", drawtype = "flowingliquid", tiles = {"default_river_water_flowing.png"}, special_tiles = { @@ -226,7 +230,9 @@ minetest.register_node("basenodes:river_water_flowing", { }) minetest.register_node("basenodes:lava_flowing", { - description = "Flowing Lava", + description = "Flowing Lava".."\n".. + "4 damage per second".."\n".. + "Drowning damage: 1", drawtype = "flowingliquid", tiles = {"default_lava_flowing.png"}, special_tiles = { @@ -251,7 +257,9 @@ minetest.register_node("basenodes:lava_flowing", { }) minetest.register_node("basenodes:lava_source", { - description = "Lava Source", + description = "Lava Source".."\n".. + "4 damage per second".."\n".. + "Drowning damage: 1", drawtype = "liquid", tiles = { "default_lava.png" }, special_tiles = { @@ -290,7 +298,8 @@ minetest.register_node("basenodes:mossycobble", { }) minetest.register_node("basenodes:apple", { - description = "Apple", + description = "Apple".."\n".. + "Food (+2)", drawtype = "plantlike", tiles ={"default_apple.png"}, inventory_image = "default_apple.png", diff --git a/games/devtest/mods/basetools/init.lua b/games/devtest/mods/basetools/init.lua index c5b4cd76c..e4a36ca46 100644 --- a/games/devtest/mods/basetools/init.lua +++ b/games/devtest/mods/basetools/init.lua @@ -42,7 +42,8 @@ minetest.register_item(":", { -- Mese Pickaxe: special tool that digs "everything" instantly minetest.register_tool("basetools:pick_mese", { - description = "Mese Pickaxe", + description = "Mese Pickaxe".."\n".. + "Digs diggable nodes instantly", inventory_image = "basetools_mesepick.png", tool_capabilities = { full_punch_interval = 1.0, @@ -65,7 +66,9 @@ minetest.register_tool("basetools:pick_mese", { -- This should break after only 1 use minetest.register_tool("basetools:pick_dirt", { - description = "Dirt Pickaxe", + description = "Dirt Pickaxe".."\n".. + "Digs cracky=3".."\n".. + "1 use only", inventory_image = "basetools_dirtpick.png", tool_capabilities = { max_drop_level=0, @@ -76,7 +79,8 @@ minetest.register_tool("basetools:pick_dirt", { }) minetest.register_tool("basetools:pick_wood", { - description = "Wooden Pickaxe", + description = "Wooden Pickaxe".."\n".. + "Digs cracky=3", inventory_image = "basetools_woodpick.png", tool_capabilities = { max_drop_level=0, @@ -86,7 +90,8 @@ minetest.register_tool("basetools:pick_wood", { }, }) minetest.register_tool("basetools:pick_stone", { - description = "Stone Pickaxe", + description = "Stone Pickaxe".."\n".. + "Digs cracky=2..3", inventory_image = "basetools_stonepick.png", tool_capabilities = { max_drop_level=0, @@ -96,7 +101,8 @@ minetest.register_tool("basetools:pick_stone", { }, }) minetest.register_tool("basetools:pick_steel", { - description = "Steel Pickaxe", + description = "Steel Pickaxe".."\n".. + "Digs cracky=1..3", inventory_image = "basetools_steelpick.png", tool_capabilities = { max_drop_level=1, @@ -106,7 +112,9 @@ minetest.register_tool("basetools:pick_steel", { }, }) minetest.register_tool("basetools:pick_steel_l1", { - description = "Steel Pickaxe Level 1", + description = "Steel Pickaxe Level 1".."\n".. + "Digs cracky=1..3".."\n".. + "maxlevel=1", inventory_image = "basetools_steelpick_l1.png", tool_capabilities = { max_drop_level=1, @@ -116,7 +124,9 @@ minetest.register_tool("basetools:pick_steel_l1", { }, }) minetest.register_tool("basetools:pick_steel_l2", { - description = "Steel Pickaxe Level 2", + description = "Steel Pickaxe Level 2".."\n".. + "Digs cracky=1..3".."\n".. + "maxlevel=2", inventory_image = "basetools_steelpick_l2.png", tool_capabilities = { max_drop_level=1, @@ -131,7 +141,8 @@ minetest.register_tool("basetools:pick_steel_l2", { -- minetest.register_tool("basetools:shovel_wood", { - description = "Wooden Shovel", + description = "Wooden Shovel".."\n".. + "Digs crumbly=3", inventory_image = "basetools_woodshovel.png", tool_capabilities = { max_drop_level=0, @@ -141,7 +152,8 @@ minetest.register_tool("basetools:shovel_wood", { }, }) minetest.register_tool("basetools:shovel_stone", { - description = "Stone Shovel", + description = "Stone Shovel".."\n".. + "Digs crumbly=2..3", inventory_image = "basetools_stoneshovel.png", tool_capabilities = { max_drop_level=0, @@ -151,7 +163,8 @@ minetest.register_tool("basetools:shovel_stone", { }, }) minetest.register_tool("basetools:shovel_steel", { - description = "Steel Shovel", + description = "Steel Shovel".."\n".. + "Digs crumbly=1..3", inventory_image = "basetools_steelshovel.png", tool_capabilities = { max_drop_level=1, @@ -166,7 +179,8 @@ minetest.register_tool("basetools:shovel_steel", { -- minetest.register_tool("basetools:axe_wood", { - description = "Wooden Axe", + description = "Wooden Axe".."\n".. + "Digs choppy=3", inventory_image = "basetools_woodaxe.png", tool_capabilities = { max_drop_level=0, @@ -176,7 +190,8 @@ minetest.register_tool("basetools:axe_wood", { }, }) minetest.register_tool("basetools:axe_stone", { - description = "Stone Axe", + description = "Stone Axe".."\n".. + "Digs choppy=2..3", inventory_image = "basetools_stoneaxe.png", tool_capabilities = { max_drop_level=0, @@ -186,7 +201,8 @@ minetest.register_tool("basetools:axe_stone", { }, }) minetest.register_tool("basetools:axe_steel", { - description = "Steel Axe", + description = "Steel Axe".."\n".. + "Digs choppy=1..3", inventory_image = "basetools_steelaxe.png", tool_capabilities = { max_drop_level=1, @@ -201,7 +217,8 @@ minetest.register_tool("basetools:axe_steel", { -- minetest.register_tool("basetools:shears_wood", { - description = "Wooden Shears", + description = "Wooden Shears".."\n".. + "Digs snappy=3", inventory_image = "basetools_woodshears.png", tool_capabilities = { max_drop_level=0, @@ -211,7 +228,8 @@ minetest.register_tool("basetools:shears_wood", { }, }) minetest.register_tool("basetools:shears_stone", { - description = "Stone Shears", + description = "Stone Shears".."\n".. + "Digs snappy=2..3", inventory_image = "basetools_stoneshears.png", tool_capabilities = { max_drop_level=0, @@ -221,7 +239,8 @@ minetest.register_tool("basetools:shears_stone", { }, }) minetest.register_tool("basetools:shears_steel", { - description = "Steel Shears", + description = "Steel Shears".."\n".. + "Digs snappy=1..3", inventory_image = "basetools_steelshears.png", tool_capabilities = { max_drop_level=1, @@ -236,7 +255,8 @@ minetest.register_tool("basetools:shears_steel", { -- minetest.register_tool("basetools:sword_wood", { - description = "Wooden Sword", + description = "Wooden Sword".."\n".. + "Damage: fleshy=2", inventory_image = "basetools_woodsword.png", tool_capabilities = { full_punch_interval = 1.0, @@ -244,7 +264,8 @@ minetest.register_tool("basetools:sword_wood", { } }) minetest.register_tool("basetools:sword_stone", { - description = "Stone Sword", + description = "Stone Sword".."\n".. + "Damage: fleshy=4", inventory_image = "basetools_stonesword.png", tool_capabilities = { full_punch_interval = 1.0, @@ -253,7 +274,8 @@ minetest.register_tool("basetools:sword_stone", { } }) minetest.register_tool("basetools:sword_steel", { - description = "Steel Sword", + description = "Steel Sword".."\n".. + "Damage: fleshy=6", inventory_image = "basetools_steelsword.png", tool_capabilities = { full_punch_interval = 1.0, @@ -264,7 +286,8 @@ minetest.register_tool("basetools:sword_steel", { -- Fire/Ice sword: Deal damage to non-fleshy damage groups minetest.register_tool("basetools:sword_fire", { - description = "Fire Sword", + description = "Fire Sword".."\n".. + "Damage: icy=6", inventory_image = "basetools_firesword.png", tool_capabilities = { full_punch_interval = 1.0, @@ -273,12 +296,13 @@ minetest.register_tool("basetools:sword_fire", { } }) minetest.register_tool("basetools:sword_ice", { - description = "Ice Sword", + description = "Ice Sword".."\n".. + "Damage: fiery=6", inventory_image = "basetools_icesword.png", tool_capabilities = { full_punch_interval = 1.0, max_drop_level=0, - damage_groups = {firy=6}, + damage_groups = {fiery=6}, } }) @@ -286,7 +310,9 @@ minetest.register_tool("basetools:sword_ice", { -- Dagger: Low damage, fast punch interval -- minetest.register_tool("basetools:dagger_steel", { - description = "Steel Dagger", + description = "Steel Dagger".."\n".. + "Damage: fleshy=2".."\n".. + "Full Punch Interval: 0.5s", inventory_image = "basetools_steeldagger.png", tool_capabilities = { full_punch_interval = 0.5, diff --git a/games/devtest/mods/bucket/init.lua b/games/devtest/mods/bucket/init.lua index 3189d4aa6..ff58b0669 100644 --- a/games/devtest/mods/bucket/init.lua +++ b/games/devtest/mods/bucket/init.lua @@ -1,7 +1,8 @@ -- Bucket: Punch liquid source or flowing liquid to collect it minetest.register_tool("bucket:bucket", { - description = "Bucket", + description = "Bucket".."\n".. + "Picks up liquid nodes", inventory_image = "bucket.png", stack_max = 1, liquids_pointable = true, diff --git a/games/devtest/mods/chest/init.lua b/games/devtest/mods/chest/init.lua index c44522cb9..fc92bfdd1 100644 --- a/games/devtest/mods/chest/init.lua +++ b/games/devtest/mods/chest/init.lua @@ -1,5 +1,6 @@ minetest.register_node("chest:chest", { - description = "Chest", + description = "Chest" .. "\n" .. + "32 inventory slots", tiles ={"chest_chest.png^[sheet:2x2:0,0", "chest_chest.png^[sheet:2x2:0,0", "chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:1,0", "chest_chest.png^[sheet:2x2:0,1"}, diff --git a/games/devtest/mods/chest_of_everything/init.lua b/games/devtest/mods/chest_of_everything/init.lua index 7d61abebf..3e9d2678a 100644 --- a/games/devtest/mods/chest_of_everything/init.lua +++ b/games/devtest/mods/chest_of_everything/init.lua @@ -43,7 +43,8 @@ local function get_chest_formspec(page) end minetest.register_node("chest_of_everything:chest", { - description = "Chest of Everything", + description = "Chest of Everything" .. "\n" .. + "Grants access to all items", tiles ={"chest_of_everything_chest.png^[sheet:2x2:0,0", "chest_of_everything_chest.png^[sheet:2x2:0,0", "chest_of_everything_chest.png^[sheet:2x2:1,0", "chest_of_everything_chest.png^[sheet:2x2:1,0", "chest_of_everything_chest.png^[sheet:2x2:1,0", "chest_of_everything_chest.png^[sheet:2x2:0,1"}, diff --git a/games/devtest/mods/experimental/items.lua b/games/devtest/mods/experimental/items.lua index 51b063ba2..94be71cf7 100644 --- a/games/devtest/mods/experimental/items.lua +++ b/games/devtest/mods/experimental/items.lua @@ -44,7 +44,8 @@ minetest.register_node("experimental:callback_node", { }) minetest.register_tool("experimental:privatizer", { - description = "Node Meta Privatizer", + description = "Node Meta Privatizer".."\n".. + "Punch: Marks 'infotext' and 'formspec' meta fields of chest as private", inventory_image = "experimental_tester_tool_1.png", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) @@ -67,7 +68,8 @@ minetest.register_tool("experimental:privatizer", { }) minetest.register_tool("experimental:particle_spawner", { - description = "Particle Spawner", + description = "Particle Spawner".."\n".. + "Punch: Spawn random test particle", inventory_image = "experimental_tester_tool_1.png^[invert:g", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) diff --git a/games/devtest/mods/soundstuff/init.lua b/games/devtest/mods/soundstuff/init.lua index 22012ba14..40ad8f562 100644 --- a/games/devtest/mods/soundstuff/init.lua +++ b/games/devtest/mods/soundstuff/init.lua @@ -107,7 +107,8 @@ minetest.register_node("soundstuff:footstep_climbable", { minetest.register_craftitem("soundstuff:eat", { - description = "Eat Sound Item", + description = "Eat Sound Item".."\n".. + "Makes a sound when 'eaten' (with punch key)", inventory_image = "soundstuff_eat.png", on_use = minetest.item_eat(0), sound = { @@ -116,7 +117,9 @@ minetest.register_craftitem("soundstuff:eat", { }) minetest.register_tool("soundstuff:breaks", { - description = "Break Sound Tool", + description = "Break Sound Tool".."\n".. + "Digs cracky=3 and more".."\n".. + "Makes a sound when it breaks", inventory_image = "soundstuff_node_dug.png", sound = { breaks = { name = "soundstuff_mono", gain = 1.0 }, diff --git a/games/devtest/mods/testentities/armor.lua b/games/devtest/mods/testentities/armor.lua index 4c30cec8d..306953d50 100644 --- a/games/devtest/mods/testentities/armor.lua +++ b/games/devtest/mods/testentities/armor.lua @@ -3,7 +3,7 @@ local phasearmor = { [0]={icy=100}, - [1]={firy=100}, + [1]={fiery=100}, [2]={fleshy=100}, [3]={immortal=1}, [4]={punch_operable=1}, diff --git a/games/devtest/mods/testnodes/light.lua b/games/devtest/mods/testnodes/light.lua index 94409e83f..8ab4416d9 100644 --- a/games/devtest/mods/testnodes/light.lua +++ b/games/devtest/mods/testnodes/light.lua @@ -22,7 +22,8 @@ end -- Lets light through, but not sunlight, leading to a -- reduction in light level when light passes through minetest.register_node("testnodes:sunlight_filter", { - description = S("Sunlight Filter"), + description = S("Sunlight Filter") .."\n".. + S("Lets light through, but weakens sunlight"), paramtype = "light", @@ -35,7 +36,8 @@ minetest.register_node("testnodes:sunlight_filter", { -- Lets light and sunlight through without obstruction minetest.register_node("testnodes:sunlight_propagator", { - description = S("Sunlight Propagator"), + description = S("Sunlight Propagator") .."\n".. + S("Lets all light through"), paramtype = "light", sunlight_propagates = true, diff --git a/games/devtest/mods/testpathfinder/init.lua b/games/devtest/mods/testpathfinder/init.lua index f94848236..67748afca 100644 --- a/games/devtest/mods/testpathfinder/init.lua +++ b/games/devtest/mods/testpathfinder/init.lua @@ -121,7 +121,11 @@ end -- Sneak+punch: Select pathfinding algorithm -- Place: Select destination node minetest.register_tool("testpathfinder:testpathfinder", { - description = S("Pathfinder Tester"), + description = S("Pathfinder Tester") .."\n".. + S("Finds path between 2 points") .."\n".. + S("Place on node: Select destination") .."\n".. + S("Punch: Find path from here") .."\n".. + S("Sneak+Punch: Change algorithm"), inventory_image = "testpathfinder_testpathfinder.png", groups = { testtool = 1, disable_repair = 1 }, on_use = find_path_or_set_algorithm, diff --git a/games/devtest/mods/testtools/init.lua b/games/devtest/mods/testtools/init.lua index d68a086b9..df5bc8e55 100644 --- a/games/devtest/mods/testtools/init.lua +++ b/games/devtest/mods/testtools/init.lua @@ -3,13 +3,13 @@ local F = minetest.formspec_escape -- TODO: Add a Node Metadata tool --- Param 2 Tool: Set param2 value of tools --- Punch: +1 --- Punch+Shift: +8 --- Place: -1 --- Place+Shift: -8 minetest.register_tool("testtools:param2tool", { - description = S("Param2 Tool"), + description = S("Param2 Tool") .."\n".. + S("Modify param2 value of nodes") .."\n".. + S("Punch: +1") .."\n".. + S("Sneak+Punch: +8") .."\n".. + S("Place: -1") .."\n".. + S("Sneak+Place: -8"), inventory_image = "testtools_param2tool.png", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) @@ -47,7 +47,11 @@ minetest.register_tool("testtools:param2tool", { }) minetest.register_tool("testtools:node_setter", { - description = S("Node Setter"), + description = S("Node Setter") .."\n".. + S("Replace pointed node with something else") .."\n".. + S("Punch: Select pointed node") .."\n".. + S("Place on node: Replace node with selected node") .."\n".. + S("Place in air: Manually select a node"), inventory_image = "testtools_node_setter.png", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) @@ -125,7 +129,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end) minetest.register_tool("testtools:remover", { - description = S("Remover"), + description = S("Remover") .."\n".. + S("Punch: Remove pointed node or object"), inventory_image = "testtools_remover.png", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) @@ -136,13 +141,17 @@ minetest.register_tool("testtools:remover", { local obj = pointed_thing.ref if not obj:is_player() then obj:remove() + else + minetest.chat_send_player(user:get_player_name(), S("Can't remove players!")) end end end, }) minetest.register_tool("testtools:falling_node_tool", { - description = S("Falling Node Tool"), + description = S("Falling Node Tool") .."\n".. + S("Punch: Make pointed node fall") .."\n".. + S("Place: Move pointed node 2 units upwards, then make it fall"), inventory_image = "testtools_falling_node_tool.png", groups = { testtool = 1, disable_repair = 1 }, on_place = function(itemstack, user, pointed_thing) @@ -191,7 +200,11 @@ minetest.register_tool("testtools:falling_node_tool", { }) minetest.register_tool("testtools:rotator", { - description = S("Entity Rotator"), + description = S("Entity Rotator") .. "\n" .. + S("Rotate pointed entity") .."\n".. + S("Punch: Yaw") .."\n".. + S("Sneak+Punch: Pitch") .."\n".. + S("Aux1+Punch: Roll"), inventory_image = "testtools_entity_rotator.png", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) @@ -244,7 +257,12 @@ local mover_config = function(itemstack, user, pointed_thing) end minetest.register_tool("testtools:object_mover", { - description = S("Object Mover"), + description = S("Object Mover") .."\n".. + S("Move pointed object towards or away from you") .."\n".. + S("Punch: Move by distance").."\n".. + S("Sneak+Punch: Move by negative distance").."\n".. + S("Place: Increase distance").."\n".. + S("Sneak+Place: Decrease distance"), inventory_image = "testtools_object_mover.png", groups = { testtool = 1, disable_repair = 1 }, on_place = mover_config, @@ -287,7 +305,10 @@ minetest.register_tool("testtools:object_mover", { minetest.register_tool("testtools:entity_scaler", { - description = S("Entity Visual Scaler"), + description = S("Entity Visual Scaler") .."\n".. + S("Scale visual size of entities") .."\n".. + S("Punch: Increase size") .."\n".. + S("Sneak+Punch: Decrease scale"), inventory_image = "testtools_entity_scaler.png", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) @@ -342,14 +363,21 @@ local function get_entity_list() return entity_list end minetest.register_tool("testtools:entity_spawner", { - description = S("Entity Spawner"), + description = S("Entity Spawner") .."\n".. + S("Spawns entities") .."\n".. + S("Punch: Select entity to spawn") .."\n".. + S("Place: Spawn selected entity"), inventory_image = "testtools_entity_spawner.png", groups = { testtool = 1, disable_repair = 1 }, on_place = function(itemstack, user, pointed_thing) local name = user:get_player_name() - if selections[name] and pointed_thing.type == "node" then - local pos = pointed_thing.above - minetest.add_entity(pos, get_entity_list()[selections[name]]) + if pointed_thing.type == "node" then + if selections[name] then + local pos = pointed_thing.above + minetest.add_entity(pos, get_entity_list()[selections[name]]) + else + minetest.chat_send_player(name, S("Select an entity first (with punch key)!")) + end end end, on_use = function(itemstack, user, pointed_thing) @@ -435,7 +463,10 @@ local editor_formspec = function(playername, obj, value, sel) end minetest.register_tool("testtools:object_editor", { - description = S("Object Property Editor"), + description = S("Object Property Editor") .."\n".. + S("Edit properties of objects") .."\n".. + S("Punch object: Edit object") .."\n".. + S("Punch air: Edit yourself"), inventory_image = "testtools_object_editor.png", groups = { testtool = 1, disable_repair = 1 }, on_use = function(itemstack, user, pointed_thing) @@ -515,7 +546,14 @@ local attacher_config = function(itemstack, user, pointed_thing) end minetest.register_tool("testtools:object_attacher", { - description = S("Object Attacher"), + description = S("Object Attacher") .."\n".. + S("Attach object to another") .."\n".. + S("Punch objects to first select parent object, then the child object to attach") .."\n".. + S("Punch air to select yourself") .."\n".. + S("Place: Incease attachment Y offset") .."\n".. + S("Sneak+Place: Decease attachment Y offset") .."\n".. + S("Aux1+Place: Incease attachment rotation") .."\n".. + S("Aux1+Sneak+Place: Decrease attachment rotation"), inventory_image = "testtools_object_attacher.png", groups = { testtool = 1, disable_repair = 1 }, on_place = attacher_config, -- cgit v1.2.3 From c61c175e9c648b6e40b85c12940e9b91a52757d7 Mon Sep 17 00:00:00 2001 From: HybridDog <3192173+HybridDog@users.noreply.github.com> Date: Fri, 9 Oct 2020 20:13:42 +0200 Subject: Add bumpmapping and parallax occlusion testing nodes to devtest (#9242) --- games/devtest/mods/testnodes/mod.conf | 1 + games/devtest/mods/testnodes/textures.lua | 49 +++++++++++++++++++++ .../textures/testnodes_height_pyramid.png | Bin 0 -> 90 bytes .../textures/testnodes_height_pyramid_normal.png | Bin 0 -> 239 bytes .../textures/testnodes_parallax_extruded.png | Bin 0 -> 591 bytes .../testnodes_parallax_extruded_normal.png | Bin 0 -> 143 bytes 6 files changed, 50 insertions(+) create mode 100644 games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png create mode 100644 games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png (limited to 'games/devtest/mods/testnodes') diff --git a/games/devtest/mods/testnodes/mod.conf b/games/devtest/mods/testnodes/mod.conf index 4824c6ed0..d894c3452 100644 --- a/games/devtest/mods/testnodes/mod.conf +++ b/games/devtest/mods/testnodes/mod.conf @@ -1,2 +1,3 @@ name = testnodes description = Contains a bunch of basic example nodes for demonstrative purposes, development and testing +depends = stairs diff --git a/games/devtest/mods/testnodes/textures.lua b/games/devtest/mods/testnodes/textures.lua index 6ffef8fe9..e0724c229 100644 --- a/games/devtest/mods/testnodes/textures.lua +++ b/games/devtest/mods/testnodes/textures.lua @@ -71,3 +71,52 @@ for a=1,#alphas do groups = { dig_immediate = 3 }, }) end + + +-- Bumpmapping and Parallax Occlusion + +-- This node has a normal map which corresponds to a pyramid with sides tilted +-- by an angle of 45°, i.e. the normal map contains four vectors which point +-- diagonally away from the surface (e.g. (0.7, 0.7, 0)), +-- and the heights in the height map linearly increase towards the centre, +-- so that the surface corresponds to a simple pyramid. +-- The node can help to determine if e.g. tangent space transformations work +-- correctly. +-- If, for example, the light comes from above, then the (tilted) pyramids +-- should look like they're lit from this light direction on all node faces. +-- The white albedo texture has small black indicators which can be used to see +-- how it is transformed ingame (and thus see if there's rotation around the +-- normal vector). +minetest.register_node("testnodes:height_pyramid", { + description = "Bumpmapping and Parallax Occlusion Tester (height pyramid)", + tiles = {"testnodes_height_pyramid.png"}, + groups = {dig_immediate = 3}, +}) + +-- The stairs nodes should help to validate if shading works correctly for +-- rotated nodes (which have rotated textures). +stairs.register_stair_and_slab("height_pyramid", "experimantal:height_pyramid", + {dig_immediate = 3}, + {"testnodes_height_pyramid.png"}, + "Bumpmapping and Parallax Occlusion Tester Stair (height pyramid)", + "Bumpmapping and Parallax Occlusion Tester Slab (height pyramid)") + +-- This node has a simple heightmap for parallax occlusion testing and flat +-- normalmap. +-- When parallax occlusion is enabled, the yellow scrawl should stick out of +-- the texture when viewed at an angle. +minetest.register_node("testnodes:parallax_extruded", { + description = "Parallax Occlusion Tester", + tiles = {"testnodes_parallax_extruded.png"}, + groups = {dig_immediate = 3}, +}) + +-- Analogously to the height pyramid stairs nodes, +-- these nodes should help to validate if parallax occlusion works correctly for +-- rotated nodes (which have rotated textures). +stairs.register_stair_and_slab("parallax_extruded", + "experimantal:parallax_extruded", + {dig_immediate = 3}, + {"testnodes_parallax_extruded.png"}, + "Parallax Occlusion Tester Stair", + "Parallax Occlusion Tester Slab") diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png new file mode 100644 index 000000000..8c787b740 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png new file mode 100644 index 000000000..5ab7865f2 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_height_pyramid_normal.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png new file mode 100644 index 000000000..7e1c32398 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded.png differ diff --git a/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png new file mode 100644 index 000000000..b134699d0 Binary files /dev/null and b/games/devtest/mods/testnodes/textures/testnodes_parallax_extruded_normal.png differ -- cgit v1.2.3 From ee1853e9bc740a521270e2e113bb4215246382c4 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 15 Nov 2020 17:37:09 +0100 Subject: Fix falling image of torchlike if paramtype2="none" (#10612) --- builtin/game/falling.lua | 9 ++++++++- games/devtest/mods/testnodes/drawtypes.lua | 21 ++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) (limited to 'games/devtest/mods/testnodes') diff --git a/builtin/game/falling.lua b/builtin/game/falling.lua index 4bfcca9e7..8d044beaa 100644 --- a/builtin/game/falling.lua +++ b/builtin/game/falling.lua @@ -84,6 +84,9 @@ core.register_entity(":__builtin:falling_node", { local textures if def.tiles and def.tiles[1] then local tile = def.tiles[1] + if def.drawtype == "torchlike" and def.paramtype2 ~= "wallmounted" then + tile = def.tiles[2] or def.tiles[1] + end if type(tile) == "table" then tile = tile.name end @@ -144,7 +147,11 @@ core.register_entity(":__builtin:falling_node", { -- Rotate entity if def.drawtype == "torchlike" then - self.object:set_yaw(math.pi*0.25) + if def.paramtype2 == "wallmounted" then + self.object:set_yaw(math.pi*0.25) + else + self.object:set_yaw(-math.pi*0.25) + end elseif (node.param2 ~= 0 and (def.wield_image == "" or def.wield_image == nil)) or def.drawtype == "signlike" diff --git a/games/devtest/mods/testnodes/drawtypes.lua b/games/devtest/mods/testnodes/drawtypes.lua index 82d862819..b3ab2b322 100644 --- a/games/devtest/mods/testnodes/drawtypes.lua +++ b/games/devtest/mods/testnodes/drawtypes.lua @@ -145,6 +145,23 @@ minetest.register_node("testnodes:fencelike", { }) minetest.register_node("testnodes:torchlike", { + description = S("Torchlike Drawtype Test Node"), + drawtype = "torchlike", + paramtype = "light", + tiles = { + "testnodes_torchlike_floor.png", + "testnodes_torchlike_ceiling.png", + "testnodes_torchlike_wall.png", + }, + + + walkable = false, + sunlight_propagates = true, + groups = { dig_immediate = 3 }, + inventory_image = fallback_image("testnodes_torchlike_floor.png"), +}) + +minetest.register_node("testnodes:torchlike_wallmounted", { description = S("Wallmounted Torchlike Drawtype Test Node"), drawtype = "torchlike", paramtype = "light", @@ -162,6 +179,8 @@ minetest.register_node("testnodes:torchlike", { inventory_image = fallback_image("testnodes_torchlike_floor.png"), }) + + minetest.register_node("testnodes:signlike", { description = S("Wallmounted Signlike Drawtype Test Node"), drawtype = "signlike", @@ -526,7 +545,7 @@ scale("allfaces_optional_waving", scale("plantlike", S("Double-sized Plantlike Drawtype Test Node"), S("Half-sized Plantlike Drawtype Test Node")) -scale("torchlike", +scale("torchlike_wallmounted", S("Double-sized Wallmounted Torchlike Drawtype Test Node"), S("Half-sized Wallmounted Torchlike Drawtype Test Node")) scale("signlike", -- cgit v1.2.3