Have a look at the trader npc from my npc framework, not suggesting you use that as npcf is still a long-term WIP but the trader npc works very similar to what you describe here (if I read it correctly).Ackirb wrote:Hello
I am trying to create a trade shop.
There will be an inventory slot which displays the item being sold, another slot displaying the item(s) which will traded (the price), a slot in which the user can insert their payment, and finally a slot that allows the user to take their purchased item after paying for it.
It's like this:
[ ] = inventory slot
[item for sale] [price of said item] [payment slot] [product]
example:
[mese pickaxe] [25 cobble stone blocks] [payment slot] [product]
When the user places 25 cobble stone blocks into the "payment slot", then the mese pickaxe will appear in the
"product" slot, and the user will be able to take it.
My question is: how do I make it so that the user cannot take items out of the [item for sale] slot and the [price] slot?
It kind of defeats the purpose of a trade shop if the customer can simply take the item for sale without even having to pay! lol.
If anyone wants a better example of how this is (supposed) to work, please let me know!
Post your modding questions here
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Re: Only Owner can take/put/move items in an inventory
Re: Only Owner can take/put/move items in an inventory
I have actually been using your trade NPC for awhile now. Good job on that, by the way - I really like it.Have a look at the trader npc from my npc framework, not suggesting you use that as npcf is still a long-term WIP but the trader npc works very similar to what you describe here (if I read it correctly).
However, your NPC doesn't actually display the items for sale nor the price of said items with an inventory slot, but instead, displays a string (aka, instead of showing a diamond pickaxe in an inventory slot, it would show a string that says "Diamond Pickaxe")
My shop is more like the one from bitchange in that is literally shows the items for sale and the price of said item.
- Attachments
-
- Shop.PNG (482.28 KiB) Viewed 718 times
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Re: Only Owner can take/put/move items in an inventory
You can use a detached inventory, just make sure the allow_take function returns 0Ackirb wrote: My question is: how do I make it so that the user cannot take items out of the [item for sale] slot and the [price] slot?
It kind of defeats the purpose of a trade shop if the customer can simply take the item for sale without even having to pay! lol
Code: Select all
inv = minetest.create_detached_inventory("display", {
allow_take = function(inv, listname, index, stack, player)
return 0
end,
})
-
- Member
- Posts: 15
- Joined: Sun Dec 16, 2012 20:18
- Location: Mississippi
- Contact:
Re: Post your modding questions here
How much has modding changed since the initial 0.4 release? And if so, is there any specific place I can go to read up on this new info? I've been out of the loop almost two years now...and I'm aching to get back into it and finish up what I started.
-
- Member
- Posts: 4534
- Joined: Mon Oct 03, 2011 17:58
- GitHub: Jordach
- IRC: Jordach
- In-game: Jordach
- Location: Blender Scene
Re: Post your modding questions here
http://dev.minetest.net/iPushButton1997 wrote:How much has modding changed since the initial 0.4 release? And if so, is there any specific place I can go to read up on this new info? I've been out of the loop almost two years now...and I'm aching to get back into it and finish up what I started.
and
https://github.com/minetest/minetest/bl ... ua_api.txt
Are both good places. (And good to see you about)
-
- Member
- Posts: 15
- Joined: Sun Dec 16, 2012 20:18
- Location: Mississippi
- Contact:
Re: Post your modding questions here
Thanks man. And it feels good being back. Hopefully I can get back to my old work :PJordach wrote:http://dev.minetest.net/iPushButton1997 wrote:How much has modding changed since the initial 0.4 release? And if so, is there any specific place I can go to read up on this new info? I've been out of the loop almost two years now...and I'm aching to get back into it and finish up what I started.
and
https://github.com/minetest/minetest/bl ... ua_api.txt
Are both good places. (And good to see you about)
Re: Post your modding questions here
What is the maximum stack_max? I read it was over 50000 but I've tried 50000 and 40000, which don't work, and 25000 does.
-
- Member
- Posts: 4290
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: Post your modding questions here
You may also try my mobf_trader mod. It adds traders which can either sell a pre-defined sortiment or be employed by players. Up to four stacks can be bundeld for an offer (or price), and several alternate prices can be offered (i.e. sell 10 tree for 1 steel ingot or 1 copper or 5 cactus etc.). The mod ought to be linked in the posting mentioned in my signature.Ackirb wrote: My shop is more like the one from bitchange in that is literally shows the items for sale and the price of said item.
Re: Post your modding questions here
What are the advantages and disadvantages of mapgenV6 and mapgenV7? Which features are supported by them for creating a mod? Is there any comparison or documentation of their features?
-
- Member
- Posts: 4534
- Joined: Mon Oct 03, 2011 17:58
- GitHub: Jordach
- IRC: Jordach
- In-game: Jordach
- Location: Blender Scene
Re: Post your modding questions here
Mapgen V6 has two defined biomes, while Mapgen V7 has completely custom biomes which can be made from nyan rainbow to literally lava or even bones.RHR wrote:What are the advantages and disadvantages of mapgenV6 and mapgenV7? Which features are supported by them for creating a mod? Is there any comparison or documentation of their features?
That choice is yours with V7.
Re: Post your modding questions here
Yep the custom biomes are awesome, but is that the only difference? Is it for example possible to "mod" the surface(mountains) of mapgenV7?Jordach wrote: Mapgen V6 has two defined biomes, while Mapgen V7 has completely custom biomes which can be made from nyan rainbow to literally lava or even bones.
That choice is yours with V7.
Re: Post your modding questions here
Ackirb, what you need is the money mod as it does just what you request... You can have a shop chest or trade chest that you can configure to your own needs to buy and sell items for money or other items...
viewtopic.php?id=2263
viewtopic.php?id=2263
- paramat
- Developer
- Posts: 3700
- Joined: Sun Oct 28, 2012 00:05
- GitHub: paramat
- IRC: paramat
- Location: UK
Re: Post your modding questions here
RHR, lines 390 to 423 here https://github.com/minetest/minetest/bl ... nf.example
You can add those lines (without the #) to your minetest.conf file. Some of those affect mgv7, some are mgv6 only.
You can add those lines (without the #) to your minetest.conf file. Some of those affect mgv7, some are mgv6 only.
Re: Post your modding questions here
thx, I'll give them a try. ^.^paramat wrote:RHR, lines 390 to 423 here https://github.com/minetest/minetest/bl ... nf.example
You can add those lines (without the #) to your minetest.conf file. Some of those affect mgv7, some are mgv6 only.
Re: Post your modding questions here
Why is it impossible in singleplayer to /revoke a privilege that does not have give_to_singleplayer = false ?
For testing purposes I wanted to /revoke teleport and my new priv I had created, and I can't do it in singleplayer. Was this decision deliberate to reduce the risk of someone revoking the "privs" privilege on singleplayer and making their character unfixable? Or is there some other reason? Or is it just a bug? Because it seems like there would be some better way of protecting privs than locking all of the other privileges.
For testing purposes I wanted to /revoke teleport and my new priv I had created, and I can't do it in singleplayer. Was this decision deliberate to reduce the risk of someone revoking the "privs" privilege on singleplayer and making their character unfixable? Or is there some other reason? Or is it just a bug? Because it seems like there would be some better way of protecting privs than locking all of the other privileges.
Re: Post your modding questions here
Some questions:
1) Is it possible to create colored light? (e.g. red, blue, green)
2) Is it possible to force a fencelike block to connect to other not fencelike blocks?
3) How can I find out how much performance a mod needs? f5 and f6 show lots of information. Where can I look up what it means?
1) Is it possible to create colored light? (e.g. red, blue, green)
2) Is it possible to force a fencelike block to connect to other not fencelike blocks?
3) How can I find out how much performance a mod needs? f5 and f6 show lots of information. Where can I look up what it means?
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Post your modding questions here
1) Discussed a lot be4, answer stayed at No.RHR wrote:Some questions:
1) Is it possible to create colored light? (e.g. red, blue, green)
2) Is it possible to force a fencelike block to connect to other not fencelike blocks?
3) How can I find out how much performance a mod needs? f5 and f6 show lots of information. Where can I look up what it means?
2) Maybe - extend the collision block to a regular node and look if it works
3) Idk. add os.time()-things like in serval mapgens to see how much miliseconds it takes
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Re: Post your modding questions here
I want to spawn particles when eating something (the way it looks in minecraft). But it uses the whole texture of the item. How can I only use parts of it like when digging something?
There is a fence mod somewhere that does that, but it is somewhat hacky.RHR wrote:2) Is it possible to force a fencelike block to connect to other not fencelike blocks?
Re: Post your modding questions here
Yes, look at XDGAMERZzZ skyblock map. One of the mods in the mod zip file is called fences and I have seen these do this.RHR wrote:2) Is it possible to force a fencelike block to connect to other not fencelike blocks?
Re: Post your modding questions here
- You can make colored air nodes with drawtype airlike and give them a post_effect_colorRHR wrote:1) Is it possible to create colored light? (e.g. red, blue, green)
- Then you change the air around a lightsource that has been placed into a colored air node. While placing the item or through an ABM
Problems:
- When you want to be able to put lights on and off and when removing the lightsource, you'll need to change the air around it (back).
- How to handle the colored air around two different colored lightsources next or near each other (and three and when removing one...)
Edit: At least one typo
- philipbenr
- Member
- Posts: 1897
- Joined: Fri Jun 14, 2013 01:56
- GitHub: philipbenr
- IRC: philipbenr
- In-game: robinspi
- Location: United States
Re: Post your modding questions here
@RHR. There are two fence mods.
One is xfences, made by xyz (google "minetest xfences")
The second is fences by Blockmen (google "minetest fences")
xyz's is much more reliable than Blockmens, mainly because with Blockmens, some do not connect fully. So, if xfences is still around and downloadable, take a look. I believe that both are hacky, and neither will be of much use if you wish to have it simple. PM me if there is no copy of xfences avail. I might still have a copy
One is xfences, made by xyz (google "minetest xfences")
The second is fences by Blockmen (google "minetest fences")
xyz's is much more reliable than Blockmens, mainly because with Blockmens, some do not connect fully. So, if xfences is still around and downloadable, take a look. I believe that both are hacky, and neither will be of much use if you wish to have it simple. PM me if there is no copy of xfences avail. I might still have a copy
-
- Member
- Posts: 356
- Joined: Thu May 08, 2014 21:22
- GitHub: Maddie-Myina
- IRC: Maddie-Myina
- In-game: .
- Location: Far Eden
Re: Post your modding questions here
Do anyone like make a Game mode with me?
And I have no idea where else to ask this.
And I have no idea where else to ask this.
I'm a Transgender no shame about it.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.
I prefer to be considered as a "Girl/Lady/Miss/Madam/Female" for now on.
- HeroOfTheWinds
- Member
- Posts: 470
- Joined: Wed Apr 23, 2014 23:16
- GitHub: HeroOfTheWinds
- IRC: WindHero
- Location: Hawaii
Re: Post your modding questions here
It will usually depend on what the game you want to make is, and how much work is done, and what you are willing to do. A great place to actively discuss these things is IRC.Alt. Tester wrote:Do anyone like make a Game mode with me?
And I have no idea where else to ask this.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P
Re: Post your modding questions here
Lua syntax question.
I want to register a new type of door in a mod. So, I figured I'd just need to make my mod depend on doors and then call doors:register_door
But when I do I get:
Which means I'm doing something STUPID. Any help here?
I want to register a new type of door in a mod. So, I figured I'd just need to make my mod depend on doors and then call doors:register_door
But when I do I get:
Code: Select all
09:43:49: ERROR[main]: /usr/share/minetest/builtin/game/register.lua:60: Name doors:door_secret does not follow naming conventions: "modname:" or ":" prefix required
Re: Post your modding questions here
Never mind, it's always immediately obvious right after you post the question. wasn't complaining about calling doors:register_door, it was complaining about me naming the door doors:door_secret. duh!
Who is online
Users browsing this forum: No registered users and 12 guests