[Mod] Pyramids (with Treasurer support) [0.6] [tsm_pyramids]

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

[Mod] Pyramids (with Treasurer support) [0.6] [tsm_pyramids]

by Wuzzy » Sun Oct 12, 2014 12:03

This mod is a fork of BlockMen’s Pyramids mod.
You find everything you need to know about it here: Pyramids

The main difference from the original mod is that this mod utilizes Treasurer to spawn the treasures in the chests, so there can be more variety in the treasures you can find. Using Treasurer is optional, if you don’t use this mod, this mod falls back to a default behavior.



Licenses:
Source code: WTFPL
Mesh models: WTFPL (credit goes to Pavel_S)
Textures: WTFPL, CC-BY-SA 3.0 (bas080)
Sounds: CC0, other (see Readme.txt for more information)
Last edited by Wuzzy on Fri Feb 06, 2015 20:46, edited 1 time in total.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by Krock » Sun Oct 12, 2014 14:30

Could you extend the original pyramids mod with the treasurer support?
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by Wuzzy » Sun Oct 12, 2014 14:45

No, I can’t. I do not have write access to the original repository. And BlockMen won’t let me. BlockMen also did not agree to put Treasurer support into the mod. Therefore, the only feasible solution I saw is to fork.

I don’t think the original Pyramids mod is going to be updated soon, but I will try to merge any updates in the original Pyramids mod into tsm_pyramids.

You can probably use tsm_pyramids as a drop-in replacement for the original pyramids mod, it should be compatible, but I did not test it. If it works, fine. But better backup your worlds before switching.
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by Napiophelios » Sun Oct 12, 2014 17:12

function pyramids.fill_chest is all it really has to change right?

Cant you just make a tsm_pyramids init.lua for treasurer without having to duplicate/replace the pyramids mod?

or is it because pyramids mod already populates the chests and treasurer mod cant mess with them without errors?
 

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

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by Wuzzy » Sun Oct 12, 2014 18:26

Napiophelios wrote:function pyramids.fill_chest is all it really has to change right?

No. Besides pyramids.fill_chest, depends.txt also has to change.
You can view the change I made here:
http://repo.or.cz/w/minetest_pyramids/t ... fd28d21673

Napiophelios wrote:Cant you just make a tsm_pyramids init.lua for treasurer without having to duplicate/replace the pyramids mod?

No, certainly not. Treasurer is intended to be a pure API mod to which other mods interface to. Putting tsm_pyramids code directly into Treasurer would immediately undermine this idea.
Also, this would add a hard dependency on default to Treasurer. But Treasurer must stay clean of any mod depencencies, otherwise it would cease to be a pure API mod.
Treasurer is not a trivial mod. To learn more about how Treasurer works, read its thread. If you have more questions about Treasurer or don’t understand it, feel free to ask a question in the Treasurer thread.

Napiophelios wrote:or is it because pyramids mod already populates the chests and treasurer mod cant mess with them without errors?

Ugh, what kind of question is that?
The correct answer is “No”.

The Pyramids mod already populates the chest. But treasurer does not mess with chests at all, it does not know anything about the method by which the treasures are brought into the world. Treasurer only selects the treasures, tsm_pyramids will put them into the world.

Currently, tsm_pyramids works like this:
If the Treasurer mod is present, it will use Treasurer to select some random treasures, returned by Treasurer’s API.
If the Treasurer mod is not present, the mod will fall back to its own simple treasure selection algorithm, which is pretty limited, but it works. This fallback code was inherited from the original mod.
After the treasures have been selected, tsm_pyramids will place them into the chests.





After all, doing all this as a fork is the most sensible solution to me right now. But if BlockMen merges my changes into the original mod, I will abandon this fork, because it won’t be neccessary anymore. Remember, a Git repository is online. :)
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by Napiophelios » Sun Oct 12, 2014 18:36

I already use treasurer,I have a Treasurer_modpack with a couple of the tsm_defaults altered,
I was just hoping to be able to drop another tsm folder into the modpack.

I also use pyramids but I edited out all the mummy spawning
...I just didnt wanna do that again with this one

Thanks for the detailed answers;
gonna go try out tsm_mines :)
 

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

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by Wuzzy » Sun Oct 12, 2014 18:53

It is nice to know that someone actually uses Treasurer and even experimented with it a little bit. I almost thought I was the only one who creates or edits mods for Treasurer. :-)
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by BlockMen » Sun Oct 12, 2014 20:47

Wuzzy wrote:The main difference from the original mod is that this mod utilizes Treasurer to spawn the treasures in the chests [...]

What are the other differences?

Wuzzy wrote:No, I can’t. I do not have write access to the original repository. And BlockMen won’t let me.

Wut? Ofc you have no acess to my repository, but there is something called "pull request".

Wuzzy wrote:BlockMen also did not agree to put Treasurer support into the mod.

Right, I still don't see the point in using your API for that. Your mod might be handy in some cases or for other mods, but not for the few items in my mod.

Wuzzy wrote:Therefore, the only feasible solution I saw is to fork.

Best way to reach you goal wouldn't be forking (and providing nealy the same code again), it would be a small mod that depends on Treasurer and pyramids and overrides pyramids.fill_chest()(https://github.com/BlockMen/pyramids/bl ... it.lua#L18)
Would also be easier to maintain in case of the possible updates.

But since its WTFPL you can do with it whatever you want ofc; just my two cents on it ;)
 

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

Re: [Mod] Pyramids (with Treasurer support) [0.5] [tsm_pyram

by Wuzzy » Sun Oct 12, 2014 22:19

BlockMen wrote:
Wuzzy wrote:The main difference from the original mod is that this mod utilizes Treasurer to spawn the treasures in the chests [...]

What are the other differences?

There is only one other difference. The mod adds a forgotten dependency on farming as optional dependency. If neither Treasurer nor farming are present, no bread will spawn (would be unknown item otherwise).

Wut? Ofc you have no acess to my repository, but there is something called "pull request".

All my code is on a Git repository as well, so you might as well merge, if you wish. A pull request is a vendor-specific tool and not at all neccessary to get things going. ;-)

Right, I still don't see the point in using your API for that. Your mod might be handy in some cases or for other mods, but not for the few items in my mod.


Everything which appears in the treasure chests is not from your mod, so I don’t understand you here.
And the idea of Treasurer is simply that not just those few default treasures spawn, but as many as have been available to Treasurer. Treasures from other mods can cleanly spawn as well.

Example: Imagine you have 15 mods installed, all have interesting items worthy for treasure chests. But no matter how many worthy items you have with the installed mods, the normal pyramids mod will always select the treasures from the same pool of the default mods. Treasurer helps to select the interesting items from all 15 mods, rather than just limiting to the frew from the default game, and all that without depending on all those mods. The other way to do that, that is, without Treasurer, would require to add a dependency to each of these mods, which is of course completely not managable.

I hope you at least understand what this is all about, even if you may not want to use this mod.

Best way to reach you goal wouldn't be forking (and providing nealy the same code again), it would be a small mod that depends on Treasurer and pyramids and overrides pyramids.fill_chest()(https://github.com/BlockMen/pyramids/bl ... it.lua#L18)
Would also be easier to maintain in case of the possible updates.

Hm. I think of that when there will be actually some updates and merging becomes annoying. Otherwise, I don’t feel like doing the conversion again right now, since I would basically have to start over again and throw the existing repository away. ;-)
 

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

Version 0.6 released!

by Wuzzy » Fri Feb 06, 2015 20:48

Hi! I have released version 0.6. This is only a minor bugfix release fixing a possible bug I discovered in 0.4.11. Namely, a variable accidentally went global but should have been local only.
 

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

Re: [Mod] Pyramids (with Treasurer support) [0.6] [tsm_pyram

by guideahon » Tue Feb 10, 2015 14:37

Wuzzy, i made a modification for your mod, i added "false_sandstone_brick", is the same as the other one but unbreakeable to prevent pyramids from being too easy, also, i would love to see a big mummy spawner at the entrance activated when the user wants to get out of the pyramid, this would prevent someone entering a pyramid just after spawn and already getting diamond picks and more treasures (you shoud go well equiped to survive) Mabe the pyramid could be slightly bigger (2 floors)
Excellent mod!!!
 

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

Re: Version 0.6 released!

by poikilos » Tue May 31, 2016 15:07

Wuzzy wrote:Hi! I have released version 0.6. This is only a minor bugfix release fixing a possible bug I discovered in 0.4.11. Namely, a variable accidentally went global but should have been local only.

I am still having global vs local problems:
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-05-24 15:22:32: WARNING[Server]: Undeclared global variable "default_model_def" accessed at ...re/minetest/games/fca_game_a/mods/tsm_pyramids/mummy.lua:63
2016-05-24 15:22:32: WARNING[Server]: Assignment to undeclared global "visual" inside a function at ...re/minetest/games/fca_game_a/mods/tsm_pyramids/mummy.lua:63.
2016-05-24 15:22:32: WARNING[Server]: Assignment to undeclared global "prop" inside a function at ...re/minetest/games/fca_game_a/mods/tsm_pyramids/mummy.lua:70.


I am using the git version. I checked my mummy_update_visuals_def function in mummy.lua and it is the same as git:
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
function mummy_update_visuals_def(self)
   --local name = get_player_name()
   visual = default_model_def
   npc_anim = 0 -- Animation will be set further below immediately
   --npc_sneak[name] = false
   prop = {
      mesh = mummy_mesh,
      textures = mummy_texture,
      --visual_size = {x=1, y=1, z=1},
   }
   self.object:set_properties(prop)
end

The errors appear on all of the git versions of minetestserver that I have been using over the past few months.
I am running minetestserver for multiplayer on Ubuntu 16.04 Server, but had same errors before upgrading from 14.04 and re-cloning minetestserver from git.

I could make visual and prop local but I'm not sure if that would cause problems, and then I don't know how to get default_model_def anyway so that first error would remain.

On a possibly unrelated topic, the pyramids have no treasure in the chests nor for breaking the mummy spawner. . Do I have to create an item pool myself or anything?
 

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

Re: [Mod] Pyramids (with Treasurer support) [0.6] [tsm_pyram

by xisd » Thu Jan 05, 2017 10:59

I edited this mod a bit, mainly this add a configuration file to make a lot of things optional or easily configurable (traps, lava, mummy, spawner hidden or not, number and types of items in chest, probability of empty chest ...) and allow the use of a mob and spawner from an other mod ( I use mummies adapted from this mod into cme api )
Maybe it could present some interest.
Modified tsm_pyramids : https://github.com/xisd/tsm_pyramids
Modified cme modpack : https://github.com/xisd/cme
 

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

Re: [Mod] Pyramids (with Treasurer support) [0.6] [tsm_pyram

by poikilos » Wed Jun 05, 2019 14:56

Hello @Wuzzy, could you please change uses of global
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
nodeupdate(pos)
by making a separate case
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
if minetest.check_for_falling ~= nil then
   minetest.check_for_falling(pos)
else
   nodeupdate(pos)
end
to prevent the crash below?

Undeclared global variable "nodeupdate" accessed at ...share/minetest/games/ENLIVEN/mods/tsm_pyramids/nodes.lua:36
2018-02-20 16:51:13: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'tsm_pyramids' in callback node_on_timer(): ...share/minetest/games/ENLIVEN/mods/tsm_pyramids/nodes.lua:36: attempt to call global 'nodeupdate' (a nil value)


:edit: I updated this post and my repo to make the change backward-compatible by making a separate case.
This is a very common issue caused by the corresponding API change in 5.0.0-dev
:edit: Here is the commit on my fork which fixes the issue: https://github.com/poikilos/tsm_pyramids/commit/955a6e3dc4351768510d34e73d4ebd71cad745ad
 


Return to WIP Mods

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron