[csm] sneakjump 100

Post Reply
User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

[csm] sneakjump 100

by jas » Post

this is the client-side portion of the sneakjump 100 mod

http://github.com/jastevenson303/sjcsm

Requires SSM part: viewtopic.php?f=9&t=22682

Code: Select all

-- sneakjump client-side mod
-- copyright 2019 james stevenson
-- gnu lgpl 2.1+

local sprinting = false
local step = 0.09
local player = minetest.localplayer
local channel = minetest.mod_channel_join("sprinting")

local function convert(decimal)
	local binary = ""
	while decimal > 0 do
		binary = "" .. (decimal % 2) .. binary
		decimal = math.floor(decimal / 2)
	end
	local length = binary:len()
	local bits = {}
	for i = length, 1, -1 do
		local bit = tonumber(binary:sub(i, i))
		table.insert(bits, bit)
	end
	for i = 1, 9 do
		if not bits[i] then
			bits[i] = 0
		end
	end
	return bits
end

local function get_movement(player)
	local keys = convert(player:get_key_pressed())
	local aux1 = keys[6] == 1

	if aux1 and not sprinting then
		channel:send_all("t")
		sprinting = true
	elseif sprinting and not aux1 then
		channel:send_all("f")
		sprinting = false
	end

	minetest.after(step, function()
		get_movement(player)
	end)
end

minetest.after(step, function()
	get_movement(player)
end)
There's no stamina, just use aux1 to go faster, jump higher, and use less gravity. May not be compatible with anything else at all other than the server-side counterpart.

Here's a video.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: [csm] sneakjump 100

by jas » Post

Here's another quick little video: https://www.youtube.com/watch?v=FG9IUJzdD4c

And here's a quote from paramat on github:
My honest gut feeling is that SSCSM will never happen, and CSM will be completely removed after we've waited another 1-2 years of no progress because no-one has time.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest