[Mod] Lucky Ore [lucky_ore]

Posted:
Fri Nov 25, 2016 00:49
by jordan4ibanez
Lucky OreThis mod adds a lucky ore to the game which gives you the chance to get any item in the game when you mine it.
Features:- Ore glows and has animated texture
- When you mine it it shows every item that can be obtained
- Will drop item after end of cycle or explode half the time
- Spawns like coal
GithubDownloadVideoI can't really show a picture of due to the nature of the ore, so the video will show you how this mod works.
License: WTFPL
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
Re: [Mod] Lucky Ore [lucky_ore]

Posted:
Fri Nov 25, 2016 07:06
by juli
I have tested it, ok if u need fun install it :)
But there has been a bug, the sound doesn't end after explode!
Re: [Mod] Lucky Ore [lucky_ore]

Posted:
Fri Nov 25, 2016 08:09
by jordan4ibanez
juli wrote:I have tested it, ok if u need fun install it :)
But there has been a bug, the sound doesn't end after explode!
Hey thanks! I've fixed that in the latest release. Redownload and it'll be all fixed.
Here's an update video:
https://youtu.be/YUxfhinE4lIChanges:
- only 20% chance of explosion now
- uses math.random(3,15)+math.random() for a chance to get every item in the game
- win particles
- item entity is immortal
Re: [Mod] Lucky Ore [lucky_ore]

Posted:
Mon Nov 28, 2016 21:59
by Wuzzy
The problem with mods which randomly select an item from literally all possible items is that there is quite a chance that the player obtains a node which the player is NEVER EVER supposed to get, because the node is only used internally, it would screw things up if the player possessed it directly, etc.
Examples: air, ignore, doors:hidden (hidden door segment), farming:wheat_3, etc.
I think a good heuristic would be by filtering out any item with an empty or nil description, and items with not_in_creative_inventory=1. Granted, this will also filter out some legit items, but at least you can be pretty sure the player does not get any “forbidden” items.
I wish there would be a possibilty for modders to tell modders “this item is not for the inventory”, but sadly, this is not possible yet. :-/
Also, do you actually intend a totally random item, i.e. equal probabiliy for all items? Or would you actually like it more if some itesm would be more likely than others?
In my first few tries, I managed to get an ignore. xD
Other notes:
- The ka-ching sound is evil, it does not mean anything. It can still explode afterwards. :( Maybe this is the joke (you intended it)? xD
- In inventory it looks like a coal ore. Maybe try to change the looks of the first animation frame so the block looks different from coal ore
- I would like it more if the animation would be more customized anyway (instead of just plugging existing Minetest Game images together). But basing the texture on stone is OK IMO
- Block sounds are missing (footstep sounds, dig sound, dug sound)
- BUG: If you mine a lucky ore, then quickly run far away (so that the entity gets unloaded), you'll contiue to hear the sound forever. If you return, a NEW lucky ore sound can be heard. Repeat this again and again and it becomes louder and louder until your ears bleed. XD
- BUG? If you run away after mining a lucky block (so that the entity gets unloaded), it seems the timer is reset when you return. Not sure, please verify this for yourselves.
EDIT:
- I think the spawn rate is quite high. You very soon find caves full of these. I think it should be a bit rarer. And I think it also would be better if lucky ores always spawn alone, never in groups. This is because digging multiple lucky ores in quick succession can get quite noisy soon