Tables in settings (minetest.conf)?

lemmingsmusic
New member
 
Posts: 4
Joined: Mon May 20, 2019 07:53

Tables in settings (minetest.conf)?

by lemmingsmusic » Wed May 22, 2019 13:53

Is there any way of creating a setting that contains a list of items in a table?
So (for example) you could have a mod that calls minetest.override_item for a list of nodes defined in minetest.conf.

lua_api.txt mentions the method get_names, but it's not clear on how to use it, or whether it does what I want it to (and I've not managed to figure it out through experimenting).
 

User avatar
Linuxdirk
Member
 
Posts: 2169
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk

Re: Tables in settings (minetest.conf)?

by Linuxdirk » Wed May 22, 2019 14:07

I once did this with flags. Flags are basically values that are separated by comma.

Code: Select all
local my_values = minetest.settings:get('mymod_myoption') or 'my,default,values'

for single_value in string.gmatch(my_values, "%a+") do
   print(single_value)
end
 

lemmingsmusic
New member
 
Posts: 4
Joined: Mon May 20, 2019 07:53
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 2 guests