Post your modding questions here

User avatar
stu
Member
 
Posts: 923
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: Only Owner can take/put/move items in an inventory

by stu » Tue Jun 03, 2014 19:41

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!


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).
 

User avatar
Ackirb
Member
 
Posts: 23
Joined: Thu Mar 27, 2014 21:01
Location: United States

Re: Only Owner can take/put/move items in an inventory

by Ackirb » Wed Jun 04, 2014 13:55

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).


I have actually been using your trade NPC for awhile now. Good job on that, by the way - I really like it.
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) Not downloaded yet
 

User avatar
stu
Member
 
Posts: 923
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: Only Owner can take/put/move items in an inventory

by stu » Wed Jun 04, 2014 17:40

Ackirb 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

You can use a detached inventory, just make sure the allow_take function returns 0
Code: Select all
inv = minetest.create_detached_inventory("display", {
   allow_take = function(inv, listname, index, stack, player)
      return 0
   end,
})
 

iPushButton1997
Member
 
Posts: 15
Joined: Sun Dec 16, 2012 20:18
Location: Mississippi

Re: Post your modding questions here

by iPushButton1997 » Fri Jun 06, 2014 03:33

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.
 

User avatar
Jordach
Member
 
Posts: 4523
Joined: Mon Oct 03, 2011 17:58
Location: Blender Scene
GitHub: Jordach
IRC: Jordach
In-game: Jordach

Re: Post your modding questions here

by Jordach » Fri Jun 06, 2014 09:00

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.

http://dev.minetest.net/

and

https://github.com/minetest/minetest/bl ... ua_api.txt

Are both good places. (And good to see you about)
viewtopic.php?f=10&t=19056 Solar Plains Dev Server
 

iPushButton1997
Member
 
Posts: 15
Joined: Sun Dec 16, 2012 20:18
Location: Mississippi

Re: Post your modding questions here

by iPushButton1997 » Sat Jun 07, 2014 01:42

Jordach wrote:
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.

http://dev.minetest.net/

and

https://github.com/minetest/minetest/bl ... ua_api.txt

Are both good places. (And good to see you about)


Thanks man. And it feels good being back. Hopefully I can get back to my old work :P
 

User avatar
ak399g
Member
 
Posts: 160
Joined: Tue Jul 30, 2013 02:36
In-game: SAFR

Re: Post your modding questions here

by ak399g » Sat Jun 07, 2014 16:02

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.
 

Sokomine
Member
 
Posts: 3976
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: Post your modding questions here

by Sokomine » Sun Jun 08, 2014 15:07

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.

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.
 

User avatar
RHR
Member
 
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Sun Jun 08, 2014 15:37

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?
 

User avatar
Jordach
Member
 
Posts: 4523
Joined: Mon Oct 03, 2011 17:58
Location: Blender Scene
GitHub: Jordach
IRC: Jordach
In-game: Jordach

Re: Post your modding questions here

by Jordach » Sun Jun 08, 2014 18:13

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?

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.
viewtopic.php?f=10&t=19056 Solar Plains Dev Server
 

User avatar
RHR
Member
 
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Sun Jun 08, 2014 19:15

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.

Yep the custom biomes are awesome, but is that the only difference? Is it for example possible to "mod" the surface(mountains) of mapgenV7?
 

User avatar
TenPlus1
Member
 
Posts: 2670
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: Post your modding questions here

by TenPlus1 » Sun Jun 08, 2014 19:18

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
 

User avatar
paramat
Developer
 
Posts: 3580
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: Post your modding questions here

by paramat » Mon Jun 09, 2014 02:09

RHR, lines 390 to 423 here https://github.com/minetest/minetest/blob/master/minetest.conf.example
You can add those lines (without the #) to your minetest.conf file. Some of those affect mgv7, some are mgv6 only.
 

User avatar
RHR
Member
 
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Mon Jun 09, 2014 17:47

paramat wrote:RHR, lines 390 to 423 here https://github.com/minetest/minetest/blob/master/minetest.conf.example
You can add those lines (without the #) to your minetest.conf file. Some of those affect mgv7, some are mgv6 only.

thx, I'll give them a try. ^.^
 

Kilarin
Member
 
Posts: 778
Joined: Mon Mar 10, 2014 00:36

Re: Post your modding questions here

by Kilarin » Mon Jun 09, 2014 18:59

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.
 

User avatar
RHR
Member
 
Posts: 215
Joined: Mon Jan 27, 2014 20:07
GitHub: RHRhino

Re: Post your modding questions here

by RHR » Sat Jun 14, 2014 18:46

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?
 

User avatar
Krock
Developer
 
Posts: 4478
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Post your modding questions here

by Krock » Sat Jun 14, 2014 18:52

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?


1) Discussed a lot be4, answer stayed at No.
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>
 

User avatar
Casimir
Member
 
Posts: 1163
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: Post your modding questions here

by Casimir » Sat Jun 14, 2014 19:28

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?

RHR wrote:2) Is it possible to force a fencelike block to connect to other not fencelike blocks?

There is a fence mod somewhere that does that, but it is somewhat hacky.
 

User avatar
LionsDen
Member
 
Posts: 530
Joined: Thu Jun 06, 2013 03:19

Re: Post your modding questions here

by LionsDen » Sat Jun 14, 2014 20:47

RHR wrote:2) Is it possible to force a fencelike block to connect to other not fencelike blocks?


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.
 

User avatar
Topywo
Member
 
Posts: 1721
Joined: Fri May 18, 2012 20:27

Re: Post your modding questions here

by Topywo » Sat Jun 14, 2014 22:31

RHR wrote:1) Is it possible to create colored light? (e.g. red, blue, green)


- You can make colored air nodes with drawtype airlike and give them a post_effect_color
- 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
 

User avatar
philipbenr
Member
 
Posts: 1688
Joined: Fri Jun 14, 2013 01:56
Location: United States
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi

Re: Post your modding questions here

by philipbenr » Sun Jun 15, 2014 08:48

@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
 

User avatar
TG-MyinaWD
Member
 
Posts: 356
Joined: Thu May 08, 2014 21:22
Location: Far Eden
GitHub: Maddie-Myina
IRC: Maddie-Myina
In-game: .

Re: Post your modding questions here

by TG-MyinaWD » Wed Jun 18, 2014 00:06

Do anyone like make a Game mode with me?
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.
 

User avatar
HeroOfTheWinds
Member
 
Posts: 470
Joined: Wed Apr 23, 2014 23:16
Location: Hawaii
GitHub: HeroOfTheWinds
IRC: WindHero

Re: Post your modding questions here

by HeroOfTheWinds » Wed Jun 18, 2014 02:39

Alt. Tester wrote:Do anyone like make a Game mode with me?
And I have no idea where else to ask this.

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.
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
 

Kilarin
Member
 
Posts: 778
Joined: Mon Mar 10, 2014 00:36

Re: Post your modding questions here

by Kilarin » Wed Jun 18, 2014 15:05

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:
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

Which means I'm doing something STUPID. Any help here?
 

Kilarin
Member
 
Posts: 778
Joined: Mon Mar 10, 2014 00:36

Re: Post your modding questions here

by Kilarin » Wed Jun 18, 2014 15:10

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!
 

PreviousNext

Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest