AliasAlreadyTaken reports: Add a staff command to enable/ ... #5476

Closed
opened 2023-11-11 18:33:14 +00:00 by yourland-report · 13 comments

AliasAlreadyTaken reports a bug:

Add a staff command to enable/disable head movement of players

Player position:

{
	z = 1174.2629394531,
	x = 1979.3000488281,
	y = 18
}

Player look:

{
	z = -0.033164542168379,
	x = 0.99450272321701,
	y = -0.099319748580456
}

Player information:

{
	lang_code = "de",
	max_rtt = 2.095999956131,
	ip_version = 6,
	min_rtt = 0.014999999664724,
	avg_rtt = 0.020999999716878,
	min_jitter = 0,
	max_jitter = 1.1579999923706,
	avg_jitter = 0,
	connection_uptime = 38273,
	serialization_version = 29,
	formspec_version = 6,
	patch = 0,
	version_string = "5.7.0",
	state = "Active",
	protocol_version = 42,
	major = 5,
	minor = 7
}

Player meta:

{
	fields = {
		xp = "0",
		["3d_armor_inventory"] = "return {\"\", \"\", \"\", \"\", \"\", \"\"}",
		["petz:lycanthropy"] = "0",
		played_time = "94309041",
		digged_nodes = "140378",
		placed_nodes = "181751",
		died = "1591",
		crafted = "4786",
		yl_church = "return {[\"last_heal\"] = 1683837139, [\"last_death\"] = {[\"x\"] = 2251, [\"y\"] = -164, [\"z\"] = 1401}, [\"last_death_portal\"] = 1683839371}",
		["arena_lib_editor.players_number"] = "0",
		yl_commons_thankyou = "1294",
		["petz:old_override_table"] = "return {[\"speed\"] = 1, [\"new_move\"] = true, [\"sneak_glitch\"] = false, [\"gravity\"] = 1, [\"jump\"] = 1, [\"sneak\"] = true}",
		arenalib_infobox_arenaID = "0",
		bitten = "0",
		hud_state = "on",
		["ocean_build.last_warning"] = "1.67421e+09",
		["ocean_build.forbidden"] = "true",
		["ocean_build.ocean_built"] = "12",
		szutil_watch = "return {}",
		partypvp = "true",
		punch_count = "65078",
		inflicted_damage = "2991262",
		["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)",
		xp_redo_hud_color = "0xFFFF00",
		yl_commons_player_joined = "1699689360",
		["arena_lib_editor.spawner_ID"] = "0",
		yl_audio_state = "off",
		["ethereal:fly_timer"] = "-99",
		["signslib:pos"] = "(1976,14,1168)",
		["petz:werewolf_clan_idx"] = "4",
		arenalib_watchID = "0",
		lagometer = "1",
		partychat = "party",
		repellant = "0",
		["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}",
		["stamina:level"] = "2",
		team = "STAFF",
		["stamina:poisoned"] = "no",
		["petz:werewolf"] = "0",
		["stamina:exhaustion"] = "37",
		["petz:werewolf_vignette_id"] = "19",
		["arena_lib_editor.team_ID"] = "0"
	}
}

Log identifier


[MOD] yl_report log identifier = hfnp3vCyKd1bkbIUXjwYcCcE1KfopoPN

Profiler save:

profile-20231111T183314.json_prettyEE

Status:

# Server: version: 5.7.0-yl-thx-tmm | game: Minetest Game | uptime: 7d 4h 21min 39s | max lag: 0.873s | clients (26/52): Acenix2, AliasAlreadyTaken, Bingo, Bishiro, bizon, Boot, Cezar, Chache, CloudZ, DanteLives, daydream, EDWIR, ElManu, flux, Heron, LadyPixels, Lucien_II, MartinCZ, MeZN, Noii, pavlo98, Pif, polylith, Service, Sokomine, Taiel

Teleport command:

/teleport xyz 1979 18 1174

Compass command:

/give_compass Construction hfnp3vCyKd1bkbIUXjwYcCcE1KfopoPN D2691E 1979 18 1174
AliasAlreadyTaken reports a bug: > Add a staff command to enable/disable head movement of players Player position: ``` { z = 1174.2629394531, x = 1979.3000488281, y = 18 } ``` Player look: ``` { z = -0.033164542168379, x = 0.99450272321701, y = -0.099319748580456 } ``` Player information: ``` { lang_code = "de", max_rtt = 2.095999956131, ip_version = 6, min_rtt = 0.014999999664724, avg_rtt = 0.020999999716878, min_jitter = 0, max_jitter = 1.1579999923706, avg_jitter = 0, connection_uptime = 38273, serialization_version = 29, formspec_version = 6, patch = 0, version_string = "5.7.0", state = "Active", protocol_version = 42, major = 5, minor = 7 } ``` Player meta: ``` { fields = { xp = "0", ["3d_armor_inventory"] = "return {\"\", \"\", \"\", \"\", \"\", \"\"}", ["petz:lycanthropy"] = "0", played_time = "94309041", digged_nodes = "140378", placed_nodes = "181751", died = "1591", crafted = "4786", yl_church = "return {[\"last_heal\"] = 1683837139, [\"last_death\"] = {[\"x\"] = 2251, [\"y\"] = -164, [\"z\"] = 1401}, [\"last_death_portal\"] = 1683839371}", ["arena_lib_editor.players_number"] = "0", yl_commons_thankyou = "1294", ["petz:old_override_table"] = "return {[\"speed\"] = 1, [\"new_move\"] = true, [\"sneak_glitch\"] = false, [\"gravity\"] = 1, [\"jump\"] = 1, [\"sneak\"] = true}", arenalib_infobox_arenaID = "0", bitten = "0", hud_state = "on", ["ocean_build.last_warning"] = "1.67421e+09", ["ocean_build.forbidden"] = "true", ["ocean_build.ocean_built"] = "12", szutil_watch = "return {}", partypvp = "true", punch_count = "65078", inflicted_damage = "2991262", ["sethome:home"] = "(1983.4349365234,17.5,1183.5950927734)", xp_redo_hud_color = "0xFFFF00", yl_commons_player_joined = "1699689360", ["arena_lib_editor.spawner_ID"] = "0", yl_audio_state = "off", ["ethereal:fly_timer"] = "-99", ["signslib:pos"] = "(1976,14,1168)", ["petz:werewolf_clan_idx"] = "4", arenalib_watchID = "0", lagometer = "1", partychat = "party", repellant = "0", ["unified_inventory:bags"] = "return {\"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\", \"unified_inventory:bag_large\"}", ["stamina:level"] = "2", team = "STAFF", ["stamina:poisoned"] = "no", ["petz:werewolf"] = "0", ["stamina:exhaustion"] = "37", ["petz:werewolf_vignette_id"] = "19", ["arena_lib_editor.team_ID"] = "0" } } ``` Log identifier ``` [MOD] yl_report log identifier = hfnp3vCyKd1bkbIUXjwYcCcE1KfopoPN ``` Profiler save: ``` profile-20231111T183314.json_prettyEE ``` Status: ``` # Server: version: 5.7.0-yl-thx-tmm | game: Minetest Game | uptime: 7d 4h 21min 39s | max lag: 0.873s | clients (26/52): Acenix2, AliasAlreadyTaken, Bingo, Bishiro, bizon, Boot, Cezar, Chache, CloudZ, DanteLives, daydream, EDWIR, ElManu, flux, Heron, LadyPixels, Lucien_II, MartinCZ, MeZN, Noii, pavlo98, Pif, polylith, Service, Sokomine, Taiel ``` Teleport command: ``` /teleport xyz 1979 18 1174 ``` Compass command: ``` /give_compass Construction hfnp3vCyKd1bkbIUXjwYcCcE1KfopoPN D2691E 1979 18 1174 ```
AliasAlreadyTaken was assigned by yourland-report 2023-11-11 18:33:14 +00:00

suggesting /barber to stop head movement 😆

suggesting `/barber` to stop head movement 😆
AliasAlreadyTaken added the
1. kind/enhancement
2. prio/elevated
labels 2023-11-11 19:59:04 +00:00
Member

what's the use case?

what's the use case?
Member

I suspect that the head movements contribute significantly to the too many packages problem and filling up my line. On the other hand head movements are extremly important on a social level for players.

I suspect that the head movements contribute significantly to the too many packages problem and filling up my line. On the other hand head movements are extremly important on a social level for players.
Member

I suspect that the head movements contribute significantly to the too many packages problem and filling up my line.

ah, so this would then enable us to test that theory.

> I suspect that the head movements contribute significantly to the too many packages problem and filling up my line. ah, so this would then enable us to test that theory.
Member
-- Register a chat command to enable or disable a player's head movement mod
minetest.register_chatcommand("headmovement", {
    params = "<playername> <enable|disable>",
    description = "Enable or disable head movement mod for a player",
    privs = { staff = true },
    func = function(name, params)
        local playername, action = params:match("(%S+)%s(%S+)")
        if playername and action then
            local player = minetest.get_player_by_name(playername)
            if player then
                if action == "enable" then
                    player:set_physics_override({ sneak = true })
                elseif action == "disable" then
                    player:set_physics_override({ sneak = false })
                end
                return true, "Head movement mod " .. action .. "d for player " .. playername
            end
        end
        return false, "Invalid parameters"
    end,
})
``` -- Register a chat command to enable or disable a player's head movement mod minetest.register_chatcommand("headmovement", { params = "<playername> <enable|disable>", description = "Enable or disable head movement mod for a player", privs = { staff = true }, func = function(name, params) local playername, action = params:match("(%S+)%s(%S+)") if playername and action then local player = minetest.get_player_by_name(playername) if player then if action == "enable" then player:set_physics_override({ sneak = true }) elseif action == "disable" then player:set_physics_override({ sneak = false }) end return true, "Head movement mod " .. action .. "d for player " .. playername end end return false, "Invalid parameters" end, }) ```

maybe make it where each player can also disable or enable their own head movement

maybe make it where each player can also disable or enable their own head movement

This is a debug command. To see the most effect, I'd like it to disable or enable ALL head movement at once.

This is a debug command. To see the most effect, I'd like it to disable or enable ALL head movement at once.

Best way to do this is make a yl_version only of headamin. by fixing the mistakes made in that mod and adding the scripting to enable and disable it. along with implementing the ingame command of /barber enable and /barber disable. here is a working example of just that. I however did make it so people can show how they feel with there head pos. i.e if a player looks down and sad and does /barber disable than there head will stay in that sad pos. however still allowing the player to have a normal view of moment and still able to play, interact, build, exc.. while have there head in there desired pos. this is easily changed to have head go back to basepos if so desired to when head movement is disabled.

local get_connected_players = minetest.get_connected_players
local abs = math.abs
local deg = math.deg
local basepos = vector.new(0, 6.47, 0)
local lastdir = {}
local head_movement_enabled = true

local function updateHeadMovement(dtime)
    if head_movement_enabled then
        local connected_players = get_connected_players()
        for _, player in ipairs(connected_players) do
            local pname = player:get_player_name()
            local ldeg = -deg(player:get_look_vertical())
            if abs((lastdir[pname] or 0) - ldeg) > 4 then
                lastdir[pname] = ldeg
                player:set_bone_position("Head", basepos, {x = ldeg, y = 0, z = 0})
            end
        end
    end
end

minetest.register_globalstep(updateHeadMovement)

minetest.register_on_leaveplayer(function(player)
    lastdir[player:get_player_name()] = nil
end)

minetest.register_chatcommand("barber", {
    description = "Enable or disable head movement",
    privs = {interact = true},
    func = function(name, param)
        if param == "enable" then
            head_movement_enabled = true
            return true, "Head movement enabled"
        elseif param == "disable" then
            head_movement_enabled = false
            return true, "Head movement disabled"
        else
            return false, "Invalid parameter. Usage: /barber <enable|disable>"
        end
    end,
})
Best way to do this is make a yl_version only of headamin. by fixing the mistakes made in that mod and adding the scripting to enable and disable it. along with implementing the ingame command of /barber enable and /barber disable. here is a working example of just that. I however did make it so people can show how they feel with there head pos. i.e if a player looks down and sad and does /barber disable than there head will stay in that sad pos. however still allowing the player to have a normal view of moment and still able to play, interact, build, exc.. while have there head in there desired pos. this is easily changed to have head go back to basepos if so desired to when head movement is disabled. ```lua local get_connected_players = minetest.get_connected_players local abs = math.abs local deg = math.deg local basepos = vector.new(0, 6.47, 0) local lastdir = {} local head_movement_enabled = true local function updateHeadMovement(dtime) if head_movement_enabled then local connected_players = get_connected_players() for _, player in ipairs(connected_players) do local pname = player:get_player_name() local ldeg = -deg(player:get_look_vertical()) if abs((lastdir[pname] or 0) - ldeg) > 4 then lastdir[pname] = ldeg player:set_bone_position("Head", basepos, {x = ldeg, y = 0, z = 0}) end end end end minetest.register_globalstep(updateHeadMovement) minetest.register_on_leaveplayer(function(player) lastdir[player:get_player_name()] = nil end) minetest.register_chatcommand("barber", { description = "Enable or disable head movement", privs = {interact = true}, func = function(name, param) if param == "enable" then head_movement_enabled = true return true, "Head movement enabled" elseif param == "disable" then head_movement_enabled = false return true, "Head movement disabled" else return false, "Invalid parameter. Usage: /barber <enable|disable>" end end, }) ```

Here it is where it will reset head pos back to basepos if you prefer.

local get_connected_players = minetest.get_connected_players
local abs = math.abs
local deg = math.deg
local basepos = vector.new(0, 6.47, 0)
local lastdir = {}
local head_movement_enabled = true

local function updateHeadMovement(dtime)
    local connected_players = get_connected_players()
    
    for _, player in ipairs(connected_players) do
        local pname = player:get_player_name()
        local ldeg = -deg(player:get_look_vertical())
        
        if head_movement_enabled then
            if abs((lastdir[pname] or 0) - ldeg) > 4 then
                lastdir[pname] = ldeg
                player:set_bone_position("Head", basepos, {x = ldeg, y = 0, z = 0})
            end
        else
            lastdir[pname] = 0 -- Reset last direction to 0 when disabled
            player:set_bone_position("Head", basepos, {x = 0, y = 0, z = 0}) -- Resets head position to basepos when disabled
        end
    end
end

minetest.register_globalstep(updateHeadMovement)

minetest.register_on_leaveplayer(function(player)
    lastdir[player:get_player_name()] = nil
end)

minetest.register_chatcommand("barber", {
    description = "Enable or disable head movement",
    privs = {interact = true},
    func = function(name, param)
        if param == "enable" then
            head_movement_enabled = true
            return true, "Head movement enabled"
        elseif param == "disable" then
            head_movement_enabled = false
            return true, "Head movement disabled"
        else
            return false, "Invalid parameter. Usage: /barber <enable|disable>"
        end
    end,
})
Here it is where it will reset head pos back to basepos if you prefer. ```lua local get_connected_players = minetest.get_connected_players local abs = math.abs local deg = math.deg local basepos = vector.new(0, 6.47, 0) local lastdir = {} local head_movement_enabled = true local function updateHeadMovement(dtime) local connected_players = get_connected_players() for _, player in ipairs(connected_players) do local pname = player:get_player_name() local ldeg = -deg(player:get_look_vertical()) if head_movement_enabled then if abs((lastdir[pname] or 0) - ldeg) > 4 then lastdir[pname] = ldeg player:set_bone_position("Head", basepos, {x = ldeg, y = 0, z = 0}) end else lastdir[pname] = 0 -- Reset last direction to 0 when disabled player:set_bone_position("Head", basepos, {x = 0, y = 0, z = 0}) -- Resets head position to basepos when disabled end end end minetest.register_globalstep(updateHeadMovement) minetest.register_on_leaveplayer(function(player) lastdir[player:get_player_name()] = nil end) minetest.register_chatcommand("barber", { description = "Enable or disable head movement", privs = {interact = true}, func = function(name, param) if param == "enable" then head_movement_enabled = true return true, "Head movement enabled" elseif param == "disable" then head_movement_enabled = false return true, "Head movement disabled" else return false, "Invalid parameter. Usage: /barber <enable|disable>" end end, }) ```
Member

5b0eac3fe4

note that this completely disables all the stuff in playeranim, not just the head, on the assumption that all the other bodyparts (bones) also contribute to the issue.

https://gitea.your-land.de/your-land/playeranim/commit/5b0eac3fe413146e707179c37ed4c38e82635bda note that this completely disables all the stuff in playeranim, not just the head, on the assumption that all the other bodyparts (bones) also contribute to the issue.
flux added the
4. step/ready to QA test
label 2023-11-15 21:49:16 +00:00
Member

Letting the head stay in a special fixed position might be of intrest for yl_cinema and yl_theatre (see #5492).

Letting the head stay in a special fixed position might be of intrest for yl_cinema and yl_theatre (see #5492).
AliasAlreadyTaken added the
ugh/QA OK
label 2023-12-05 20:44:12 +00:00
AliasAlreadyTaken added this to the 1.1.122 milestone 2023-12-05 20:44:14 +00:00
flux added
5. result/fixed
and removed
4. step/ready to QA test
labels 2023-12-18 01:53:34 +00:00
AliasAlreadyTaken was unassigned by flux 2023-12-18 01:53:36 +00:00
Member

this is live. is there already an issue about testing whether this helps @Sokomine's issues?

this is live. is there already an issue about testing whether this helps @Sokomine's issues?
flux closed this issue 2023-12-18 01:54:15 +00:00

There is #5005 but it doesn't mention head movement

There is #5005 but it doesn't mention head movement
Sign in to join this conversation.
No Milestone
No project
No Assignees
8 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: your-land/bugtracker#5476
No description provided.