Page 1 of 2

[Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Sat Feb 14, 2015 07:02
by Wuzzy
The Mirror of Returning is a magical item, which, when activated, will teleport you to a certain spot which it has previously remembered.

A new mirror will always be black and has no knowledge of any destination. You can not teleport by using it yet.

Rightclick with it while pointing to something to set the mirror's destination. The mirror will magically remember your position and it becomes gray.
To teleport to the previously set position, leftclick with the mirror once. This will make a loud sound at both source and destination and creates a lot of visible particles, so you will probably catch the attention of others.
You can set a new mirror's destination with a rightclick, but the mirror will then forget the previous destination. A mirror does not have that much memory, after all.

Screenshot shortly taken after teleporting:
Image

If you have the Mana mod installed, using the mirror comes at a mana price:
  • Setting the destination: 20
  • Teleporting: 200
The values work best with the default values of the Mana mod, but the values can also be configured freely with in server settings, see the README.md file. This is useful for server operators and subgame makers. And cheaters. ;-)

The itemstring of a new mirror of returning is “returnmirror:returnmirror”. Use /giveme or creative mode to obtain it.

License of everything: WTFPL
Works in Minetest 0.4.16 or later
Git project page (with readme file): https://codeberg.org/Wuzzy/minetest_returnmirror
Mandatory dependencies: None.
Optional dependencies:

Re: [Mod] Mirror of Returning [0.1.0] [returnmirror]

Posted: Sat Feb 14, 2015 12:48
by guideahon
Maybe if pointed thing is nothing, then, player pos +1 in that axis, else, pointed thing pos +1 in Z

Re: [Mod] Mirror of Returning [0.1.0] [returnmirror]

Posted: Sat Feb 14, 2015 13:47
by ExeterDad
Looks really awesome!
The particles will really add a lot to the "feel" of it.

Re: [Mod] Mirror of Returning [0.1.0] [returnmirror]

Posted: Sat Feb 14, 2015 15:58
by davidthecreator
If it teleported player to its spawn point it would almost be like terraria's magic mirror

Re: [Mod] Mirror of Returning [0.1.0] [returnmirror]

Posted: Sat Feb 14, 2015 16:09
by Wuzzy
@guideahon: Sorry, this does not work. Rightclick is not recognized when nothing is pointed. I use the on_place callback for that, and the weird on_rightclick only works for nodes which are rightclicked on, so it is not usable for tools.
@davidthecreator: Players do not intrinsically have a spawn point in Minetest; it only is articifially added by mods. The way Minetest spawns players when static_spawn_point is not set is pretty weird and not well exposed to the Lua API. If there was a sane way to set a “player's” spawn point which does not carry along unwanted mod stuff with it, I would use it. But so far, all “spawn setter” mods I know so far all carry along their own stuff.

Re: [Mod] Mirror of Returning [0.1.0] [returnmirror]

Posted: Sun Feb 15, 2015 14:26
by davidthecreator
But spawnpoint can be set with bed if its mod is installed plus the mirror could take the player to the place he spawned or respawned the last time

Version 1.0.0

Posted: Mon Aug 08, 2016 06:28
by Wuzzy
Version 1.0.0 released!

Changes:
- Setting teleport position with rightclick will work without (almost) any exceptions
- Pointing range of mirror reduced to 0 because it is pointless
- Added intllib support (viewtopic.php?f=11&t=4929)
- Added German translation
- Added in-game item documentation via doc_items (viewtopic.php?f=9&t=15300)
- Added metadata files
- Added sound for failed teleportations
- Change mirror texture, now it looks more like hand mirror

Also, I have added a Git project page on the first post.

Version 1.0.1

Posted: Fri Nov 18, 2016 23:55
by Wuzzy
Version 1.0.1 released! This is a bugfix and maintenance release.

Changes:
- Fix mod not working when both intllib and mod security are enabled
- Compability with Documentation System 0.7.0
- Get rid of global variables (fixes potentional issues with mod interopability)

Re: [Mod] Mirror of Returning [1.0.1] [returnmirror]

Posted: Sun Nov 20, 2016 16:31
by Andrey01
Probably to do a real mirror in MineTest?Or no?

Version 1.0.2

Posted: Thu Dec 29, 2016 02:15
by Wuzzy
Version 1.0.2 released! This is a compability release to provide compability with the Help modpack, version 1.0.0.

Updating this mod is required if you use the new version of the Help modpack, otherwise, it will stop working.

Re: [Mod] Mirror of Returning [1.0.2] [returnmirror]

Posted: Thu Dec 29, 2016 03:58
by echosa
I think there's an issue with your alias. When it gets loaded, a warning shows up in the log saying that the alias isn't created, because the item already exists. I think the issue is that your arguments are backwards. You have this:

Code: Select all

minetest.register_alias("returnmirror:mirror_inactive", "returnmirror:returnmirror")
But it should be this, I believe:

Code: Select all

minetest.register_alias("returnmirror:returnmirror", "returnmirror:mirror_inactive")

Re: [Mod] Mirror of Returning [1.0.2] [returnmirror]

Posted: Thu Dec 29, 2016 04:28
by echosa
Also, I get this warning:

Code: Select all

2016-12-28 22:25:27: WARNING[Server]: Undeclared global variable "pos" accessed at ...rt/minetest/games/echosa_game/mods/returnmirror/init.lua:136

Re: [Mod] Mirror of Returning [1.0.2] [returnmirror]

Posted: Thu Mar 30, 2017 21:33
by Wuzzy
I just want to repost this:
echosa wrote:The Mirror of Returning mod is one of my favorites. Tonight, I'm very thankful for it. :-D

https://www.twitch.tv/videos/132148683

Re: [Mod] Mirror of Returning [1.0.2] [returnmirror]

Posted: Fri Mar 31, 2017 14:31
by echosa
:-) Also, the mirror comes is really handy when digging deep. Set one to the surface, and keep another one that you can set to where you are before you travel back home. Instant way to get back to where you left off.

One feature request, though maybe this is something more global than just this one mod: is there a way I could give different mirrors a name? That way, when I have multiple mirrors, I don't accidentally confuse them. :-)

Also, a recipe would be nice, but I added my own, so that's not really much of an issue. :-)

Re: [Mod] Mirror of Returning [1.0.2] [returnmirror]

Posted: Wed May 31, 2017 22:19
by echosa
The Mirror of Returning doesn't work with the new engraving table mod, because the engraving table requires right-clicking the table with an item to use it but the mirror already binds right-click. Is there a way for you to fix this, please? The author of the engraving table mod said this is something that needs to be fixed in the mirror mod.

viewtopic.php?f=11&t=17482&p=274011#p274011

Though, I'd prefer if the engraving table mod didn't rely on right-click, but instead relied on an interface where you put the item in. However, this is beyond just the engraving table. I can't open a door or a chest when holding the mirror, either.

Version 1.0.3 released! Version 1.0.4 released!

Posted: Wed May 31, 2017 22:59
by Wuzzy
Version 1.0.3 released!
- Fix broken alias
- Allow to use pointed node (like engraving table, door, item frame, etc.)

Warning! The mirror only has a pointing range of 2. The mirror is not really meant for pointing. ;-)

Version 1.0.4 released!
- Fix another global variable warning

Thanks to echosa for reporting the bug.

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Thu Jun 01, 2017 16:32
by echosa
Awesome! Thanks! I look forward to trying this out.

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Fri Jun 09, 2017 08:08
by PinkCat
I like this mod. Just tested it. Cool

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Fri Jan 04, 2019 17:50
by Gibeinumo
I like the mirror, but could you add a recipe? I think it is very useful for a singleplayer in survival mode.

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Mon Nov 25, 2019 11:04
by FreeGamers
Wuzzy,

is there some way I can force any mirror to only return players to their bed spawn point?

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Mon Nov 25, 2019 22:39
by Wuzzy
No.

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Mon Nov 25, 2019 22:49
by FreeGamers
OK, I'll look into it.

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Tue Dec 03, 2019 14:03
by FreeGamers
With the help of davidthecreator, I was able to eventually get the version of mod I wanted.

He made a similar mod that is based off of timers and returns a user to their beds.

I took his mod as a foundation and used aspects of yours to add mana support to end up with a mod that works a bit more like how I envisioned. Players can only use this version to return to their beds. This has been a much requested function by players in my server. My world and biomes go to -16,000 just for earth alone. Climbing up ladders is too mundane to make them do it manually. I tried to alleviate this with elevators but it still was too vast a distance for them to build shafts into.

This project took me about 8 hours and it taught me a bit more about functions and the difference between local and global variables as well as some other things. So thanks to Wuzzy and davidthecreator for the contributions.

Here is my version of this mod.

https://www.notabug.org/FreeGamers/Sara ... gic_mirror

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Tue Dec 03, 2019 16:35
by Wuzzy
If this mod is a serious mod and not just a temporary experiment, it should be posted in a new thread. Otherwise it will be impossible to find.

Re: [Mod] Mirror of Returning [1.0.4] [returnmirror]

Posted: Tue Dec 03, 2019 20:11
by FreeGamers
The repo there is the first repo I've ever made and so far I know how to add, commit, and push. The way I have it hosted, I would need to make a git submodule or subtree for it. Is that worthwhile to attempt or would you recommend something else? I'm somewhat new to programming and git.

I don't mind maintaining it.