[Mod] Treasurer [0.2.0] [treasurer]

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

[Mod] Treasurer [0.2.0] [treasurer]

by Wuzzy » Wed Sep 25, 2013 06:27

Treasurer
This is a framework to define and distribute random treasures into the world. Treasurer itself does neither define any items nor does it attempt to distribute them because it is a framework.

Player information
To actually get a game with treasures using Treasurer running, you need a couple of mods:
  • Treasurer
  • At least one TRM (treasure registration mod). This is a mod which tells Treasurer which treasures exist
  • At least one TSM (treasure spawning mod). This is a mod which puts random treasures into the world

Minimal usage example
+ Minimal usage example


List of TRMs:
All TRMs by me are WTFPL’ed.

List of TSMs:
  • Dungeon Treasure Chests [tsm_chests_dungeon]: Adds treasure chests into the default dungeons
  • Railway corridors [tsm_railcorridors]: Creates an underground network of mines, with treasure chests and simple railways
  • Mines [tsm_mines]: Creates very simple underground mine shafts
  • Pyramids [tsm_pyramids]: Creates pyramids in deserts with hidden treasures
  • Surprise blocks [tsm_surprise]: Creates randomly floating question mark blocks which drop cheap treasures when broken
  • tsm_geomoria [tsm_geomoria]: Extension of Geomoria, adds treasures in those strange underground structures

Developer information
+ Developer information


Download and stuff
Last edited by Wuzzy on Fri Dec 01, 2017 09:41, edited 18 times in total.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

clarksallador
Member
 
Posts: 57
Joined: Sun Sep 30, 2012 03:18
Location: Philippines
 

User avatar
RealBadAngel
Member
 
Posts: 556
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Wed Sep 25, 2013 12:17

Can i smell Diablo like treasure system here?? ;)
 

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

by Wuzzy » Wed Sep 25, 2013 15:05

No, it smells more like coincidence here.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
Location: Germany
GitHub: PilzAdam
IRC: PilzAdam
 

User avatar
rubenwardy
Moderator
 
Posts: 5317
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Wed Sep 25, 2013 16:32

Lol, Adam, lol.

This looks interesting. Why don't you provide any treasures by default!
Core Developer | Donate | My Twitter | Mods | Mods 4 Android | Node Box Editor | Minetest Modding Book

Hello profile reader

LgiOxMFYXOqtqVqMPhbw1Bn3oNRvEC7j
 

User avatar
RealBadAngel
Member
 
Posts: 556
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Wed Sep 25, 2013 18:12

Heavenly Diamond Pickaxe of the Stars...


Coincidence? :)
 

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

by Wuzzy » Thu Sep 26, 2013 08:23

rubenwardy wrote:Why don't you provide any treasures by default!


I don’t really understand your complaint, because I include one working example TRM which includes some treasures from default.

I also think the “examples” tsm_chests_example and trm_default_example are aleady kind of advanced for examples. A bit more game balance tweaking to these and I can call these actual mods.

Did you try the examples yet?

Oh, by the way: If a new (serious) TSM or TRM gets released that depends also on mod X, what do you think? Should it be posted to this thread? Should it get it’s own thread? Or should it be posted to the thread of mod X? And what about mods with multiple dependencies (minus Treasurer)?
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

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

by Wuzzy » Thu Oct 03, 2013 16:21

Hi! I have written a bunch of TRMs for many mods now to test Treasurer more throughly, also because the default treasures become boring with the time. ;-)
If you activate one of those mods, new treasures become available.

Download: TRM pack 0.1 (size: 9.2 KiB)
Alternative download: It is also in attachment #1.

Mods included (their provided treasures are written in parenthesis):
  • bees (honey comb, honey bottle)
  • blox (glow dust)
  • boats (boat)
  • carts (minecart, power rail, brake rail)
  • desert_uses (desert tools)
  • farming_plus (seeds, saplings, fruit, weed)
  • flowers_plus (flower pot)
  • food (several food items and unprocessed (!) food)
  • glooptest (for now, only the hammer and the handsaw, of course it only works if you have the tools module activated in Glooptest)
  • zmobs and lavatemple (lava orb, lava dagger)
  • magicbeans (the 3 beans)
  • tnt (TNT and gunpowder)

The naming convention is simply “trm_<basename>”.
The dependencies of each TRM are Treasurer and the respective mod from which they take the treasures from. For example, trm_bees depends on Bees and Treasurer.

If you have an idea for a mod to add, either write it on your own or ask me to do it. Writing a TRM is not difficult (Balancing one is! lol). In theory, any mod which has some useful (or useless!) items is a good candidate for a TRM.
I am not sure if it is a good idea to drop so many TRMs into one Zip file. On the other hand, TRMs are naturally very small in file size. The entire TRM pack has a size of 9.2 KiB.

License of the entire pack: WTFPL

PS: It is not forbidden to release TRMs on your own. ;-)
Attachments
trm_pack_0.1.zip
(9.17 KiB) Downloaded 160 times
Last edited by Wuzzy on Wed Oct 23, 2013 05:35, edited 1 time in total.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

like2omg
Member
 
Posts: 37
Joined: Sat Nov 30, 2013 20:12

by like2omg » Sat Nov 30, 2013 20:18

I have yet to take a dive into making mods yet (haven't played Minetest enough anyways O_o ) but if it is possible to spawn items with "data" attached in Minetest (Minecraft map makers would call this data "NBT tags"), maybe we could have it so a specially formatted spawn line argument(s) could give set or ranged (chosen randomly) argument values.

As I have said, I have yet to take a dive into making mods, so I don't know if this is possible as of yet in Minetest. Oh and by the way, I like this idea... next up is equipment for mobs (once we can see what mobs hold/wear first)

[EDIT] Oops... am I reviving an old thread?
Last edited by like2omg on Sat Nov 30, 2013 20:27, edited 1 time in total.
 

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

by Wuzzy » Sat Nov 30, 2013 22:03

I have no idea what you are talking about.
And no, this thread never goes old. ^_°
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

like2omg
Member
 
Posts: 37
Joined: Sat Nov 30, 2013 20:12

by like2omg » Sat Nov 30, 2013 22:42

spawn items with "data" attached
Items with specific, TRM-chosen named properties of the item already set (ex: durability)

specially formatted spawn line argument(s) could give set or ranged (chosen randomly) argument values
Adding one or two optional arguments to the TRM "add an item" line; have specifc, TRM-chosen named property of the item set to a specific value, or chosen randomly in the range of n1 to n2.
Possibly the argument could be (with property names replacing the named indexes):
Code: Select all
{
    "specificItemProperty": 2,
    "rangedItemProperty": { 5, 8 },
    "specifcCouldAlsoUseNonNumbers": <imagine an item list here>
    ... and on and on ...
}


next up is equiptment for mobs
I was mostly joking here (it's a "very far down the road" idea). When mobs can hold weapons and have equipped armor (and we can see them having it), having a modification for mobs to randomly get gear choices (probably this would be a part of the mob mod)

- insert non-signature divider -

I did come up with an idea (while doing the first compose and before I accidentally hit the keyboard's built-in back button) that we could possibly specify multiple "categories" that an item belongs to with TRM and ask for those "categories" to be in the selection when getting items with a TSM. I currently would say, have the TRM and TSM choose their names (instead of restrict them)
Examples:
- If a TSM wants any ol' block or a weapon {"block", "weapon"} or just anything --> nil
- Have a TRM specify that an item is in multiple categories {"tool", "pickaxe"} or have it not specify a category --> nil or {}

Then when it comes time to deside:
1. TSM descides a "block" or a "weapon"
2. Treasurer searches for those types in its database which were specified by the TRMs
3. Treasurer then does its normal limiting/choosing and sends the result

These are just some ideas I had. I hope you enjoy the ideas, even if you consider them to be too "high-tier" for your mod. *wink*

Edit: a bit of fixing (nothing content-breaking)
Last edited by like2omg on Sat Nov 30, 2013 22:45, edited 1 time in total.
 

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

Version 0.2.0 released

by Wuzzy » Sat Oct 04, 2014 06:04

Hi again. Sorry I answer so late. I have read your posts and I must say that your ideas are very good and I think it would greatly enhance Treasurer, when I just would actually built them in. ;-)

I also release version 0.2.0 today which was long overdue. From now on, Semantic Versioning applies.

Basically this update implements Treasurer groups. Something which you, like2omg, described as “categories”. It basically works like you described. I also have made a few mistakes in the documentation which are fixed now.

About the new groups:
TRMs can put treasures into groups and TSMs can filter out by groups. Any treasure can be assigned to one or more groups. Any TSM can shrink the treasure pool with a list of groups. Only treasures which belong to at least 1 of these groups will be in the pool.

I also suggested some groups in another text file, for a bit standardization. Stuff like “food”, or “crafting_component”, “melee_weapon”, etc. But technically, group names can be chosen freely. Using groups is optional. There is a group “default” in which all treasures go when no group is specified.

The details can be all found in the README file.

Version 0.2.0 is fully backwards-compatible to 0.1.

Download is in attachment.

Also, there’s a Git repository online now, find it at:
http://repo.or.cz/w/minetest_treasurer.git
This only contains the treasurer mod, not the examples! The examples are in treasurer0.2.0.zip (attachment).



I also distribute a new TRMP. The “P” stands for “pack”. It is a modpack entirely of TRMs. This TRMP is for minetest_game, not only default, so it should be more interesting. It is a bit more balanced than the old example for default. I’ll start with version 0.4.10.0. The version scheme follows the same of minetest_game, appended with a fourth digit, which will increase whenever I update the TRMP as long as minetest_game did not change.

IMO Treasurer seems to be pretty stable. I think I will increase the version number to 1.0.0 as soon like2omg’s other suggestions are implemented.


Maybe, for the future, I try focus more on writing TRMs for many mods, subgames and, more importantly, do more work on TSMs.
I think I could fork the mods pyramids, mines and railcorridors to include Treasurer support. All those mods already use treasure chests, but none of them use Treasurer. I tried to convince the author of the first 2 mods to use Treasurer, but it did not work. I won’t even bother trying with the third one, the author is new to modding. So I decided the only way to get anything done is to fork it and do it myselves. Well, that’s my plan at least.

If you know any other mods which generate treasure chests (or some other kind of treasure) and choose random treasures on their own, please let me know!

And maybe I can also use some of my (more or less) own ideas.

Treasurer has a lot of potential, I think. It is about time to use it! :)



Edit:
I have converted three mods into TSMs! See the initial post for links.
Attachments
treasurer0.2.0.zip
(80.31 KiB) Downloaded 726 times
trmp_minetest_game0.4.10.0.zip
(8.39 KiB) Downloaded 728 times
 

User avatar
rubenwardy
Moderator
 
Posts: 5317
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Treasurer [0.2.0] [treasurer]

by rubenwardy » Sat Nov 21, 2015 19:04

Thank you for this mod. I use it on my Capture the Flag server.
Core Developer | Donate | My Twitter | Mods | Mods 4 Android | Node Box Editor | Minetest Modding Book

Hello profile reader

LgiOxMFYXOqtqVqMPhbw1Bn3oNRvEC7j
 

Byakuren
Member
 
Posts: 768
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Treasurer [0.2.0] [treasurer]

by Byakuren » Fri Jul 22, 2016 21:31

Is there a way to provide item stacks with metadata attached, e.g. books with prewritten text? And it would be useful to be able to provide a function to treasurer to randomly (or non-randomly) generate the metadata, for example if a potion mod used metadata to store information about the potion.
Every time a mod API is left undocumented, a koala dies.
 

Martno
Member
 
Posts: 77
Joined: Thu May 28, 2015 07:09
Location: Hungary

Re: [Mod] Treasurer [0.2.0] [treasurer]

by Martno » Sat Jul 23, 2016 06:37

Byakuren wrote:Is there a way to provide item stacks with metadata attached, e.g. books with prewritten text? And it would be useful to be able to provide a function to treasurer to randomly (or non-randomly) generate the metadata, for example if a potion mod used metadata to store information about the potion.


That would be awesome.
 

Byakuren
Member
 
Posts: 768
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Treasurer [0.2.0] [treasurer]

by Byakuren » Sat Jul 23, 2016 07:31

Looks like the ability to specify metadata exists, but is undocumented. No metadata-generator support, though. For something like potions it would be possible to just register once for each preset potion effect.
Every time a mod API is left undocumented, a koala dies.
 

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

xisd
Member
 
Posts: 51
Joined: Sun Oct 02, 2016 22:38
GitHub: xisd

Re: [Mod] Treasurer [0.2.0] [treasurer]

by xisd » Sun Jan 01, 2017 14:48

Hi !
I packed together a few more trms
Some are for mod included in minetest_game but that were not in trmp_minetest
other are for other some mods I use.
Its available there : https://github.com/xisd/trmp_Pack
Only carts is redundant with the other mod pack posted in this thread (it's the same but with the categories support)
 

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

Re: [Mod] Treasurer [0.2.0] [treasurer]

by Wuzzy » Thu Mar 16, 2017 21:07

Nothing new about Treasurer itself (it is NOT on my list of priorities), but I updated the first post to make it more readable. I figured it was WAY too technical. Now hopefully it should be understandable by non-technical users as well.
To use Treasurer, you do NOT have to be a modder. :D
If you still have difficulties in understanding Treasurer, please let me know.

I also updated the list of TRMs and TSMs and added a simple usage example.

In other news, I just added a new treasure spawning mod which puts treasures into dungeon chests:
[Mod] Dungeon Treasure Chests [tsm_chests_dungeon]


I also noticed that trmp_minetest_game is very outdated. :-/
But note that Treasurer and related projects will probably remain frozen for quite a while. As I said, it is NOT a priority.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

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

Re: [Mod] Treasurer [0.2.0] [treasurer]

by bell07 » Tue Apr 11, 2017 13:29

Next one for the list, based on tsm_chest_dungeon: https://github.com/bell07/minetest-tsm_geomoria. This mod needs both to run: treasurer and geomoria (it is not a fork of geomoria, just a hook implementation).
 

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

Re: [Mod] Treasurer [0.2.0] [treasurer]

by Wuzzy » Tue Apr 11, 2017 13:40

Nice!
But IMO it would be better and easier for users if Treasurer support is optionally added to the main Geomoria mod.
Meaning, when the Treasurer mod is found, it generates treasures, but if it is not found, they are not generated.

Or at least convince duane to update the first post to put a link to tsm_geomoria.
My projects: MineClone 2. Hades Revisited. Help modpack. A ton of other mods, see here.
 

User avatar
Beerholder
Member
 
Posts: 161
Joined: Wed Aug 03, 2016 20:23
In-game: Beerholder

Re: [Mod] Treasurer [0.2.0] [treasurer]

by Beerholder » Thu May 25, 2017 21:43

UPDATE Never mind, it seems that the new chest code is using main as inventory whereas I still had the old chest code (using default:chest) from minetest_game in my game. Pulled latest MG, merged the MG mods in my game with latest MG and problem solved :) Leaving below for reference. Oh and p.s. thanks for the great mod framework!

Hi Wuzzy, I am having some trouble with one of the TSMs, the chests are always empty :( Hope you can help ... I am trying to run the mod on 0.4.16 and for some reason this bit of code from tsm_chests_dungeon does not seem to work (bit modified from the original but original also did not work):

Code: Select all
local treasures = treasurer.select_random_treasures(10, 0, 10, nil)
treasures_added = treasures_added + #treasures
for t=1,#treasures do
   minetest.log("action","[treasurer] Adding: "..treasures[t]:get_name())
   inv:add_item("main", treasures[t])
end

I added the log statement for debug purposes and it prints what it is adding e.g.:

Code: Select all
2017-05-25 23:27:59: ACTION[Server]: [treasurer] Adding: tnt:gunpowder
2017-05-25 23:27:59: ACTION[Server]: [treasurer] Adding: default:stick


So treasurer most definitely runs on mapgen and returns items. But when I look in the chests (any chest, tried lots) there is nothing in there. All chests are empty, so I guess the inv:add_item doesn't do anything. I also tried constructing a new ItemStack, passing it using inv:set_stack but no luck. I am going to debug this some more myself e.g. check for changes that might have broken this or see if there is some issue with my minetest_game not being up to date (I have had some other issues with storing meta as well), but thought I'd check with you as well, e.g. have you got this running on 0.4.16, are aware of this issue or maybe I am just doing something wrong ... Thanks! :)
 

User avatar
poikilos
Member
 
Posts: 39
Joined: Thu Feb 18, 2016 13:45
GitHub: poikilos
In-game: Abiyahh
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 7 guests