[Mod] User-Settable Bookmarks [0.0] [bookmarks_0gb_us]
[Mod] User-Settable Bookmarks [0.0] [bookmarks_0gb_us]
There are at least three approaches you can take to public bookmarks. The easiest solution is to not use them. You could also have only server staff be able to add them, to prevent bookmark spamming. Or, you can let all users set bookmarks, and watch as you number of bookmarks becomes unmanageable.
This plugin takes the third approach, but also applies a cost to setting bookmarks, which should make users think before adding bookmarks they don't need. A user will lose 99 steel ingots from their own inventory every time they set a bookmark. If they don't have that many, the bookmark will not be set. There is currently no in-game way to remove bookmarks, as users may come to rely on the bookmarks that have been set by others. However, a log of what user created what bookmark is kept, in case administrative action must be taken.
In the future, I may add a way for the administrator to manage bookmarks from the inside.
While bookmarks can be used from the menu, a /goto command is also included, for warping to bookmark using its given name. However, setting bookmarks MUST be done from the menu. This is to make sure users see the warning about the cost of bookmarking, and the fact that they cannot move or remove their bookmark later.
Code license: GNU LGPL version 2
Image license: No images included.
Dependencies: inventory_plus
Download: http://0gb.us/minetest/download.php?plu ... 0gb_us-0.0
This plugin takes the third approach, but also applies a cost to setting bookmarks, which should make users think before adding bookmarks they don't need. A user will lose 99 steel ingots from their own inventory every time they set a bookmark. If they don't have that many, the bookmark will not be set. There is currently no in-game way to remove bookmarks, as users may come to rely on the bookmarks that have been set by others. However, a log of what user created what bookmark is kept, in case administrative action must be taken.
In the future, I may add a way for the administrator to manage bookmarks from the inside.
While bookmarks can be used from the menu, a /goto command is also included, for warping to bookmark using its given name. However, setting bookmarks MUST be done from the menu. This is to make sure users see the warning about the cost of bookmarking, and the fact that they cannot move or remove their bookmark later.
Code license: GNU LGPL version 2
Image license: No images included.
Dependencies: inventory_plus
Download: http://0gb.us/minetest/download.php?plu ... 0gb_us-0.0
I believe i have a better solution.
Make a new node "bookmark:bookmark".
Make it non buildable (do not register a craft for it).
Admins can then use /giveme to get those nodes.
the on_place event of the node sets a new bookmark and destroys the node.
If the server has my mint&automatic selling machine, admins can simply fill the machine with bookmarks and set a high price for the item, like 999 mesecoins.
Voilá. Problem solved in a natural way.
Make a new node "bookmark:bookmark".
Make it non buildable (do not register a craft for it).
Admins can then use /giveme to get those nodes.
the on_place event of the node sets a new bookmark and destroys the node.
If the server has my mint&automatic selling machine, admins can simply fill the machine with bookmarks and set a high price for the item, like 999 mesecoins.
Voilá. Problem solved in a natural way.
Your solution is no more "natural" than mine, and the problem is that it requires admin intervention to use. Also, with a node that sets bookmarks, how would you go about naming the bookmarks?
While your idea is a great solution for many servers, it doesn't really work for my port 30001's setup, where even the administrator lacks the "give" privilege. (Odd, I know.) I would probably install your style of bookmarks on my port 30000 though if you want to build it. And your mint and selling machine sounds interesting. I'll check it out.
While your idea is a great solution for many servers, it doesn't really work for my port 30001's setup, where even the administrator lacks the "give" privilege. (Odd, I know.) I would probably install your style of bookmarks on my port 30000 though if you want to build it. And your mint and selling machine sounds interesting. I'll check it out.
Steel ingots!?
You monster!
What's next losing 99 coal?
Why not take mese?
You monster!
What's next losing 99 coal?
Why not take mese?
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
Mods: Orichalcum Stonebricks Extra Chests
0gb_us is actually working on a better solution that requires in-game experience, but no actual items. Anyway, 0gb_us's new in-progress private warp points mod will supersede this.Chinchow wrote:Steel ingots!?
You monster!
What's next losing 99 coal?
Why not take mese?
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
The problem with deleting these bookmarks s that they are public. You might set a bookmark, and later, Chinchow and Rarkenin come to depend on your bookmark. Later you decide to delete it, but Chinchow and Rarkenin still need it. It's not fair to take that away from them.jojoa1997 wrote:could you add the ability to delete bookmarks. i have set it where i dont need anything to get bookmarks but i also cant delete them
That's one of the reasons I gave up on non-administrated public bookmarks for the time being.
There needs to be a high cost to setting bookmarks. It is a preventive measure to try to prevent bookmark spamming. Players have to think about whether they actually want a bookmark before they set one.Chinchow wrote:Steel ingots!?
You monster!
What's next losing 99 coal?
Why not take mese?
What would you suggest I charge instead of steel? It's got to be valuable enough that people will think before they bookmark unless we find a way to deal with over-bookmarking. Between the fact that many people want to bookmark things that don't really need bookmarks and the fact that they are not deletable, there needs to be some reason for users not to want to over use them. And if the world stays active for a long period of time, there will eventually be too many bookmarks. When you think long term, maybe bookmarks should cost nine stacks of steel blocks .... or maybe even a poptart cat .....
Besides, is a public bookmark of your far-off creation not worth the steel? If you bookmark a house, you may soon have your own town built around you by people using your bookmark.
But I'm not really continuing to develop this thing anyway until I find a better way to do this. For one thing, there needs to be a way to remove bookmarks. If bookmarks were removable, setting one wouldn't be such a big deal, and the price wouldn't need to be so high. I thought about imposing a limit per user, but people could register multiple accounts just to get extra bookmarks. Not a good idea to set that up. Plus, long time builders may need more warp points ....
That thing isn't really in progress, it's done. But the thing it depends on is in progress with no foreseeable release date, so I guess it might as well itself be in progress.rarkenin wrote:0gb_us is actually working on a better solution that requires in-game experience, but no actual items. Anyway, 0gb_us's new in-progress private warp points mod will supersede this.Chinchow wrote:Steel ingots!?
You monster!
What's next losing 99 coal?
Why not take mese?
Also, the private warp points don't supersede bookmarks_0gb_us, as this one adds public warp points which serve an entirely different purpose. The private warp points are actually planned to supersede inventorywarp_0gb_us, which allows the setting of only three private warp points, but for free.
I want to build a better version of this, but I need to figure out how to make it work well without staff intervention. No matter what I try to set up in regards to public bookmarking, there always seems to be a down side ....
could you make another mod which is a version of this that doesn't need to cost anything and you can delete them. like the one on your server but for singleplayer. or you could check to see if it is being used on a server and have it switch over to server mod.
Coding;
1X coding
3X debugging
12X tweaking to be just right
1X coding
3X debugging
12X tweaking to be just right
a delete function for bookmarks for your singleplayer-map....jojoa1997 wrote:could you make another mod which is a version of this that doesn't need to cost anything and you can delete them. like the one on your server but for singleplayer. or you could check to see if it is being used on a server and have it switch over to server mod.
replace the code in the init.lua file of the bookmark-mod...
DO NOT USE IT FOR YOUR SERVER...
Code: Select all
local filename = minetest.get_worldpath().."/bookmarks.0gb.us"
local logfilename = minetest.get_worldpath().."/log.bookmarks.0gb.us"
local bookmarks = {}
local page = {""}
local playerpage = {}
local function ceil(pos)
local x = math.ceil(pos.x)
local y = math.ceil(pos.y)
local z = math.ceil(pos.z)
return {x=x,y=y,z=z}
end
local function build_pages()
local x = 0
local y = 6
local z = 0
for key, value in pairs(bookmarks) do
if y == 6 then
y = 0
z = z + 1
page[z] = ""
end
page[z] = page[z].."button["..x..".5,"..y..";3,1;bookmark.bookmarks.0gb.us;"..key.."]"
x = x + 3
if x == 12 then
x = 0
y = y + 1
end
end
end
local function load()
local file = io.open(filename, "r")
if file then
for line in file:lines() do
if line ~= "" then
local space = line:find(" ", 1, true)
local key = line:sub(1, space-1)
local value = line:sub(space+1)
bookmarks[key] = minetest.string_to_pos(value)
end
end
file:close()
build_pages()
end
end
local function save()
local file = io.open(filename, "w")
for k,v in pairs(bookmarks) do
file:write(k.." "..minetest.pos_to_string(v).."\n")
end
file:close()
end
local function delete_bookmark(bookmark)
local file = io.open(filename, "w")
for k,v in pairs(bookmarks) do
if k == bookmark then
-- no nothing (del) element
else
file:write(k.." "..minetest.pos_to_string(v).."\n")
end
end
file:close()
end
local function log(user, bookmark)
local file = io.open(logfilename, "a")
file:write("user:",user," bookmark:",bookmark,"\n")
file:close()
end
minetest.register_on_joinplayer(function(player)
inventory_plus.register_button(player, "go.bookmarks.0gb.us", "Bookmarks")
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
local name = player:get_player_name()
if fields["go.bookmarks.0gb.us"] or fields["bookmark.bookmarks.0gb.us"] then
if fields["bookmark.bookmarks.0gb.us"] then
player:setpos(bookmarks[fields["bookmark.bookmarks.0gb.us"]])
--minetest.chat_send_player(name, "Teleporting to "..fields["bookmark.bookmarks.0gb.us"])
end
if not playerpage[name] then
playerpage[name] = 1
elseif fields["go.bookmarks.0gb.us"] == "<<" then
playerpage[name] = ((playerpage[name] - 2) % #page) +1
elseif fields["go.bookmarks.0gb.us"] == ">>" then
playerpage[name] = (playerpage[name] % #page) + 1
end
inventory_plus.set_inventory_formspec(player,
"size[13,7.5]"..
"button[0.5,6.5;3,1;main;main menu]"..
"button[3.6,6.5;1,1;go.bookmarks.0gb.us;<<]"..
"button[4.8,6.5;1,1;go.bookmarks.0gb.us;>>]"..
"button[6.1,6.5;3,1;set.bookmarks.0gb.us;Set Bookmark]"..
"button[9.1,6.5;3,1;del.bookmarks.0gb.us;Del Bookmark]"..
page[playerpage[name]]
)
elseif fields["del.bookmarks.0gb.us"] then
inventory_plus.set_inventory_formspec(player,
"size[13,7.5]"..
"field[8.3,3;4,1;name.bookmarks.0gb.us;Bookmark Name:;]"..
"button[8,3.5;4,1;del.bookmarks.0gb.us;Del Bookmark]"..
"button[0.5,6.5;3,1;main;main menu]"..
"button[9.1,6.5;3,1;go.bookmarks.0gb.us;Back to Bookmarks]"
)
if fields["name.bookmarks.0gb.us"] then
if not string.find(fields["name.bookmarks.0gb.us"], "^[%w_%-]+$") then
--minetest.chat_send_player(name, "The chosen bookmark name contains invalid characters, or is blank.")
--elseif bookmarks[fields["name.bookmarks.0gb.us"]] then
-- minetest.chat_send_player(name, "The chosen bookmark name is already in use.")
elseif fields["name.bookmarks.0gb.us"]:len() > 19 then
--minetest.chat_send_player(name, "The bookmark name may have no more than nineteen characters.")
else
-- delete bookmark
delete_bookmark(fields["name.bookmarks.0gb.us"])
--minetest.chat_send_player(name, "Bookmark deleted: "..fields["name.bookmarks.0gb.us"])
bookmarks = {}
load()
log(name, fields["name.bookmarks.0gb.us"].." deleted")
end
end
elseif fields["set.bookmarks.0gb.us"] then
inventory_plus.set_inventory_formspec(player,
"size[13,7.5]"..
"field[8.3,3;4,1;name.bookmarks.0gb.us;Bookmark Name:;]"..
"button[8,3.5;4,1;set.bookmarks.0gb.us;Set Bookmark]"..
"button[0.5,6.5;3,1;main;main menu]"..
"button[9.1,6.5;3,1;go.bookmarks.0gb.us;Back to Bookmarks]"
)
if fields["name.bookmarks.0gb.us"] then
if not string.find(fields["name.bookmarks.0gb.us"], "^[%w_%-]+$") then
--minetest.chat_send_player(name, "The chosen bookmark name contains invalid characters, or is blank.")
--elseif bookmarks[fields["name.bookmarks.0gb.us"]] then
-- minetest.chat_send_player(name, "The chosen bookmark name is already in use.")
elseif fields["name.bookmarks.0gb.us"]:len() > 19 then
--minetest.chat_send_player(name, "The bookmark name may have no more than nineteen characters.")
else
local inv = player:get_inventory()
local pos = player:getpos()
bookmarks[fields["name.bookmarks.0gb.us"]] = ceil(pos)
save()
--minetest.chat_send_player(name, "Bookmark created: "..fields["name.bookmarks.0gb.us"])
build_pages()
log(name, fields["name.bookmarks.0gb.us"].." created")
end
end
end
end)
minetest.register_chatcommand("goto", {
params = "<bookmark>",
description = "warps you to a bookmarked location",
privs = {},
func = function(name, param)
if bookmarks[param] then
local player = minetest.env:get_player_by_name(name)
player:setpos(bookmarks[param])
else
minetest.chat_send_player(name, "No bookmark by that name exists.")
end
end
})
load()
u can set bookmarks as many as u like... u dont need any ingots for it...jojoa1997 wrote:thank you so much. now it is awesome.cHyper wrote:a delete function for bookmarks for your singleplayer-map....
replace the code in the init.lua file of the bookmark-mod...
DO NOT USE IT FOR YOUR SERVER...
u can update bookmarks by set it with the same bookmark-name...
nice. i already figured out how to get rid of the need for steel.cHyper wrote:u can set bookmarks as many as u like... u dont need any ingots for it...jojoa1997 wrote:thank you so much. now it is awesome.cHyper wrote:a delete function for bookmarks for your singleplayer-map....
replace the code in the init.lua file of the bookmark-mod...
DO NOT USE IT FOR YOUR SERVER...
u can update bookmarks by set it with the same bookmark-name...
Coding;
1X coding
3X debugging
12X tweaking to be just right
1X coding
3X debugging
12X tweaking to be just right
Never mind i found out the problem. I had a space so i guess the mod can't read spaces.
Old Post:for some reason i have tested it more now and the bookmarks wont set
Old Post:for some reason i have tested it more now and the bookmarks wont set
Last edited by jojoa1997 on Sun Feb 17, 2013 19:55, edited 1 time in total.
Coding;
1X coding
3X debugging
12X tweaking to be just right
1X coding
3X debugging
12X tweaking to be just right
You put a space where? The only thing this plugin reads is the bookmark file, which reads spaces as delimiters. It reads spaces just fine.jojoa1997 wrote:Never mind i found out the problem. I had a space so i guess the mod can't read spaces.
Old Post:for some reason i have tested it more now and the bookmarks wont set
I'm not releasing another version of this without a cost. Publicly settable public bookmarks NEED a cost or they'll be abused. Being able to overwrite old bookmarks also allows one person to overwrite another person's bookmark, intentionally or not. Do whatever you want with the code, but don't blame me if that doesn't go well.
The one on my server won't help you. It's not Windows compatible, and you run Windows. It had issues when run on Windows, but as of last night, it literally won't start on Windows. Then again, the next version of this will likely also not be Windows compatible. To save RAM, it won't store all the bookmarks in memory. Each bookmark will have a separate file, named the same as the bookmark so it can be easily found and parsed when needed. As soon as you're dealing with arbitrary files named arbitrary thing, Windows's lack of case sensitivity gets in the way. There's nothing I can do about that. Sorry.
Don't remove the cost if it is causing so much trouble to remove it. Instead, set the cost to zero steel ingots. The system on my server also has a cost, which I set to zero.
i thought you use a warp mod not this one. also the name was "cubby hole" but when i renamed it to "cubby_hole" it worked. also if you do make it windows incompatible then keep a working "Old" download in the topic so other windows users can use it.
Coding;
1X coding
3X debugging
12X tweaking to be just right
1X coding
3X debugging
12X tweaking to be just right
This is something I used to use, in an old world. What I currently use is heavily based on this one, borrowing much of it's code. However, that one is not available for download, due to fear of misuse. This one can probably be adapted to be something similar, though less optimized. I don't have time for that though.jojoa1997 wrote:i thought you use a warp mod not this one. also the name was "cubby hole" but when i renamed it to "cubby_hole" it worked. also if you do make it windows incompatible then keep a working "Old" download in the topic so other windows users can use it.
Okay, got it. If you use the in-game menu to set the bookmarks, it will tell you if you try to use a character it does not allow. It allows all characters that are allowed in user names. Though I haven't looked at the code in a while, my guess is that what you wrote in the file created a bookmark called "cubby" that leads to the coordinates "hole". Obviously that's not a valid set of coordinates, so I don't know what woul dhappen if you used the cubby bookmark.
As I always do, I'll keep a list of old downloads up, so old versions will still be available. However, any bug fixes and new features will not be added to old versions.
A friend of ours says he's working on something to improve key/value handling, so the dropped Windows support may not even need to happen. I just got word of this today. By the time I find a way to make the next step in this plugin's development (IF I even find a way), a viable Windows way may be possible.
- terminalerror
- Member
- Posts: 33
- Joined: Tue Oct 30, 2012 22:46
- Location: The Sar-Chasm
Maybe you can make the cost of iron increasingly higher. For example, the first bookmark (usually one's house) can be cheap...say, around 10 iron at worst. For the next couple bookmarks, the price could rise to 20, 30, 50, etc. until the 99 mark is reached. From there, the price will remain at 99 steel ingots per bookmark. I don't know how you could implement this, though. Just my two cents.
ERROR[main]: ModError: Failed to load and run a sarcastic remark.
That probably wouldn't be to hard to implement, but comes with two problems. First, that encourages the first bookmark. If that was your house, we'd end up with warp points leading to everyone's houses, even when one house was visible from another. Bookmark over use would be a problem, and the public bookmark list would become increasingly cluttered. Second, people could create extra accounts to get around the increasing cost. It wouldn’t be the first time extra accounts were used to bypass a system I wrote.terminalerror wrote:Maybe you can make the cost of iron increasingly higher. For example, the first bookmark (usually one's house) can be cheap...say, around 10 iron at worst. For the next couple bookmarks, the price could rise to 20, 30, 50, etc. until the 99 mark is reached. From there, the price will remain at 99 steel ingots per bookmark. I don't know how you could implement this, though. Just my two cents.
Sounds good. Also sounds like two separate plugins, such as this one and the one we use on our server.jojoa1997 wrote:why not have 2 lists. a public and a private. it would cost 10 steel for the private but if you want to showcase something you would have to make a 99 steel payment to get on the public list.
I didn't think it was like the one on our server. If you could find a way to add a private list with a delete button then that would be awesome. I think you should not have deleting cost anything since you would be losing 10 steel. I y hope this can work out :-)0gb.us wrote:Sounds good. Also sounds like two separate plugins, such as this one and the one we use on our server.jojoa1997 wrote:why not have 2 lists. a public and a private. it would cost 10 steel for the private but if you want to showcase something you would have to make a 99 steel payment to get on the public list.
Coding;
1X coding
3X debugging
12X tweaking to be just right
1X coding
3X debugging
12X tweaking to be just right
The one on our server has the private list menu (with a delete button) and a delete command. Both refund the original price of the bookmark. I set the cost to zero, but normally, there is a price.jojoa1997 wrote:I didn't think it was like the one on our server. If you could find a way to add a private list with a delete button then that would be awesome. I think you should not have deleting cost anything since you would be losing 10 steel. I y hope this can work out :-)0gb.us wrote:Sounds good. Also sounds like two separate plugins, such as this one and the one we use on our server.jojoa1997 wrote:why not have 2 lists. a public and a private. it would cost 10 steel for the private but if you want to showcase something you would have to make a 99 steel payment to get on the public list.
You do that within the file.jojoa1997 wrote:ok then set a price
Admin pro tempore on 0gb.us:30000. Ask me if you have a problem, or just want help.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
This is a signature virus. Add me to your signature so that I can multiply.
Now working on my own clone, Mosstest.
I guess I'm back for some time.
There is a price, and it is processed upon each bookmarking. The price is just set to zero. The same holds true of the land claims we use.
The main reason I set the price to zero is to prevent unbalance. Due to mechanics of the game, the only minimalistic monetary system I could come up with involves earning "points" as you mine ore. These points can be later spent on things such as land claims and bookmarks. Aside from ore, no other node may be mined for points. Why not? Because the user can mine and place the same node repeatedly to up their points. As ore cannot be placed, cheating in this way isn't possible (assuming the user lacks the give privilege). So we base the economy on ore mining. What's the problem? The problem is that people who prefer to play in the underworld, such as myself, are practically loaded, and can buy whatever we want. Meanwhile, people who prefer to play in the overworld are often broke.
The main reason I set the price to zero is to prevent unbalance. Due to mechanics of the game, the only minimalistic monetary system I could come up with involves earning "points" as you mine ore. These points can be later spent on things such as land claims and bookmarks. Aside from ore, no other node may be mined for points. Why not? Because the user can mine and place the same node repeatedly to up their points. As ore cannot be placed, cheating in this way isn't possible (assuming the user lacks the give privilege). So we base the economy on ore mining. What's the problem? The problem is that people who prefer to play in the underworld, such as myself, are practically loaded, and can buy whatever we want. Meanwhile, people who prefer to play in the overworld are often broke.
Who is online
Users browsing this forum: No registered users and 4 guests