Page 1 of 1

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

PostPosted: 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
Git project page (with readme file): http://repo.or.cz/minetest_returnmirror.git
Mandatory dependencies: None.
Optional dependencies:

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

PostPosted: 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]

PostPosted: 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]

PostPosted: 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]

PostPosted: 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]

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

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

PostPosted: 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]

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

Version 1.0.2

PostPosted: 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]

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

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
minetest.register_alias("returnmirror:mirror_inactive", "returnmirror:returnmirror")


But it should be this, I believe:

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
minetest.register_alias("returnmirror:returnmirror", "returnmirror:mirror_inactive")

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

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

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
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]

PostPosted: 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]

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