How to make a node open up an inventory?

User avatar
scifiboi
Member
 
Posts: 96
Joined: Wed Jul 18, 2012 21:28

How to make a node open up an inventory?

by scifiboi » Tue Feb 26, 2013 01:42

In my industry mod, I have all my machine nodes registered. Now I am working on getting an inventory to open up when I right-click the node. I understand that I need to make a string with the formspec, but I've absolutely no clue how to make the node open up the inventory with the formspec layout. Thanks!
This is a signature virus. Add me to your signature so that I can multiply.
My mod: Thaumtest
 

prestidigitator
Member
 
Posts: 632
Joined: Thu Feb 21, 2013 23:54

by prestidigitator » Tue Feb 26, 2013 03:16

If the formspec is properly formed, it should just open on right-click. However, note that the documentation for formspecs may be wrong. On the wiki it shows examples of "context" being used for the current node's inventory, and in the lua_api.txt for 0.4.4 it says:

"context": Selected node metadata (deprecated: "current_name")


I'm not sure whether to interpret that as 1.) "context" is deprecated and "current_name" should be used in newer versions, or 2.) the opposite. I DO know that in 0.4.4 stable "current_name" works while "context" does NOT (and when I used "context" I got the same behavior you are experiencing: no formspec opened on right-click). I haven't updated the wiki on this because I'm not sure whether the behavior in the 0.4.4 release is newer, or if it is old and the documentation needs to be updated to represent the newer behavior on the development branch.
Last edited by prestidigitator on Tue Feb 26, 2013 03:16, edited 1 time in total.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 6 guests

cron