Page 11 of 85

Posted: Fri Dec 28, 2012 02:15
by Josh
Chinchow wrote: if you want minecraft things go play minecraft
Exactly, This is mineTEST :)

Posted: Fri Dec 28, 2012 02:25
by Josh
Pilzadam's quest
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Salutation's sir Pilzadam the noble king of minetest challeges you to make a Realistic-looking chest like you see in dungeons and other similar places. It's look can be 3D shaped, size is your choice and it has to open. Succeed in your quest and you will receive a mese cookie.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
P.S: You don't have to make this, but it would be intresting :)

Posted: Fri Dec 28, 2012 02:35
by PilzAdam
Josh wrote:Pilzadam's quest
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Salutation's sir Pilzadam the noble king of minetest challeges you to make a Realistic-looking chest like you see in dungeons and other similar places. It's look can be 3D shaped, size is your choice and it has to open. Succeed in your quest and you will receive a mese cookie.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
P.S: You don't have to make this, but it would be intresting :)
The nodeboxes for the opened and the closed state are easy to do but there are two problems:
1.: The animation to open the chest isnt possible.
2.: There are no callbacks in the API to register when a chest is opened/closed.

Posted: Fri Dec 28, 2012 02:35
by Chinchow
How about a teslacoil one that would emit lightning around it and shock the player it touches and it could be harvested with lightning rods and crafted into useful things

Posted: Fri Dec 28, 2012 02:57
by Josh
PilzAdam wrote:
Josh wrote:Pilzadam's quest
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Salutation's sir Pilzadam the noble king of minetest challeges you to make a Realistic-looking chest like you see in dungeons and other similar places. It's look can be 3D shaped, size is your choice and it has to open. Succeed in your quest and you will receive a mese cookie.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
P.S: You don't have to make this, but it would be intresting :)
The nodeboxes for the opened and the closed state are easy to do but there are two problems:
1.: The animation to open the chest isnt possible.
2.: There are no callbacks in the API to register when a chest is opened/closed.
Oh, well it's....impossible :(

Posted: Fri Dec 28, 2012 03:54
by kaeza
Josh wrote:
PilzAdam wrote:
Josh wrote:Pilzadam's quest
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Salutation's sir Pilzadam the noble king of minetest challeges you to make a Realistic-looking chest like you see in dungeons and other similar places. It's look can be 3D shaped, size is your choice and it has to open. Succeed in your quest and you will receive a mese cookie.
-------------------------------------------------------------------------------------------------------------------------------------------------------------
P.S: You don't have to make this, but it would be intresting :)
The nodeboxes for the opened and the closed state are easy to do but there are two problems:
1.: The animation to open the chest isnt possible.
2.: There are no callbacks in the API to register when a chest is opened/closed.
Oh, well it's....impossible :(
It *may* be possible (theoretically, haven't tested it).
First you make two nodes: a closed chest, and an open chest. Then, you make it so punching the node switches the node (i.e: changes the open one to the closed one and viceversa), and you only define right-clicking for the "open" chest.
EDIT: I may do it if someone makes the nodebox for me.
EDIT2: BTW, yes, the animation may also be possible using some clever way, like how falling nodes and mesecons movestones are implemented.

Posted: Fri Dec 28, 2012 09:50
by Zeg9
kaeza wrote:
Josh wrote:
PilzAdam wrote: The nodeboxes for the opened and the closed state are easy to do but there are two problems:
1.: The animation to open the chest isnt possible.
2.: There are no callbacks in the API to register when a chest is opened/closed.
Oh, well it's....impossible :(
It *may* be possible (theoretically, haven't tested it).
First you make two nodes: a closed chest, and an open chest. Then, you make it so punching the node switches the node (i.e: changes the open one to the closed one and viceversa), and you only define right-clicking for the "open" chest.
EDIT: I may do it if someone makes the nodebox for me.
EDIT2: BTW, yes, the animation may also be possible using some clever way, like how falling nodes and mesecons movestones are implemented.
Animation is possible with the new models code and an entity. I may do this part...

Posted: Fri Dec 28, 2012 19:57
by Chinchow
OK I'm gonna suggest a mod that I was gonna make and just wanted more ideas to add to it but it got closed because someone mistook it for a request so now it is I want a mod that adds more liquids other than water and lava

Posted: Fri Dec 28, 2012 20:14
by jojoa1997
liquid that floats

Posted: Fri Dec 28, 2012 21:36
by Ragnar
@doggy i could make an expansion pack for my mod with new liquids, that you can tweak to make a new mod maybe =)

Posted: Fri Dec 28, 2012 22:30
by Chinchow
Ragnar wrote:@doggy i could make an expansion pack for my mod with new liquids, that you can tweak to make a new mod maybe =)
1. Am I doggy or is everyone doggy cause if everyone is doggy @doggy would be hard to understand

2.go ahead looking forward to it

Posted: Sat Dec 29, 2012 05:51
by Ragnar
i reconize you, but i never was good with remembering names... and youre doggy =)

Posted: Sat Dec 29, 2012 09:15
by cactuz_pl
Ban which works even when player is offline, and when he trying to connect server is adding his IP to banlist.

Edit:

Command will add name to "future ban list". Server could compare logged player's name with this list and ban if name match to the list.

Posted: Sat Dec 29, 2012 12:40
by PilzAdam
cactuz_pl wrote:Ban which works even when player is offline, and when he trying to connect server is adding his IP to banlist.

Edit:

Command will add name to "future ban list". Server could compare logged player's name with this list and ban if name match to the list.
This is untested code:

Code: Select all

future_ban_list = {}

minetest.register_chatcommand("future_ban", {
    params = "<playername> | leave playername out to see the future ban list",
    description = "The player will be banned when trying to join",
    privs = {ban=true},
    func = function(name, param)
        if param == "" then
            minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
            return
        end
        if not minetest.env:get_player_by_name(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, desc .. " to future ban list added.")
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")
            return
        end
        if not minetest.ban_player(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, desc .. " to future ban list added.")
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")
        else
            local desc = minetest.get_ban_description(param)
            minetest.chat_send_player(name, "Banned " .. desc .. ".")
            minetest.log("action", name .. " bans " .. desc .. ".")
        end
    end
})

minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    for _,n in ipairs(future_ban_list) do
        if n == name then
            if not minetest.ban_player(name) then
                minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
            else
                local desc = minetest.get_ban_description(name)
                minetest.log("action", desc .. " banned (from future ban list).")
            end
        end
    end
end)


Posted: Sat Dec 29, 2012 14:09
by TheMan
HOW ABOUT A [FORCEFIELD]

*Made of cery clear undestructible glass.
*It can reduce griefing.






COULD THIS BE DONE?

Posted: Sat Dec 29, 2012 15:32
by Chinchow
TheMan wrote:HOW ABOUT A [FORCEFIELD]

*Made of cery clear undestructible glass.
*It can reduce griefing.






COULD THIS BE DONE?
Isn't that just making a new glass with a 0 in the area that determines durability?

Posted: Sat Dec 29, 2012 15:42
by kaeza
TheMan wrote:HOW ABOUT A [FORCEFIELD]

*Made of cery clear undestructible glass.
*It can reduce griefing.






COULD THIS BE DONE?
That has already been done. See this topic, in particular the "full clip".

Posted: Sun Dec 30, 2012 08:36
by cactuz_pl
PilzAdam wrote: This is untested code:

Code: Select all

future_ban_list = {}

minetest.register_chatcommand("future_ban", {
    params = "<playername> | leave playername out to see the future ban list",
    description = "The player will be banned when trying to join",
    privs = {ban=true},
    func = function(name, param)
        if param == "" then
            minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
            return
        end
        if not minetest.env:get_player_by_name(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, desc .. " to future ban list added.")  <----LUA ERROR
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")  <---- LUAERROR

            return
        end
        if not minetest.ban_player(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, desc .. " to future ban list added.")
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")
        else
            local desc = minetest.get_ban_description(param)
            minetest.chat_send_player(name, "Banned " .. desc .. ".")
            minetest.log("action", name .. " bans " .. desc .. ".")
        end
    end
})

minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    for _,n in ipairs(future_ban_list) do
        if n == name then
            if not minetest.ban_player(name) then
                minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
            else
                local desc = minetest.get_ban_description(name)
                minetest.log("action", desc .. " banned (from future ban list).")
            end
        end
    end
end)

Thanks, this code almost works.

There are two errors in 14 and 15 line, I don't know how to fix them so I removed them.

Mod is working(adding to list and banning on join) but when turn off my local server, mod forgets "future_ban_list" (no new files are created).

Posted: Sun Dec 30, 2012 12:12
by PilzAdam
cactuz_pl wrote:
PilzAdam wrote: This is untested code:

Code: Select all

future_ban_list = {}

minetest.register_chatcommand("future_ban", {
    params = "<playername> | leave playername out to see the future ban list",
    description = "The player will be banned when trying to join",
    privs = {ban=true},
    func = function(name, param)
        if param == "" then
            minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
            return
        end
        if not minetest.env:get_player_by_name(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, desc .. " to future ban list added.")  <----LUA ERROR
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")  <---- LUAERROR

            return
        end
        if not minetest.ban_player(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, desc .. " to future ban list added.")
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")
        else
            local desc = minetest.get_ban_description(param)
            minetest.chat_send_player(name, "Banned " .. desc .. ".")
            minetest.log("action", name .. " bans " .. desc .. ".")
        end
    end
})

minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    for _,n in ipairs(future_ban_list) do
        if n == name then
            if not minetest.ban_player(name) then
                minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
            else
                local desc = minetest.get_ban_description(name)
                minetest.log("action", desc .. " banned (from future ban list).")
            end
        end
    end
end)

Thanks, this code almost works.

There are two errors in 14 and 15 line, I don't know how to fix them so I removed them.

Mod is working(adding to list and banning on join) but when turn off my local server, mod forgets "future_ban_list" (no new files are created).
Fixed line 14 and 15 (change desc to param):

Code: Select all

        if not minetest.env:get_player_by_name(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, param .. " to future ban list added.") -- Fixed
            minetest.log("action", name .. " added " .. param .. " to future ban list.") -- Fixed

            return
        end
This version saves the future ban list and also removes players that are banned form the list (again untested):

Code: Select all

future_ban_list = {}

local file = io.open(minetest.get_worldpath().."/future_banlist.txt")
if file then
    future_ban_list = minetest.deserialize(file:read("*all"))
    file:close()
end

minetest.register_chatcommand("future_ban", {
    params = "<playername> | leave playername out to see the future ban list",
    description = "The player will be banned when trying to join",
    privs = {ban=true},
    func = function(name, param)
        if param == "" then
            minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
            return
        end
        if not minetest.env:get_player_by_name(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, param .. " to future ban list added.")
            minetest.log("action", name .. " added " .. param .. " to future ban list.")
            local file = io.open(minetest.get_worldpath().."/future_banlist.txt")
            if file then
                file:write(minetest.serialize(future_ban_list))
                file:close()
            end

            return
        end
        if not minetest.ban_player(param) then
            table.insert(future_ban_list, param)
            local file = io.open(minetest.get_worldpath().."/future_banlist.txt")
            if file then
                file:write(minetest.serialize(future_ban_list))
                file:close()
            end
            minetest.chat_send_player(name, desc .. " to future ban list added.")
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")
        else
            local desc = minetest.get_ban_description(param)
            minetest.chat_send_player(name, "Banned " .. desc .. ".")
            minetest.log("action", name .. " bans " .. desc .. ".")
        end
    end
})

minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    for i,n in ipairs(future_ban_list) do
        if n == name then
            if not minetest.ban_player(name) then
                minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
            else
                local desc = minetest.get_ban_description(name)
                minetest.log("action", desc .. " banned (from future ban list).")
                table.remove(future_ban_list, i)
            end
        end
    end
end)

Posted: Sun Dec 30, 2012 18:32
by cactuz_pl
Still it doesn't remember list, future_banlist.txt doesn't exist (in world folder). But server starts.

When I created future_banlist.txt in world folder, I can see on server start:

Code: Select all

Server: error:
...(path to mod folder)/init.lua:49: bad argument #1 to

Code: Select all

minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    for i,n in ipairs(future_ban_list) do             <------------------------------ 49th line
        if n == name then
            if not minetest.ban_player(name) then
                minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
            else
                local desc = minetest.get_ban_description(name)
                minetest.log("action", desc .. " banned (from future ban list).")
                table.remove(future_ban_list, i)
            end
        end
    end
end)
Thanks

Posted: Sun Dec 30, 2012 20:05
by PilzAdam
cactuz_pl wrote:Still it doesn't remember list, future_banlist.txt doesn't exist (in world folder). But server starts.

When I created future_banlist.txt in world folder, I can see on server start:

Code: Select all

Server: error:
...(path to mod folder)/init.lua:49: bad argument #1 to

Code: Select all

minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    for i,n in ipairs(future_ban_list) do             <------------------------------ 49th line
        if n == name then
            if not minetest.ban_player(name) then
                minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
            else
                local desc = minetest.get_ban_description(name)
                minetest.log("action", desc .. " banned (from future ban list).")
                table.remove(future_ban_list, i)
            end
        end
    end
end)
Thanks
The mod generates the file. You cant add names to this file. You have to add them all in-game with the command.

Posted: Sun Dec 30, 2012 20:08
by cactuz_pl
So I did.

File is not created.

Yes I created it but after failure.

Posted: Sun Dec 30, 2012 20:14
by PilzAdam
cactuz_pl wrote:So I did.

File is not created.

Yes I made it but after failure.
New version (should fix the save issue):

Code: Select all

future_ban_list = {}

local file = io.open(minetest.get_worldpath().."/future_banlist.txt", "r")
if file then
    future_ban_list = minetest.deserialize(file:read("*all"))
    file:close()
    if not future_ban_list then
        future_ban_list = {}
    end
end

local function save_file()
    local file = io.open(minetest.get_worldpath().."/future_banlist.txt", "w")
    if file then
        file:write(minetest.serialize(future_ban_list))
        file:close()
    end
end

minetest.register_chatcommand("future_ban", {
    params = "<playername> | leave playername out to see the future ban list",
    description = "The player will be banned when trying to join",
    privs = {ban=true},
    func = function(name, param)
        if param == "" then
            minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
            return
        end
        if not minetest.env:get_player_by_name(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, param .. " to future ban list added.")
            minetest.log("action", name .. " added " .. param .. " to future ban list.")
            save_file()
            return
        end
        if not minetest.ban_player(param) then
            table.insert(future_ban_list, param)
            minetest.chat_send_player(name, desc .. " to future ban list added.")
            minetest.log("action", name .. " added " .. desc .. " to future ban list.")
            save_file()
        else
            local desc = minetest.get_ban_description(param)
            minetest.chat_send_player(name, "Banned " .. desc .. ".")
            minetest.log("action", name .. " bans " .. desc .. ".")
        end
    end
})

minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    for i,n in ipairs(future_ban_list) do
        if n == name then
            if not minetest.ban_player(name) then
                minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
            else
                local desc = minetest.get_ban_description(name)
                minetest.log("action", desc .. " banned (from future ban list).")
                table.remove(future_ban_list, i)
                save_file()
            end
        end
    end
end)

Posted: Sun Dec 30, 2012 20:21
by cactuz_pl
Now it works perfectly.

Thank you, and sorry for wasting your time. I hope you will create new topic with this mod.

Posted: Sun Dec 30, 2012 20:24
by PilzAdam
cactuz_pl wrote:Now it works perfectly.

Thank you, and sorry for wasting your time. I hope you will create new topic with this mod.
I dont want to create a topic, you can do this if you want to. License: WTFPL.