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

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

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

by Wuzzy » Post

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): http://repo.or.cz/minetest_returnmirror.git
Mandatory dependencies: None.
Optional dependencies:
Attachments
returnmirror1.0.4.zip
(124.99 KiB) Downloaded 242 times
Last edited by Wuzzy on Fri Dec 01, 2017 09:40, edited 9 times in total.

guideahon
Member
Posts: 37
Joined: Mon Jan 26, 2015 12:49
In-game: guideahon

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

by guideahon » Post

Maybe if pointed thing is nothing, then, player pos +1 in that axis, else, pointed thing pos +1 in Z

User avatar
ExeterDad
Member
Posts: 1717
Joined: Sun Jun 01, 2014 20:00
In-game: ExeterDad
Location: New Hampshire U.S.A

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

by ExeterDad » Post

Looks really awesome!
The particles will really add a lot to the "feel" of it.

User avatar
davidthecreator
Member
Posts: 359
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

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

by davidthecreator » Post

If it teleported player to its spawn point it would almost be like terraria's magic mirror

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

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

by Wuzzy » Post

@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.

User avatar
davidthecreator
Member
Posts: 359
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

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

by davidthecreator » Post

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

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.0.0

by Wuzzy » Post

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.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.0.1

by Wuzzy » Post

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)
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Andrey01
Member
Posts: 2443
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

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

by Andrey01 » Post

Probably to do a real mirror in MineTest?Or no?

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.0.2

by Wuzzy » Post

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.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

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

by echosa » Post

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

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

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

by echosa » Post

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

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

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

by Wuzzy » Post

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
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

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

by echosa » Post

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

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

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

by echosa » Post

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.

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Version 1.0.3 released! Version 1.0.4 released!

by Wuzzy » Post

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.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

echosa
Member
Posts: 107
Joined: Tue Aug 30, 2016 04:01

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

by echosa » Post

Awesome! Thanks! I look forward to trying this out.

PinkCat
Member
Posts: 25
Joined: Fri May 19, 2017 11:33

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

by PinkCat » Post

I like this mod. Just tested it. Cool

Gibeinumo
Member
Posts: 30
Joined: Tue Oct 23, 2018 07:19

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

by Gibeinumo » Post

I like the mirror, but could you add a recipe? I think it is very useful for a singleplayer in survival mode.

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

Wuzzy,

is there some way I can force any mirror to only return players to their bed spawn point?
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

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

by Wuzzy » Post

No.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

OK, I'll look into it.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

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
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

User avatar
Wuzzy
Member
Posts: 4086
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

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

by Wuzzy » Post

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.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
FreeGamers
Member
Posts: 651
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

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

by FreeGamers » Post

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.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on the forum is now MeseCraft

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests