[Mod] Get Comfortable [cozy]

Post Reply
User avatar
everamzah
Member
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

[Mod] Get Comfortable [cozy]

by everamzah » Post

Description: Adds commands to /lay or /sit.
License: WTFPL
Depends: default
Download: cozy.zip

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
Attachments
screenshot.png
screenshot.png (208.33 KiB) Viewed 2280 times
cozy.zip
(208.81 KiB) Downloaded 543 times
cozy.tgz
(610 Bytes) Downloaded 240 times
Last edited by everamzah on Thu Mar 03, 2016 14:15, edited 2 times in total.

User avatar
firefox
Member
Posts: 1709
Joined: Wed Jan 14, 2015 07:34
In-game: Red_Fox
Location: Xanadu

Re: [Mod] Get Comfortable [cozy]

by firefox » Post

great!!!!!!
+1
✨🏳️‍🌈♣️✨

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Get Comfortable [cozy]

by Don » Post

+1
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

User avatar
benrob0329
Member
Posts: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: [Mod] Get Comfortable [cozy]

by benrob0329 » Post

Awesome!

Dragonop
Member
Posts: 1233
Joined: Tue Oct 23, 2012 12:59
GitHub: Dragonop
IRC: Dragonop
In-game: Dragonop
Location: Argentina

Re: [Mod] Get Comfortable [cozy]

by Dragonop » Post

Nice mod, I saw something simiilar on a server that is now closed, it's nice to have it back-
+1

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: [Mod] Get Comfortable [cozy]

by KCoombes » Post

+1

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: [Mod] Get Comfortable [cozy]

by philipbenr » Post

I would suggest a uploading a .zip archive for all those windows users who don't use 7-zip...

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

Re: [Mod] Get Comfortable [cozy]

by Diamond knight » Post

maybe it could change the eye offset

User avatar
benrob0329
Member
Posts: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: [Mod] Get Comfortable [cozy]

by benrob0329 » Post

It does, actually!

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

Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Get Comfortable [cozy]

by Minetestforfun » Post

Great work, should be in Minetest Game ! :)

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

Re: [Mod] Get Comfortable [cozy]

by Diamond knight » Post

i agree too, this would go perfect in minetest, not too op, fits with game, no unnessesary lag

User avatar
everamzah
Member
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Get Comfortable [cozy]

by everamzah » Post

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

Minetest_Neko_
Member
Posts: 11
Joined: Thu Nov 17, 2016 01:26
GitHub: GitMee
IRC: Roc
In-game: Neko_

Re: [Mod] Get Comfortable [cozy]

by Minetest_Neko_ » Post

How.. DO i get this to work,,, in my files
lol pls help

User avatar
AccidentallyRhine
Member
Posts: 252
Joined: Sun Aug 02, 2015 05:43

Re: [Mod] Get Comfortable [cozy]

by AccidentallyRhine » Post

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.

Minetest_Neko_
Member
Posts: 11
Joined: Thu Nov 17, 2016 01:26
GitHub: GitMee
IRC: Roc
In-game: Neko_

Re: [Mod] Get Comfortable [cozy]

by Minetest_Neko_ » Post

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

User avatar
Diamond knight
Member
Posts: 475
Joined: Sun Apr 19, 2015 19:50
GitHub: Diamondknight
In-game: Ferrumprinceps
Location: Chilling in Constantinople
Contact:

Re: [Mod] Get Comfortable [cozy]

by Diamond knight » Post

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)

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Get Comfortable [cozy]

by loppi » Post

nice :-P
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests