Page 1 of 1

[Mod] Sethome [sethome]

PostPosted: Fri Jan 06, 2012 05:58
by xyz
Sethome allows users to set their home position (using /sethome) and then teleport to it (using /home). It may be cheaty some way, but it is really helpful.

License: WTFPL
Dependencies: default

Download (slightly outdated version)
github repository

PostPosted: Fri Jan 06, 2012 11:52
by radg
xyz wrote:It may be cheaty some way, but it is really helpful.

Probably you should add cooldown.

PostPosted: Fri Jan 06, 2012 13:35
by sfan5
radg wrote:
xyz wrote:It may be cheaty some way, but it is really helpful.

Probably you should add cooldown.

+2

PostPosted: Fri Jan 06, 2012 14:01
by redcrab
+1 I like the idea to have a limited teleport feature...

Too avoid the abuse, you may do a teleport with a maximum 1000 block aways from home otherwise don't move or move a distance of 1000 block in home direction . and die if the partial player move stopped into a stone. hehe

or also depnding of the distance, the command gives damages ;) (light speed is not a human stuff ;) )

PostPosted: Fri Jan 06, 2012 14:21
by jordan4ibanez
this needs to be added into the default mods folder
+1

PostPosted: Fri Jan 06, 2012 16:43
by Hackeridze
+9k

PostPosted: Fri Jan 06, 2012 23:26
by Hackeridze
Added to RTMMP.

PostPosted: Sat Jan 07, 2012 11:38
by xyz
Updated, got cooldown and max_distance settings.

PostPosted: Thu Feb 09, 2012 18:57
by Michael Eh?
I was thinking this as an extension of teleport command.

/teleport sethome - set 'home' to current location
/teleport home - teleport to home location

PostPosted: Wed Dec 26, 2012 15:06
by Alienhunter3010
Merry Xmas to all.

I've add bookmark support to /sethome and /home commands.

You are free to download the init.lua file from here

http://ubuntuone.com/3wZcAwpSjLU7TM9bJxx8n6

Some examples:

/sethome shop

/home shop

(set and teleport to the 'shop' bookmark of the player)

For admins:

/sethome PoliceStation JohnDoe
/home PoliceStation JohnDoe

(set and teleport the user 'JohnDoe' to the 'PoliceStation' bookmark)

default home location still works:

/sethome

/home

(set and teleport to the default bookmark of the player)

You can also show bookmarks labels:

/showhomes

for admins:

/showhomes JohnDoe

PostPosted: Wed Dec 26, 2012 16:59
by 4aiman
Alienhunter3010, nice additions! +1

PostPosted: Wed Dec 26, 2012 22:37
by VanessaE
Nice! Already added your update to my server.

PostPosted: Thu Dec 27, 2012 09:35
by Alienhunter3010
VanessaE wrote:Nice! Already added your update to my server.


Let me know if something wrong...

I'm not so sure about RegExp in Lua, they seems to be a bit different from Perl or PHP ones...

And I see that if something is wrong on the mod code my local server DUMP (this is a really BAD thing!)

PostPosted: Wed Jan 09, 2013 19:55
by 4aiman
I found a bug! ;)
If you save your position in some world... and then go to another... and try to "/home"... yep, you gonna find yourself in the middle of nowhere. 'Cause /sethome do not store world name :)

PostPosted: Wed Jan 09, 2013 20:49
by wulfsdad
4aiman wrote:I found a bug! ;)
If you save your position in some world... and then go to another... and try to "/home"... yep, you gonna find yourself in the middle of nowhere. 'Cause /sethome do not store world name :)


There is a configuration option to store the homes locally to the world in the init file.

PostPosted: Sun Feb 10, 2013 17:21
by VanessaE
Alienhunter3010, another bug in your fork has cropped up:

A user tried to "/sethome xxxx", which caused the server to crash with:

12:19:19: ERROR[main]: ERROR: An unhandled exception occurred: ServerError: LuaE
rror: error: .../.minetest/games/vanessae_game/mods/sethome/init.lua:168: attemp
t to index local 'output' (a nil value)

PostPosted: Sun Feb 10, 2013 17:44
by 4aiman
wulfsdad wrote:There is a configuration option to store the homes locally to the world in the init file.

Then that should be default behaviour ;)

PostPosted: Sat Jun 08, 2013 10:03
by LionsDen
I wanted the local worlds save files so I looked at the code and figured out how to do this. It is easy to do as the code has already been written and is just commented out. Two changes to two lines will make this change.

In the sethome directory, there is a file called init.lua, you should create a backup in case something happens. Load the file init.lua into a text editor (I used Notepad++) and change the following two lines, line 13 and 14.

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
local homes_file = minetest.get_modpath('sethome')..'/homes'
--local homes_file = minetest.get_worldpath() .. "/homes"


They should be changed to look like this.

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
--local homes_file = minetest.get_modpath('sethome')..'/homes'
local homes_file = minetest.get_worldpath() .. "/homes"


All that needed to be done was to add two dashes, the -- to the beginning of line 13 and delete the two dashes, the -- from the beginning of line 14. You just need to save the file and then you can load up minetest and have different worlds using the same position names. I hope this helps anyone that wanted this and had no clue how to do it.

PostPosted: Fri Aug 30, 2013 16:12
by Element
how many homes can i set

PostPosted: Fri Aug 30, 2013 16:26
by Evergreen
Element wrote:how many homes can i set
1

PostPosted: Fri Aug 30, 2013 18:17
by LionsDen
Evergreen wrote:
Element wrote:how many homes can i set
1


Only 1 if you use /sethome by itself. But you can set more locations by adding some text after.

Example:

/sethome mine

will set a location that when you type /home mine it will take you there. So technically it is 1 if you want to use the /home command alone, but many more with location identifiers after the /sethome command.

One warning, if you have multiple worlds, the home position and named positions are the same coordinates in every world so they will overwrite one another unless you make the modification to the lua file that I have mentioned in a post above.

PostPosted: Mon Sep 02, 2013 02:31
by ak399g
LionsDen wrote:
Evergreen wrote:
Element wrote:how many homes can i set
1


Only 1 if you use /sethome by itself. But you can set more locations by adding some text after.

Example:

/sethome mine

will set a location that when you type /home mine it will take you there. So technically it is 1 if you want to use the /home command alone, but many more with location identifiers after the /sethome command.

One warning, if you have multiple worlds, the home position and named positions are the same coordinates in every world so they will overwrite one another unless you make the modification to the lua file that I have mentioned in a post above.


This is not quite correct. It is not "/sethome [location]", it is "/sethome <player>" -- by creating that location identifier, you will be effectively using up a player slot.

To be safer and courteous to other players, prefix your home location with your username. "mine" becomes "<player>_mine" or something like that. In this way, you can't set a home name that is someone else's username, and you can set "<player1>_mine" and "<player2>_mine" so that both players can have mines, preventing from one player from creating "/home mine" and preventing all other players from using that.

Of course, all this only works if they have the "home_other" and "sethome_other" priveleges. If they don't, they can only set one home.

PostPosted: Mon Sep 02, 2013 04:32
by LionsDen
ak399g wrote:This is not quite correct. It is not "/sethome [location]", it is "/sethome <player>" -- by creating that location identifier, you will be effectively using up a player slot.

To be safer and courteous to other players, prefix your home location with your username. "mine" becomes "<player>_mine" or something like that. In this way, you can't set a home name that is someone else's username, and you can set "<player1>_mine" and "<player2>_mine" so that both players can have mines, preventing from one player from creating "/home mine" and preventing all other players from using that.


Nope, wrong.

Look at your homes file and the sethome's init.lua file. The player's name is stored with the location name. You are not overwriting anyone else's locations. Maybe you were looking at an old version but the version that I downloaded months ago stores the player info with the location and the location name.

PostPosted: Tue Sep 03, 2013 02:01
by ak399g
Didn't have Alienhunter's new init.lua. Works now.

Re: [Mod] Sethome [sethome]

PostPosted: Sat Mar 28, 2015 21:57
by fireglow
Does anybody have a recent version of Alienhunters fork?
The UbuntuOne link doesn't work anymore :-/

Re: [Mod] Sethome [sethome]

PostPosted: Sun Mar 29, 2015 18:31
by mahmutelmas06
fireglow wrote:Does anybody have a recent version of Alienhunters fork?
The UbuntuOne link doesn't work anymore :-/


sethome is a part of default game. Dont need to download

Re: [Mod] Sethome [sethome]

PostPosted: Sun Mar 29, 2015 23:55
by fireglow
mahmutelmas06 wrote:
fireglow wrote:Does anybody have a recent version of Alienhunters fork?
The UbuntuOne link doesn't work anymore :-/


sethome is a part of default game. Dont need to download

I'm particularly interested in the additions Alienhunter made, such as multiple home locations.