[Mod] Lucky Ore [lucky_ore]

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

[Mod] Lucky Ore [lucky_ore]

by jordan4ibanez » Post

Lucky Ore

This 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
Github

Download

Video

I 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

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.
Last edited by jordan4ibanez on Fri Nov 25, 2016 08:10, edited 1 time in total.
hello, am program. do language in rust. make computer do. okay i go now.

juli
Member
Posts: 217
Joined: Sat Jun 11, 2016 10:31
GitHub: cpdef
In-game: juli

Re: [Mod] Lucky Ore [lucky_ore]

by juli » Post

I have tested it, ok if u need fun install it :)

But there has been a bug, the sound doesn't end after explode!

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

Re: [Mod] Lucky Ore [lucky_ore]

by jordan4ibanez » Post

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/YUxfhinE4lI

Changes:
  • 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
hello, am program. do language in rust. make computer do. okay i go now.

User avatar
D00Med
Member
Posts: 949
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med
Location: Australia...somewhere

Re: [Mod] Lucky Ore [lucky_ore]

by D00Med » Post

ooh cool!
Look! I have a signature :]
My subgame: viewtopic.php?f=15&t=14051#p207242

Kosmos
Member
Posts: 131
Joined: Sun Sep 11, 2016 12:42
In-game: KosmosHD

Re: [Mod] Lucky Ore [lucky_ore]

by Kosmos » Post

Very cool.

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

Re: [Mod] Lucky Ore [lucky_ore]

by Wuzzy » Post

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

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Lucky Ore [lucky_ore]

by TechNolaByte » Post

Wuzzy wrote: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?
I like the fact that you can get unobtainable able items its fun also since there are SO many possibility's its fine to have a ton of them spawning just make sure you have a lot of inventory space when you go mining for them or at least have some sort of bag/portable chest/ backpack mod (I suggest inventory bags) or else your inventory will get filled with random items

its sorta addicting to open them as you never know what your gona get
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Lucky Ore [lucky_ore]

by bell07 » Post

I like the fact that you can get unobtainable able items its fun also since there are SO many possibility's its fine to have a ton of them spawning just make sure you have a lot of inventory space
I had the same attitude as I wrote trm_generic
But in fact Wuzzy has right (again), some items should not be obtainable. For example the realchess mod adds chess items that used only internally because the game board is implemented technically as inventory. This items never ever should be used in players inventory.

Maybe you just use the treasurer framework too in your lucky-ore to manage the treasures? Otherwise you can copy my item filters to your mod.

User avatar
TechNolaByte
Member
Posts: 465
Joined: Wed May 10, 2017 21:00
GitHub: TechNolaByte

Re: [Mod] Lucky Ore [lucky_ore]

by TechNolaByte » Post

bell07 wrote:
I like the fact that you can get unobtainable able items its fun also since there are SO many possibility's its fine to have a ton of them spawning just make sure you have a lot of inventory space
I had the same attitude as I wrote trm_generic
But in fact Wuzzy has right (again), some items should not be obtainable. For example the realchess mod adds chess items that used only internally because the game board is implemented technically as inventory. This items never ever should be used in players inventory.

Maybe you just use the treasurer framework too in your lucky-ore to manage the treasures? Otherwise you can copy my item filters to your mod.
true though I have modified this mod to add lucky blocks which drop about 30-40 random items exactly like the ore but with no explosions I have filled several walls of technic golden chests and have never once gotten any chess pieces or items that were only used as buttons in inventories(including tetris mod, robot mod, and chess mod)
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.

Post Reply

Who is online

Users browsing this forum: No registered users and 45 guests