Page 1 of 1

[Mod] Get Comfortable [cozy]

PostPosted: Wed Mar 02, 2016 11:02
by everamzah
Description: Adds commands to /lay or /sit.
License: WTFPL
Depends: default
Download: cozy.zip

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_globalstep(function(dtime)
        local players = minetest.get_connected_players()
        for i=1, #players do
                local name = players[i]:get_player_name()
                if default.player_attached[name] and not players[i]:get_attach() and
                                (players[i]:get_player_control().up == true or
                                players[i]:get_player_control().down == true or
                                players[i]:get_player_control().left == true or
                                players[i]:get_player_control().right == true or
                                players[i]:get_player_control().jump == true) then
                        players[i]:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
                        players[i]:set_physics_override(1, 1, 1)
                        default.player_attached[name] = false
                        default.player_set_animation(players[i], "stand", 30)
                end
        end
end)

minetest.register_chatcommand("sit", {
        description = "Sit down",
        func = function(name)
                local player = minetest.get_player_by_name(name)
                if default.player_attached[name] then
                        player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
                        player:set_physics_override(1, 1, 1)
                        default.player_attached[name] = false
                        default.player_set_animation(player, "stand", 30)
                else
                        player:set_eye_offset({x=0, y=-7, z=2}, {x=0, y=0, z=0})
                        player:set_physics_override(0, 0, 0)
                        default.player_attached[name] = true
                        default.player_set_animation(player, "sit", 30)
                end
        end
})

minetest.register_chatcommand("lay", {
        description = "Lay down",
        func = function(name)
                local player = minetest.get_player_by_name(name)
                if default.player_attached[name] then
                        player:set_eye_offset({x=0, y=0, z=0}, {x=0, y=0, z=0})
                        player:set_physics_override(1, 1, 1)
                        default.player_attached[name] = false
                        default.player_set_animation(player, "stand", 30)
                else
                        player:set_eye_offset({x=0, y=-13, z=0}, {x=0, y=0, z=0})
                        player:set_physics_override(0, 0, 0)
                        default.player_attached[name] = true
                        default.player_set_animation(player, "lay", 0)
                end
        end
})


Image

Re: [Mod] Get Comfortable [cozy]

PostPosted: Wed Mar 02, 2016 14:11
by firefox
great!!!!!!
+1

Re: [Mod] Get Comfortable [cozy]

PostPosted: Wed Mar 02, 2016 15:03
by Don
+1

Re: [Mod] Get Comfortable [cozy]

PostPosted: Wed Mar 02, 2016 16:04
by benrob0329
Awesome!

Re: [Mod] Get Comfortable [cozy]

PostPosted: Wed Mar 02, 2016 22:11
by Dragonop
Nice mod, I saw something simiilar on a server that is now closed, it's nice to have it back-
+1

Re: [Mod] Get Comfortable [cozy]

PostPosted: Wed Mar 02, 2016 22:45
by KCoombes
+1

Re: [Mod] Get Comfortable [cozy]

PostPosted: Thu Mar 03, 2016 01:21
by philipbenr
I would suggest a uploading a .zip archive for all those windows users who don't use 7-zip...

Re: [Mod] Get Comfortable [cozy]

PostPosted: Thu Mar 03, 2016 23:34
by Diamond knight
maybe it could change the eye offset

Re: [Mod] Get Comfortable [cozy]

PostPosted: Fri Mar 04, 2016 00:34
by benrob0329
It does, actually!

Say, devs, could this be merged with the default player code?

Re: [Mod] Get Comfortable [cozy]

PostPosted: Fri Mar 04, 2016 12:19
by Minetestforfun
Great work, should be in Minetest Game ! :)

Re: [Mod] Get Comfortable [cozy]

PostPosted: Mon May 30, 2016 14:07
by Diamond knight
i agree too, this would go perfect in minetest, not too op, fits with game, no unnessesary lag

Re: [Mod] Get Comfortable [cozy]

PostPosted: Sat Jun 25, 2016 21:37
by everamzah
It's been brought to my attention that by attaching to a boat and issuing /lay twice one is able to fly forward, backward, left, and right; but not up or down. I have not yet been able to verify this.

https://github.com/everamzah/dcb/issues/13
https://github.com/minetest-mods/cozy/issues/1

Re: [Mod] Get Comfortable [cozy]

PostPosted: Thu Nov 17, 2016 04:36
by Minetest_Neko_
How.. DO i get this to work,,, in my files
lol pls help

Re: [Mod] Get Comfortable [cozy]

PostPosted: Thu Nov 17, 2016 05:00
by AnxiousInfusion
You have it in your ~/minetest/mods directory? It is enabled in minetest.mt or by mods menu? Sitting and laying work by issuing commands in chat.

Re: [Mod] Get Comfortable [cozy]

PostPosted: Thu Nov 17, 2016 16:21
by Minetest_Neko_
How did you get it to work?? it says to me theres a error no A-Z characters aloud, or something like that.
Help pls :3

Re: [Mod] Get Comfortable [cozy]

PostPosted: Fri Nov 18, 2016 22:32
by Diamond knight
this should be in 0.4.15

it fits the criteria, it doesn't cause much lag, doesn't mess with the game, it is something that can bring your furniture to life (minetest_game player built out of slabs "furniture" at least)