Minetest logo

IRC log for #minetest, 2017-11-01

| Channels | #minetest index | Today | | Google Search | Plaintext

All times shown according to UTC.

Time Nick Message
00:06 TC01 joined #minetest
00:07 Redsprites joined #minetest
00:07 GreenDimond Problem solved
00:08 Redsprites Hello?
00:08 GreenDimond Greetings.
00:08 Redsprites OH COOL!
00:08 Redsprites Someone else is online!
00:08 Redsprites HI~
00:08 GreenDimond There are 170 people online..
00:08 GreenDimond look at the userlist
00:09 Tux[Qyou] joined #minetest
00:09 GreenDimond 169* (2 bots, and someone just joined)
00:09 Redsprites woah, I thought that was a long list of "slang" words and codes.
00:09 Redsprites Sorry, I'm an air head.
00:09 GreenDimond haha
00:09 GreenDimond Best thing I have heard all day
00:10 Redsprites Heck, I should've known better, I just saw your name on the list~
00:10 GreenDimond Yours is on there too ;)
00:10 GreenDimond (it is in alphabetical order.. if you didn't know)
00:11 Redsprites woah woah woah
00:11 Redsprites I'm not that slow
00:11 GreenDimond Of course, light-gray names usually mean they are afk or something
00:11 GreenDimond haha
00:11 Redsprites ah~
00:11 Redsprites well this is nice.
00:11 GreenDimond Indeed
00:12 Redsprites Glad to see that god plays Minetest!?!
00:12 GreenDimond Huh?
00:13 Redsprites XD someone's put their username as god!
00:13 GreenDimond *doesnt see any "god"..*
00:14 GreenDimond oh
00:14 GreenDimond I see it now
00:14 Redsprites ??? No pun intended but,  "_god_" is above all.
00:14 ShadowBot Redsprites: Error: You must be registered to use this command. If you are already registered, you must either identify (using the identify command) or add a hostmask matching your current hostmask (using the "hostmask add" command).
00:14 GreenDimond hahaha
00:14 GreenDimond shut up shadowbot :P
00:14 Redsprites Oh I was wondering if I could only see that.
00:15 Redsprites Shadowbot needs to be more "in the shadow's".
00:16 Redsprites Well now.
00:16 Redsprites Is anyone building things for the sake of fun, I wanna join in.
00:21 Redsprites Wait what?
00:22 Redsprites GREENDIMOND NO!
00:22 Redsprites Crap...
00:22 Redsprites well I'm out!
00:22 Redsprites I'll check up on this place tomorrow.
00:23 Redsprites Happy mining~
00:23 YellowberryHN joined #minetest
00:23 YellowberryHN Hello everyone.
00:23 YellowberryHN This is my official return
00:23 YellowberryHN How much of a return is still in debate, but I'm back
00:26 wilkgr joined #minetest
00:27 wilkgr Why doesn't minetest.colorize accept a table for the colour, like set_nametag_attributes does?
00:34 turtleman joined #minetest
01:07 YellowberryHN is there a way to make sure a setting is set in minetest.conf?
01:14 Calinou YellowberryHN: you can set a default value using something like `my_value = minetest.setting_get("whatever") or 20`
01:14 Calinou (note, the function call might be wrong, I didn't take a look at the recent API)
01:14 YellowberryHN can you set settings?
01:18 jas_ https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L4027
01:18 jas_ here, you have set, get, and a myriad of other methods.
01:33 YellowberryHN thanks jas_
01:33 ThomasMonroe joined #minetest
01:54 YuGiOhJCJ joined #minetest
01:55 soloojos joined #minetest
02:02 jas_ my pleasure.
02:13 YuGiOhJCJ joined #minetest
02:34 ssieb joined #minetest
02:34 Billre left #minetest
02:45 EinChan joined #minetest
03:06 turtleman joined #minetest
04:00 soloojos joined #minetest
04:15 wilkgr joined #minetest
04:16 wilkgr Finally got my internet to work again *sighs
05:08 YuGiOhJCJ joined #minetest
05:37 xerox123 joined #minetest
06:29 m712 joined #minetest
06:33 AlexYst joined #minetest
06:38 Hawk777 joined #minetest
06:44 YuGiOhJCJ joined #minetest
06:48 Fritigern joined #minetest
07:01 georgeowell joined #minetest
07:10 hisforever joined #minetest
07:11 hisforever is there a way to add lakes to a flat world?
07:16 torgdor joined #minetest
07:18 torgdor joined #minetest
07:20 torgdor joined #minetest
07:22 torgdor joined #minetest
07:23 torgdor joined #minetest
07:24 torgdor joined #minetest
07:41 gorilla joined #minetest
07:49 hisforever HI Can I put a lake in a flat world?
07:54 CWz joined #minetest
08:10 YuGiOhJCJ joined #minetest
08:39 est31 left #minetest
08:44 proller joined #minetest
08:47 lumberJ joined #minetest
08:47 asl97 joined #minetest
08:56 wilkgr joined #minetest
08:57 gorilla joined #minetest
09:34 gorilla_ joined #minetest
09:54 asl97 joined #minetest
10:02 nac joined #minetest
10:06 bas080 joined #minetest
10:18 paramat joined #minetest
10:24 paramat ~tell hisforever in mgflat you can't have 1 lake but you can have occasional scattered lakes. see https://github.com/minetest/minetest/blob/28841961ba91b943b7478704181604fa3e24e81e/minetest.conf.example#L2371 add 'mgflat_spflags = lakes,nohills' to minetest.conf before starting a new world. there are also parameters for adjusting the rarity, size and depth of lakes
10:24 ShadowBot paramat: O.K.
10:25 paramat ~tell hisforever i'm not sure if you meant to leave 2 mins after asking your question, but try to stay in channel for an hour or so to give someone time to see the question and answer :]
10:25 ShadowBot paramat: O.K.
10:50 wilkgr Is there a builtin function for converting the colour tables used by set_nametag_attributes to the hex notation used by colorize?
10:50 wilkgr It's easy enough to implement, but I'd rather use an inbuilt function :)
11:06 ensonic joined #minetest
11:08 deltasquared joined #minetest
11:09 deltasquared VanessaE: oh, that would be trivial to do in the existing direction code, and it would also work in the network mode as I plan to re-use that system
11:10 Tux[Qyou] joined #minetest
11:10 gorilla joined #minetest
11:19 deltasquared joined #minetest
11:29 bas080 joined #minetest
11:35 Fixer joined #minetest
11:37 CalebDavis joined #minetest
11:42 mstram joined #minetest
11:43 proller joined #minetest
11:44 mstram 'mornin from Toronto .. is there a known problem with the print() function for the mesecons luacontroller on Windows ?   I'm not getting any output in (debug.txt ??) or the chat console
11:45 sfan5 nope should work
11:46 deltasquared I have occassionally noticed print() playing up in a bunch of places but I never could seem to reproduce it, so I had assumed I had made a mistake somewhere.
11:46 sfan5 the output will go to the console window by default (which is not present on windows)
11:46 mstram 'mornin from Toronto .. is there a known problem with the print() function for the mesecons luacontroller on Windows ?   I'm not getting any output in (debug.txt ??) or the chat console
11:46 deltasquared "bunch of places" being both luacontrollers as well as mod init time
11:46 deltasquared mstram: you typed that twice :P
11:46 mstram sry ..mirc operator error ;)
11:46 deltasquared mstram: oh yeah, print() in a luacontroller does not print to the user's console
11:46 deltasquared it would be cool to but I know of no such mechanism
11:47 * deltasquared has an idea for a digilines device which you can right-click to recieve messages sent to it
11:47 mstram @sfan5 I ASSumed the "console" window referred to a CMD prompt ?  ... no ?
11:47 sfan5 yes
11:48 mstram yes what?
11:49 deltasquared just yes, print() should appear in the console output if you started MT that way
11:49 deltasquared (I don't know if MT always opens a console on windows, I haven't used it there)
11:51 mstram well according to the code in luacontroller print() actually calls dump() ... where is dump() ?  is it an "internal function" inside minetest.exe ? ... or somewhere else that I can "hook/debug" ?
11:52 deltasquared mstram: not sure, but dump() returns a string representation of the object you pass it
11:52 deltasquared so it'll print a pretty view of a table's values for instance
11:52 deltasquared I use it a lot from luacmd.
11:53 mstram dsq are you running on 'doze or 'nix ?
11:53 * deltasquared throws a penguin at mstram
11:54 deltasquared GAHNEEEW SLASH LEEENUUCCKS
11:54 deltasquared ahem.
11:57 mstram well that might be the problem.  I only found one other hit on google for the same problem for someone else running 'doze.  I updated my forum post to add that I'm running Win7, asking if anyone else https://forum.minetest.net/viewtopic.php?f=6&t=18745&p=298711#p298711
12:00 mstram where does dump output on 'nix?
12:02 deltasquared mstram: dump is not an output
12:02 deltasquared print() is
12:02 deltasquared dump() returns a string. it's usually print(dump(x)) where x is whatever you want to see
12:08 mstram well /lua print(dump(foo)) is working fine .. it's the *luacontroller* block where it's not working
12:14 EvergreenTree joined #minetest
12:18 mstram is the "/" (chat) command in the minetest_game lua src (mods) ?... maybe I can see if luacontroller (print()) can use code from there
13:05 Jordach joined #minetest
13:11 NathanS21 joined #minetest
13:15 mstram joined #minetest
13:20 bas080 joined #minetest
13:21 mstram found how to get luacontroller print() to send to the chat window ... I changed mods\luacontroller\init.lua : safe_print from 'print(dump(param))' to  minetest.chat_send_all(dump(param))  ... I guess I could leave the current *print* alone and add a new function instead ... will try that next ... **fix for non working #print()# (luacontroller) on Windows (7)
13:30 antims joined #minetest
13:30 Wuzzy joined #minetest
13:50 ThomasMonroe joined #minetest
14:03 xSmurf joined #minetest
14:14 FreeFull joined #minetest
14:19 twoelk joined #minetest
14:21 Billre joined #minetest
14:30 nowhere_man joined #minetest
14:39 xSmurf joined #minetest
14:53 Milan[m] joined #minetest
14:53 Wysteriary[m] joined #minetest
14:54 ericxdu[m] joined #minetest
15:04 bas080 joined #minetest
15:07 GreenDimond joined #minetest
15:07 GreenDimond How would I make a command detect all of a certain node in a world and put stuff in their inventories?
15:11 twoelk sounds like a mining cheat :-D
15:11 twoelk all your nyancats are belonging to us
15:12 GreenDimond huh?
15:12 Billre are belong*  ;D
15:12 GreenDimond I am saying the nodes themselves have inventoreis
15:12 johnnyjoy joined #minetest
15:12 GreenDimond and the nodes will be filled with stuff
15:12 Billre There's mods for that
15:12 Billre for certain chests
15:12 GreenDimond Oh?
15:13 Billre or are you talking about filling up machine inventories?
15:13 GreenDimond I am saying, for instance, a command will detect all chests of a certain type, and fill the chests with stuff.
15:14 GreenDimond I used "node" because they arent chests, but that is essentially the function.
15:14 GreenDimond If there is a mod that has that function, would be nice to know.
15:15 GreenDimond (so now, twoelk, not a mining cheat :P)
15:15 GreenDimond no*
15:15 GreenDimond I swear I can type
15:18 xSmurf joined #minetest
15:18 Billre I was on a server once where I found chests that had diamonds, gold and other things ... they were placed by the server.  But once I took the items out, the chest was empty
15:18 Billre I don't think that's what you're looking for
15:18 GreenDimond yeah no
15:18 GreenDimond There is CTF stuff, but that fills the chest after_place_node
15:19 GreenDimond I want it to fill with a command
15:19 Billre That's what I was going to suggest . .that if it's a subgame do that
15:19 GreenDimond it's a mod, and that function works, but its not what I want.
15:20 GreenDimond I want to be able to type something like /fillchests and it fills all chests detected in the world
15:21 proller joined #minetest
15:22 Billre I think the problem there would be map generation
15:22 Tux[Qyou] joined #minetest
15:22 GreenDimond how so?
15:23 GreenDimond the chests are placed by players
15:23 GreenDimond and then someone runs the command
15:23 GreenDimond and boom
15:23 GreenDimond chests filled
15:23 twoelk this will only work on loaded chunks though - or at loading
15:24 GreenDimond why?
15:24 GreenDimond oh
15:24 twoelk if you use chests that is
15:24 Billre Might want to look into the mod that replaces nodes when players get close
15:24 GreenDimond well they arent chests
15:24 GreenDimond uhg
15:24 GreenDimond thats not the function I want Billre
15:25 GreenDimond twoelk: Filling on server-restart would be nice, as long as it could be enabled/disabled by command.
15:25 twoelk ah, the apple-a-day thingie maybe
15:25 GreenDimond In fact, I prefer that it fills after restart.
15:26 GreenDimond But I dont know how to do that xD
15:27 twoelk maybe on join?
15:27 GreenDimond I dont want on_join
15:27 GreenDimond Arg
15:27 GreenDimond Are you listening?
15:27 GreenDimond All the node inventories/metas/whateveryouwanttocallit need to be filled up all at once, either after a restart or with a cmd.
15:28 rubenwardy GreenDimond, CTF works with the mapgen. TSM
15:28 rubenwardy doesn't help you though
15:28 GreenDimond I know
15:28 GreenDimond CTF fills the inventories when the chests spawn
15:28 rubenwardy minetest.find_nodes_in_range   then    minetest.get_inventory({type="node", position={}})
15:29 GreenDimond how large is the find_nodes_in_range?
15:30 rubenwardy large?
15:30 lumberJ GreenDimond, if refilling them on a restart is fine, why not an lbm? they won't be refilled all at once but they will be refilled as soon as the chunck that has the given node is loaded?
15:30 bas080 joined #minetest
15:31 GreenDimond they need to fill all at once
15:31 GreenDimond rubenwardy: will the find_nodes_in_range find all the nodes in the world?
15:32 GreenDimond looking at the api, it would be `minetest.find_nodes_in_area({-30000,-30000, -30000}, {30000, 30000, 30000}, "mynode:mymod")`
15:33 Fuchs a wild rubenwardy appears
15:33 rubenwardy no, it doesn't load map blocks
15:33 rubenwardy Fuchs :D
15:33 Fuchs Hi :)
15:33 Calinou hi
15:33 Fuchs got home safe, then. Great :)
15:33 rubenwardy it's a lot closer for me aha. How was your journey?
15:33 GreenDimond So is there any way at all to detect all of a certain node on server restart?
15:34 GreenDimond or no?
15:34 rubenwardy you could use an LBM. It's an ABM that runs once on a mapblock load
15:34 twoelk define all
15:34 rubenwardy good for migrations
15:34 Fuchs rubenwardy: safe, minor turbulences before landing
15:35 GreenDimond rubenwardy: The part I am not getting is "on mapblock load". Doesnt that mean it wont activate til someone walks over there?
15:35 twoelk all in all of a map that has not been generated yet?
15:35 rubenwardy correct
15:35 GreenDimond and mapblocks are unloaded on restart, correct?
15:36 GreenDimond twoelk: The only places this node would be is in generated areas, because how else would players place them? :P
15:38 rubenwardy Fuchs, well good you got back okay
15:38 twoelk yes but you seem to want to preload the whole allready generated map into memory to address certain nodes
15:38 rubenwardy Thanks very much for the chocolate, it's very nice :)
15:38 Fuchs you're welcome, glad you were able to come :)
15:38 GreenDimond twoelk: What I want is to fill all the nodes at once. Somehow detect all of that node that has been placed, and fill it.
15:39 twoelk rubenwardy: seems to have been an interesting event
15:39 GreenDimond (preferably in the most performance-efficient way possible)
15:39 twoelk action is taken only for what is currently in memory
15:39 GreenDimond hmmmm
15:39 GreenDimond I suppose,
15:39 Hijiri why does it need to be immediate?
15:40 Hijiri If you really wanted to you could keep a list of all of that node and use it to load the nodes
15:40 AlexYst joined #minetest
15:40 GreenDimond I suppose it doesn't need to be immediate, because if an LBM is active when a player loads the chunk, it wouldn't matter when it was filled, because once they come near, it's as if it was already filled, right?
15:40 Hijiri yeah
15:41 twoelk hmm add nodes to a list when they are generated, moddify list on command, make nodes lookup list on load
15:41 GreenDimond OK, so I have 2 options.
15:41 GreenDimond I feel like the LBM may be a better option
15:42 GreenDimond what say y'all though?
15:42 Hijiri I would say LBM is better
15:42 lumberJ that is essentially what an LBM is for
15:42 Hijiri if you keep a list you could get inconsistencies between the list and the map, if there are bugs or bad shutdowns of the server
15:42 lumberJ even if you could do it all at once, it would not be performance efficient
15:43 GreenDimond Alright
15:43 GreenDimond So now I get to figure out how to make an LBM do its job, and only activate when a command is run,
15:43 twoelk sokomine's teleporters might be a model with their destination updating function for the list variant
15:44 Robby joined #minetest
15:44 GreenDimond although I run into another problem
15:45 GreenDimond I only want it to work on nodes existing when the command is run
15:45 GreenDimond if any other nodes are placed after it, I dont want them to be filled.
15:45 GreenDimond unfortunately, an LBM will keep running
15:46 GreenDimond ok new idea
15:46 lumberJ LBM runs once, when the map chunk is loaded
15:46 GreenDimond yes.. but.. hmmmm
15:47 GreenDimond no that still has a problem
15:47 GreenDimond but I wont go into that
15:47 GreenDimond I think I have an easier way anyway
15:48 GreenDimond I know that homedecor has a calender that somehow detects the date - I think it updates on restart, right?
15:49 GreenDimond Nevermind, it only updates manually.
15:50 GreenDimond wait
15:51 GreenDimond hmmm nevermind
15:51 GreenDimond there really is no easy way to do this, is there.
15:51 lumberJ honestly its not completely clear what exactly you are trying to accomplish :P
15:51 lumberJ you want them to refill on restart or on command?
15:52 lumberJ when do you not want them to refill?
15:52 GreenDimond either way
15:52 GreenDimond either way works for me
15:52 GreenDimond as long as all of that certain node gets filled
15:52 lumberJ well the lbm will work with restart, but every restart it will run again
15:52 lumberJ everytime that block is reloaded
15:52 GreenDimond that can be fixed by setting a cmd to enable/disable the LBM
15:53 lumberJ well, maybe it could just check for the items and if they are still there, it wouldn't duplicate filling it, if that is what you are trying to prevent
15:54 GreenDimond but the problem is, say a chunck that has the node isnt loaded while the LBM is active, so when it finally gets loaded, the LBM is already disabled because we dont want it to keep filling the chests.
15:54 twoelk an LBM with expire date?  bestbefor  :-P
15:54 lumberJ well it won't keep filling the chests. it will only fill them once after a restart
15:54 GreenDimond I know
15:54 GreenDimond it keeps filling them after restarts
15:54 GreenDimond I dont want that
15:55 lumberJ and if you restart again, then just have it check if the chest has x number of items and don't let it refill
15:55 GreenDimond but I dont want it to refill even if the player has emptied it
15:55 GreenDimond it would be soooo much easier to tell you what I am making, but I would like it to stay secret for now >~<
15:56 twoelk I guess this works best with an external list that keeps track of who got howmany goodies when
15:56 twoelk sounds like you need santa's list -P
15:57 GreenDimond Wait...
15:57 lumberJ so GreenDimond, you only want it to happen once?
15:58 GreenDimond I could use that idea lumberJ but a bit different. Define the node to have a have_filled attribute set to false, and when the LBM comes along, check if its true, if not, fill it and set it to true.
15:58 xSmurf joined #minetest
15:58 GreenDimond That way, when the LBM comes by again, it knows that certain chests have already been filled
15:59 twoelk and control the LBM via config file?
15:59 GreenDimond Why would I need to control it?
15:59 lumberJ if this is a onetime deal 'run_at_every_load=false' will be simplest
15:59 lumberJ like christmas morning it runs and then it won't refill them
16:00 GreenDimond Hey congrats lumberJ you figured out what I am doing xD
16:00 twoelk else it keeps on going for ever and ever after - also you might want to use it at different times with different content
16:00 GreenDimond But again, the problem is, what if the player isnt on that day, so it never gets filled because the chunk never gets activated.
16:00 GreenDimond which means if it doesnt run next restart, it never gets filled.
16:00 lumberJ sure, just leave the lbm active
16:01 twoelk could be a nice tool for teachers that have kids build a project in minetest
16:01 lumberJ if it is set to run_at_every_load = false ...
16:01 lumberJ it will only ever refill the 'chest' or whatever once
16:01 GreenDimond oh, run_at_every_load means every chunk load, not server load xD
16:03 twoelk couldn't some achievement mod be canibalized for this?
16:03 lumberJ right, so if the player comes and loads their mapchunk later on, or places a node it shouldn't refill
16:04 lumberJ just the first time its loaded and the node is found already there
16:04 GreenDimond alright, so now I have to figure out how to set an LBM xD
16:04 lumberJ if you set it to true it will refill it at every restart
16:05 GreenDimond and that is set inside the LBM right?
16:07 lumberJ yep, see the example in the dev wiki
16:07 lumberJ just add that field inside where you register the lbm
16:09 lumberJ and your function will search for the node and replace it with a node with filled inventory
16:10 lumberJ the default is probably false anyway for the run_at_every_load
16:11 GreenDimond https://gist.github.com/GreenXenith/be409cc9ff13dc9a6daa05e3ef9ec2fd
16:11 GreenDimond that look right?
16:12 GreenDimond (lumberJ)
16:15 GreenDimond also, I have to set something to activate it, right? or will it start on its own?
16:15 Jousway joined #minetest
16:16 GreenDimond oh, I still need the has_filled check
16:17 lumberJ it will run automatically. i think you need to assign you 'inv' variable to the actual inventory associated with 'mynode'
16:17 lumberJ in other words get the inventory from the node before you try to stuff it
16:19 EvergreenTree joined #minetest
16:22 GreenDimond Alrightm updated gist https://gist.github.com/GreenXenith/be409cc9ff13dc9a6daa05e3ef9ec2fd (I wont bother changing names - dont care if you know what I am doing xD)
16:22 GreenDimond lumberJ^
16:22 lumberJ ok, give me a sec. afk
16:25 proller joined #minetest
16:27 twoelk can the inventory be filled by players? do you have to check if there is room?
16:27 bas080 joined #minetest
16:29 GreenDimond twoelk: No, they cannot be filled by players.
16:29 twoelk would the inventories belonging to for example banned players be filled?
16:29 asl97 GreenDimond: you should look into table and scope, the has_filled in your after place is local and is gone after running the function, the has_filled in the lbm is an empty table and you made a typo with the comparing, it will always be false.  you should also use actual bool rather than string.
16:30 GreenDimond asl97: `has_filled = {}` is outside after_place_node
16:32 GreenDimond asl97: should I change it to just `has_filled = bla` without the `local` inside after_place and the lbm?
16:34 asl97 even if you did that, it would only fill one stockings since you have set it to true and the next stocking wouldn't get filled
16:34 EinChan joined #minetest
16:35 GreenDimond ah
16:35 GreenDimond because it is changing the global variable
16:35 GreenDimond so I need to define the table inside the after_place?
16:35 GreenDimond so that each node has it's own has_filled?
16:35 Krock joined #minetest
16:36 asl97 the place where the table is define is fine, you need to actually use the table in after_place and in the lbm
16:36 GreenDimond How would I do that?
16:38 asl97 `has_filled[unique_id_per_stocking] = bla`,  read more about table usage at https://www.lua.org/pil/2.5.html
16:38 asl97 the unique key can be the pos hash,  there should be some kind of function in the minetest lua api.
16:39 asl97 although, something like this (the table) wouldn't persist through a reboot
16:39 GreenDimond oh
16:39 GreenDimond well then that's no good
16:39 GreenDimond I need to use a variable, dont I.
16:40 asl97 you can use the node meta
16:40 GreenDimond how?
16:43 asl97 something like meta = minetest.get_meta(pos); meta:set_int("filled", 1), see http://dev.minetest.net/NodeMetaRef
16:44 asl97 there isn't a set_bool afaik, set_int is probably the next best thing
16:45 GreenDimond alright
16:45 GreenDimond so by nodedef, meta:set_int("filled", 0), and the lbm will check for 0, and change it to meta:set_int("filled", 1).
16:46 proller joined #minetest
16:47 asl97 there is also the mod metadata storage if you don't want to put it into the node metadata but i haven't look much into that
16:47 GreenDimond in the LBM, it would check with `if meta:get_int("filled") = 0 then` right?
16:48 rubenwardy the mod storage is the exact same API
16:48 asl97 if meta:get_int("filled") == 0 then
16:48 rubenwardy get_string, get_int, and so
16:48 GreenDimond ah, ==.
16:48 asl97 two '='
16:49 rubenwardy one day player attributes and settings will use the same metadata API as nodes, stacks, and mods :/
16:50 asl97 rubenwardy: the different is that node metadata handle the per node stuff while you have to handle that yourself if you use the mod metadata storage.
16:51 GreenDimond Updated https://gist.github.com/GreenXenith/be409cc9ff13dc9a6daa05e3ef9ec2fd . Also, attempted to make a command to enable the LBM when wanted - dont know if it is correct.
16:52 asl97 GreenDimond: the lbm will never get register
16:53 GreenDimond why not? (yeah, probably a n00b error).
16:54 asl97 the mod file are run just once,  even if you change the variable, it doesn't rerun the file,  not to mention, i don't think minetest allow registering anything after the server started.
16:55 GreenDimond so how would I make a command to enable/disable the LBM?
16:55 twoelk how does the set command work?
16:55 asl97 also, you have local on enable_stocking_lbm, it's gone after it been run >.>
16:56 GreenDimond I has problems with local >.<
16:57 GreenDimond twoelk: afaik, it sets stuff in the minetest.conf to whatever you set it to.
16:59 GreenDimond asl97: So how would I make a command to disable/enable the LBM, because this mod will be enabled long before I want the LBM to be enabled.
17:00 asl97 you can't, afaik
17:01 GreenDimond So I can just comment it out for now and uncomment it before the restart I want it to start working on?
17:02 fwhcat joined #minetest
17:02 twoelk check for server date or maybe check if the xmas tree at spawn is lit or norad has detected a fast unknown flying object?
17:04 asl97 GreenDimond: couldn't you use on right click and show formspec?
17:04 GreenDimond huh?
17:07 asl97 on right click, you check for condition and stuff, fill it if it met condition, then show the formspec
17:10 GreenDimond hey, that's an idea.
17:10 GreenDimond :|
17:10 GreenDimond why didn't I think of that before
17:11 GreenDimond I wouldn't even need an LBM
17:11 GreenDimond right?
17:11 GreenDimond could I make it check it's own meta int?
17:11 GreenDimond or wait
17:12 GreenDimond no I wouldnt even need the int
17:12 GreenDimond :o
17:14 Jousway joined #minetest
17:16 pulec joined #minetest
17:25 nac joined #minetest
17:33 ssieb joined #minetest
17:44 GreenDimond n00b question: how do I set a variable properly?
17:45 GreenDimond obviously `local foo = true` isnt correct, do I just leave off the `local`?
17:45 rubenwardy yes
17:45 rubenwardy local is only used for declarations
17:46 rubenwardy If lua was a sane language, it would require you to use a keyword to make a global variable
17:46 rubenwardy like    global foo
17:46 rubenwardy but it doesn't
17:47 rubenwardy so an assignment will make a global if no local of that name exists
17:47 GreenDimond alright, so if I were to have a cmd change `foo`, I would define a function that just has `foo = true` and then inside the chatcommand `func = function(name, param) function.name()`
17:48 rubenwardy Only make global variables if they have the same name as you mod, and they are an API table
17:48 rubenwardy I'm not sure what function.name() is
17:48 rubenwardy or where foo is defined
17:48 GreenDimond just the function name
17:48 rubenwardy ah, just some random function
17:48 GreenDimond lemme make a gist
17:48 rubenwardy should work then, all though I hope foo isn't global
17:51 GreenDimond rubenwardy: https://gist.github.com/GreenXenith/3b995de1a346a2d1324d161211a0f728
17:51 GreenDimond I have a feeling I did it wrong :P
17:52 rubenwardy you probably want something like this: https://gist.github.com/rubenwardy/7ead7cb2ecd71abf2159f2b2ab04d4aa
17:52 rubenwardy make sure your mod is called "stockings"
17:52 GreenDimond it's not, but that is the file it is in
17:52 GreenDimond stocking.lua
17:53 GreenDimond and I have a stocking = {}
17:53 GreenDimond though I didnt put it in the gist
17:53 rubenwardy the only globals you make should be the name of the mod
17:54 GreenDimond here is the entire file that is in https://gist.github.com/GreenXenith/d0cedb7292ca92d57bbde6209ecf0afd
17:54 rubenwardy can do          modname.stockings.fill_stocking()    though
17:55 GreenDimond and so far it has worked
17:55 rubenwardy you can have local in a file, like a function
17:55 rubenwardy it will work if you have other globals, but is very much bad practice
17:55 GreenDimond so would I add `local` in front of each of the 4 tables at the top?
17:56 rubenwardy yeah
17:56 rubenwardy that would make it only accessible in the file
17:57 GreenDimond oh, btw this function is for enabling the stockings filling on access
17:57 GreenDimond not whether they are filled or not
17:57 GreenDimond but I suppose that doesnt matter atm
18:08 swift110 joined #minetest
18:09 ThomasMonroe joined #minetest
18:10 GreenDimond rubenwardy: Updated https://gist.github.com/GreenXenith/d0cedb7292ca92d57bbde6209ecf0afd , note lines 117-124 (checks for can_fill, I hope I did that right?) and 160-171 (fixed variable function).
18:15 sonicpp joined #minetest
18:20 GreenDimond is that stuff correct rubenwardy?
18:21 rubenwardy yeah, looks ok
18:21 rubenwardy err
18:21 rubenwardy stocking.can_fill = false
18:21 rubenwardy not   local stocking.can_fill
18:21 GreenDimond oh
18:21 GreenDimond do I still need the local?
18:22 GreenDimond or no `local` and just `stocking.can_fill = false`?
18:23 Telesight joined #minetest
18:25 GreenDimond rubenwardy do I still need the `local`?
18:37 GreenDimond he must be afk
18:46 GreenDimond rubenwardy: So apparently, MT doesn't like the `.` in the 2 table names on line 3 and 4.. but only because I added `local`
18:46 GreenDimond no idea why?
18:55 Dargod How can I remove the disappearance of placed blocks?
18:56 Dargod I already trued set full_block_send_enable_min_time_from_building = 4
19:00 Jousway joined #minetest
19:00 proller joined #minetest
19:02 deltasquared joined #minetest
19:03 GreenDimond rubenwardy: I have it working mostly now I think. the 2 tables with `.` in the name had to have the `local` taken off.
19:03 GreenDimond A new question
19:04 GreenDimond is closing a singleplayer world and opening it again the same as restarting a multiplayer server?
19:06 illwieckz joined #minetest
19:06 deltasquared GreenDimond: for the most part, yes. certainly from the point of view of the mods that's what happens
19:07 GreenDimond darn. That means that using a command to set a variable to another thing wont work, because it resets when you restart.
19:07 deltasquared GreenDimond: what variable would this be?
19:07 GreenDimond just a variable I made
19:08 GreenDimond changeable with a command
19:11 deltasquared GreenDimond: you could always have a per-world config file
19:11 GreenDimond Yes, I thought about that.
19:27 soloojos joined #minetest
19:37 illwieckz_ joined #minetest
19:47 swift110 is the recent minetest event on youtube yet?
19:49 deltasquared !mod ambience
19:49 MinetestBot deltasquared: Immersive Sounds [ambience] by Neuromancer - https://forum.minetest.net/viewtopic.php?t=2807
19:49 deltasquared hmm, no, that's not quite what I had in mind
19:57 Shara swift110: if you mean freenode #live, it was a freenode event, not a minetest event.
19:57 Shara There's not really anything Minetest related to put on youtube from it.
19:59 Fuchs Hai Shara!
19:59 Shara Hi Fuchs!
19:59 Shara GUess what chcolate I was eating today? :D
19:59 Fuchs so you made it safely back home, glad to see
19:59 Shara Guess/chocolate*
19:59 Fuchs aww, you still have some left? Enjoy :)
20:00 Shara Got home yesterday evening.
20:00 Fuchs yes, I'm afraid the only thing worth uploading are talks, and there was none for minetest. We do have pictures, but I have to admit that the ones of minetest are unfortunately all a bit unfocussed, plus we weren't planning on releasing them
20:00 Fuchs ah, good :)
20:01 Shara I tend to vanish when cameras get pointed :D
20:02 Fuchs I think I did catch you, but see above, first of all not terribly focussed, and not planned to be released :p
20:02 Fuchs maybe mike had better luck
20:03 Fuchs anyway, it was nice having you two there, and I hope to see you again next year!
20:03 Fuchs (I might bring more Toblerone, since that is what I am good at)
20:08 Shara Fuchs: Likewise, it was a pleasure to meet you and the others there as well
20:09 Fuchs \o/
20:09 Shara And if you're offering Toblerone again... what can I say? That's an easy way to get me moving :D
20:09 tpe joined #minetest
20:09 Fuchs yeah, definitely bringing that again. I was also planning to bring http://www.fixderfuchs.ch/wp-content/uploads/2013/10/fix_by_laederach.jpg   these, but they were out of stock :(
20:10 Shara That's maybe too adorable to actually eat!
20:11 Fuchs yes, I heard that from a couple of people, and it at least one case it started collecting mold, which is less cute
20:11 Fuchs and should have been eaten, because by then it was a bit of a waste
20:13 Shara Sometimes simple chocolate bars are better because of this :)
20:14 Fuchs yeah, I'll definitely also bring just regular bland Toblerone
20:14 Shara And coconut :)
20:15 Shara Have to head off now - thanks again, and maybe more MT people will join us next year
20:15 Fuchs well yes, black, white, regular, crunchy and coconut
20:15 Fuchs would be great, yes. Have a nice evening!
20:15 Shara You too!
20:22 illwieckz joined #minetest
20:25 illwieckz_ joined #minetest
20:37 Taoki joined #minetest
20:45 troller joined #minetest
20:58 Tmanyo joined #minetest
20:59 AlexYst joined #minetest
21:13 swift110 joined #minetest
21:34 EvergreenTree joined #minetest
21:35 guru joined #minetest
21:40 wilkgr joined #minetest
22:04 guru__ joined #minetest
22:14 Lone-Star joined #minetest
22:30 * Sokomine grabs some toblerone from fuchs and runs away with it
22:36 Tux[Qyou] joined #minetest
22:38 Tuxedo[Qyou] joined #minetest
22:41 rubenwardy Fuchs' Foxes! :O
22:44 swift110 hey rubenwardy
22:44 guru joined #minetest
22:48 rubenwardy GreenDimond, you should avoid using per world config files. Mod storage is usually what you want
22:48 Natechip joined #minetest
22:48 rubenwardy also, variables can't have dots in them
22:49 rubenwardy so    foo.bar = 3   means get the foo table, get the bar key, then set to 3
22:49 rubenwardy "foo.bar" is not a variable. foo is a variable, and bar is a member of that foo table
22:50 Loquendero joined #minetest
22:52 Loquendero joined #minetest
22:53 GreenDimond rubenwardy: ahh, ok. so what do you suggest I do instead of config files?
22:54 rubenwardy local storage = minetest.get_mod_storage()                  storage:get_bool("is_full")              storage:set_bool("is_full", true)
22:54 rubenwardy make sure the get_mod_storage is called from init.lua scope
22:54 rubenwardy not in a function
22:55 rubenwardy however, you should probably use node meta data to store this
22:55 GreenDimond Can it go in stocking.lua?
22:55 rubenwardy not sure
22:55 GreenDimond how would I use metadata?
22:55 rubenwardy https://rubenwardy.com/minetest_modding_book/en/chapters/node_metadata.html
22:56 GreenDimond Yes I know that, but metadata is per-node.
22:56 GreenDimond It cant be per-node in order to work.
22:56 GreenDimond It has to be a setting of sorts.
22:57 GreenDimond The stocking has to know on-access, whether its allowed to fill or not, and that has to be done with something that is not metadata, either a variable or setting or something.
22:58 rubenwardy what about multiple players?
22:59 GreenDimond what about multiple players?
22:59 GreenDimond What do you mean?
22:59 rubenwardy if there are multiplayers, they'll all use the same value if it's a variable or setting
22:59 rubenwardy should each player have their own value?
22:59 rubenwardy if no - mod storage
23:00 rubenwardy if yes - player attributes
23:00 GreenDimond I want them to all follow the same value.
23:01 GreenDimond If the setting is set to fillable, then the first time they access the stocking it gets filled. If not fillable, then the stocking wont get filled.
23:01 GreenDimond So I would use modstorage?
23:01 rubenwardy yeah
23:02 lumberJ joined #minetest
23:15 swift110 joined #minetest
23:22 GreenDimond rubenwardy is storage:get_bool("is_full") for the on_rightclick to check for?
23:32 GreenDimond rubenwardy: I get the error attempt to call method set_bool (a nil value)
23:32 GreenDimond does that mean it needs to be in the init.lua?
23:33 rubenwardy huh
23:33 riff-IRC joined #minetest
23:33 rubenwardy get/set_bool doesn't exist
23:33 rubenwardy use     minetest.is_yes(storage:get_bool("is_full"))    for reading
23:33 jcjordyn120 joined #minetest
23:33 GreenDimond but you do I set it?
23:33 GreenDimond how*
23:33 AntumDeluge joined #minetest
23:33 rubenwardy and       storage:set_string("is_full",  is_full and "true" or "false")
23:34 rubenwardy oops
23:34 rubenwardy use     minetest.is_yes(storage:get_string("is_full"))    for reading
23:34 rubenwardy is_full and "true" or "false"    returns "true" if is_full is truthy, and "false" otherwise
23:36 est31 joined #minetest
23:37 GreenDimond wait
23:37 GreenDimond rubenwardy, you put the true or false in the set function
23:38 GreenDimond why?
23:38 rubenwardy ?
23:38 GreenDimond I want the function to enable it?
23:38 rubenwardy not sure what you mean?
23:38 GreenDimond storage:set_string("is_full",  is_full and "true" or "false")
23:38 GreenDimond that is for setting is_full to true or false
23:38 GreenDimond right?
23:38 rubenwardy yeah
23:38 GreenDimond how?
23:39 GreenDimond it just returns stuff
23:39 GreenDimond it reads it
23:39 rubenwardy I'm not sure what you mean
23:39 GreenDimond arg
23:39 GreenDimond how do I use it
23:40 GreenDimond `function stocking.enable_can_fill()
23:40 GreenDimond storage:set_string("can_fill",  can_fill and "true" or "false")
23:40 GreenDimond end`
23:40 GreenDimond that is what I am using
23:40 GreenDimond doesnt seem right
23:40 rubenwardy can_fill will be a variable to whether it should be true or false
23:40 GreenDimond but how do I set it to true or false?
23:41 rubenwardy so if you always want to set it to true, then   storage:set_string("can_fill",  true and "true" or "false")    which is equivilent to    storage:set_string("can_fill",  "true")
23:41 GreenDimond does it matter which method I use?
23:41 rubenwardy both will work, but the latter is better
23:42 GreenDimond ooohhh, I get what you meant by "true" or "false" now
23:42 rubenwardy https://gist.github.com/rubenwardy/a48ba9a451c142660c7b314be02ab251
23:42 rubenwardy updated, forgot "function"
23:43 rubenwardy if you only set it to true or false, best just to use this   storage:set_string("can_fill",  "true")
23:44 GreenDimond rubenwardy: https://gist.github.com/GreenXenith/4cfda6f23def80b997f4e9e10c34b739
23:45 rubenwardy looks correct
23:46 proller joined #minetest
23:55 AlexYst joined #minetest
23:56 GreenDimond Looks like it worked...

| Channels | #minetest index | Today | | Google Search | Plaintext