Renamed the scriptblock_nearest to the scriptblock_player_detector, and added an entry for it in the README.
This commit is contained in:
parent
875c22b118
commit
2cf6f6326d
|
@ -60,3 +60,7 @@ The purple blocks with a speech bubble on them will print the message specified
|
|||
### Guide
|
||||
|
||||
The grey blocks which look like three arrows that converge into one are guides - they are used to aid looping by funnelling all execution in one direction - never will a guide execute nearby blocks other than the one it is pointing to.
|
||||
|
||||
### Player Detector
|
||||
|
||||
The blue block with the simplified logo of a player avatar is the Player Detector. When it is ran, it updates @last to the previous @info and updates @info to the name of the nearest player.
|
||||
|
|
|
@ -81,8 +81,8 @@ end
|
|||
|
||||
local time = 0
|
||||
minetest.register_globalstep(function (dtime)
|
||||
time = time + dtime
|
||||
if time > 0.05 then time = 0 else return end
|
||||
-- time = time + dtime
|
||||
-- if time > 0.05 then time = 0 else return end
|
||||
|
||||
local new_queue = {}
|
||||
for i,data in pairs(queue) do
|
||||
|
@ -228,7 +228,7 @@ minetest.register_node("rmod:scriptblock_print", {
|
|||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", [[
|
||||
field[player;Player;${player}]
|
||||
field[player;Player (optional);${player}]
|
||||
field[message;Message;${message}]
|
||||
]])
|
||||
end,
|
||||
|
@ -476,9 +476,9 @@ field[b;B;${b}]
|
|||
end
|
||||
})
|
||||
|
||||
minetest.register_node("rmod:scriptblock_nearest", {
|
||||
description = "Scriptblock: Get Nearest Player",
|
||||
tiles = {"rmod_scriptblock_nearest.png"},
|
||||
minetest.register_node("rmod:scriptblock_player_detector", {
|
||||
description = "Scriptblock: Player Detector",
|
||||
tiles = {"rmod_scriptblock_player_detector.png"},
|
||||
groups = {oddly_breakable_by_hand = 1},
|
||||
use_texture_alpha = true,
|
||||
scriptblock = function (pos, node, sender, info, last, main_channel)
|
||||
|
|
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 240 B |
Reference in New Issue