[Mod] Sethome [sethome]

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

[Mod] Sethome [sethome]

by xyz » Post

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

radg
Member
Posts: 13
Joined: Sun Aug 07, 2011 15:45

by radg » Post

xyz wrote:It may be cheaty some way, but it is really helpful.
Probably you should add cooldown.

sfan5
Moderator
Posts: 4095
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

radg wrote:
xyz wrote:It may be cheaty some way, but it is really helpful.
Probably you should add cooldown.
+2
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
redcrab
Member
Posts: 833
Joined: Tue Dec 13, 2011 13:45
Location: France
Contact:

by redcrab » Post

+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 ;) )
Last edited by redcrab on Fri Jan 06, 2012 14:03, edited 1 time in total.
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.

User avatar
jordan4ibanez
Member
Posts: 1923
Joined: Tue Sep 27, 2011 18:44
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Post

this needs to be added into the default mods folder
+1
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
Hackeridze
Member
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Post

+9k
My game: RTMG
GENTOO USER

User avatar
Hackeridze
Member
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Post

Added to RTMMP.
My game: RTMG
GENTOO USER

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

Updated, got cooldown and max_distance settings.

Michael Eh?
Member
Posts: 391
Joined: Sun Jan 01, 2012 17:21

by Michael Eh? » Post

I was thinking this as an extension of teleport command.

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

User avatar
Alienhunter3010
Member
Posts: 12
Joined: Sat Nov 03, 2012 07:58

by Alienhunter3010 » Post

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
Last edited by Alienhunter3010 on Wed Dec 26, 2012 15:27, edited 1 time in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

Alienhunter3010, nice additions! +1

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

Nice! Already added your update to my server.
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

User avatar
Alienhunter3010
Member
Posts: 12
Joined: Sat Nov 03, 2012 07:58

by Alienhunter3010 » Post

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!)

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

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 :)

wulfsdad
Member
Posts: 45
Joined: Tue Dec 04, 2012 10:38
GitHub: hildigerr

by wulfsdad » Post

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.

User avatar
VanessaE
Moderator
Posts: 4655
Joined: Sun Apr 01, 2012 12:38
GitHub: VanessaE
IRC: VanessaE
In-game: VanessaE
Location: Western NC
Contact:

by VanessaE » Post

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)
You might like some of my stuff: Plantlife ~ More Trees ~ Home Decor ~ Pipeworks ~ HDX Textures (64-512px)

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

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 ;)

User avatar
LionsDen
Member
Posts: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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.

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.

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.

User avatar
Element
Member
Posts: 269
Joined: Tue Jun 11, 2013 00:27
IRC: Elementwing4962
In-game: Elementwing4962
Location: New York
Contact:

by Element » Post

how many homes can i set
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Element wrote:how many homes can i set
1
Back from the dead!

User avatar
LionsDen
Member
Posts: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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.

User avatar
ak399g
Member
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR
Contact:

by ak399g » Post

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.
Last edited by ak399g on Mon Sep 02, 2013 02:49, edited 1 time in total.
aka SAFR

User avatar
LionsDen
Member
Posts: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Post

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.

User avatar
ak399g
Member
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR
Contact:

by ak399g » Post

Didn't have Alienhunter's new init.lua. Works now.
aka SAFR

User avatar
fireglow
Member
Posts: 93
Joined: Fri Mar 28, 2014 11:36
IRC: fireglow
In-game: fireglow
Location: Germany

Re: [Mod] Sethome [sethome]

by fireglow » Post

Does anybody have a recent version of Alienhunters fork?
The UbuntuOne link doesn't work anymore :-/

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 41 guests