Time Nick Message 02:01 TheInformer Where is the code for the android controls located? 02:21 TheInformer I need help with a mod now 02:24 TheInformer when i try to do local idx = player:hud_add({...}) it returns "Attempt to index a local 'player' (a nil value) 02:25 VanessaE if the place in your code that you're doing that command doesn't have player defined (e.g. passed along as part of a callback), well..you get the idea. :) 02:25 VanessaE look in lua_api.txt, you'll be able to tell (it'll be "placer", "digger", "puncher", or whatever, but they're all just the player object) 02:27 TheInformer i had this aswell local player = minetest.get_player_by_name() 02:27 TheInformer and then the above code 02:28 VanessaE pastebin the full code 02:29 VanessaE and, for that ^^ call, you have to supply a player name 02:29 VanessaE (which you almost never want to make up) 02:29 TheInformer http://pastebin.com/WzBr9N4V 02:29 TheInformer so "username"? 02:29 VanessaE no, you can't do that. 02:29 VanessaE you have to get the player name from a call back or something 02:30 thePalindrome Most callbacks just give you the player object anyhow 02:30 VanessaE for example, the above code would probably be best run from within minetest.register_on_prejoinplayer(func(name, ip)) 02:30 VanessaE er, on_joinplayer rather 02:31 TheInformer do i need the local player = ...? 02:32 VanessaE you're not listening :P 02:32 TheInformer Sorry 02:32 VanessaE you have to get the player object from a callback 02:33 VanessaE from there, get the player name if you need it, but in the case of your code there, player would BE the player object (not the name) 02:33 TheInformer minetest:player? 02:33 VanessaE so you need to run your code from inside on_joinplayer or something, and get the player object from there. 02:34 TheInformer ok 02:34 TheInformer i tried 02:34 VanessaE (the lua_api doesn't make it perfectly clear, but on_joinplayer passes along a single item: the player object 02:35 TheInformer something like this? 02:35 TheInformer http://pastebin.com/wyC2eUGf 02:35 VanessaE I'm not sure, but that's close 02:36 TheInformer that returns unexpected symbol near 'local' on line 2 02:37 VanessaE http://pastebin.ubuntu.com/23951881/ 02:37 diemartin TheInformer: do you have any programming experience? 02:37 VanessaE this is how it's used in cheapie's newplayer mod 02:38 diemartin also greetings 02:38 VanessaE hi 02:38 * cheapie peeks in for a second and returns to working on his hand dryer mod 02:38 VanessaE you can see in that paste basically what you wanna do 02:39 TheInformer diemartin: i have programming experience just not very much in lua 02:42 TheInformer i did it, for now 02:43 TheInformer thanks for the help and i might need more later 03:04 TheInformer how do i get the name of a node? 03:05 TheInformer that the player is pointing at 03:09 VanessaE minetest.get_node(pos).name 03:09 VanessaE where pos is taken from pointed_thing 03:10 VanessaE (there's an API call for that, too) 03:10 VanessaE get_pointed_thing_pos or some such 03:11 cheapie VanessaE: https://github.com/cheapie/handdryer 03:11 VanessaE wait what? 03:11 VanessaE :P 03:11 cheapie Adds hand dryers (normal and automatic). Screenshot: https://cheapiesystems.com/media/images/screenshot_20170207_210934.png 03:11 VanessaE heh 03:11 cheapie [19:08:19] We need some hand dryers to go with these sinks :P 03:11 cheapie [19:09:02] I agree. 03:11 VanessaE well, you know lezzy and I were considering renaming Home Decor to "Building Decor"... 03:11 VanessaE maybe the time has come to do that :P 03:13 cheapie Maybe. 03:19 TheInformer does minetest.get_node(pos).name return a string? 03:20 VanessaE yes 03:20 TheInformer ok 03:20 TheInformer thought so 03:20 VanessaE but generally you want to do something like, local node = minetest.get_node(pos) and then reference node.name later on as needed 03:34 TheInformer i keep getting this same error "Attempted to index local 'node' (a nil value) 03:36 TheInformer pastebin.com/xWpPm3cz this is my current code 03:37 VanessaE does {pos} point to a node that's currently loaded? 03:37 VanessaE e.g. the mapblock it's in has been loaded t 03:37 VanessaE -t 03:38 TheInformer I assume 03:38 VanessaE don't assume 03:38 VanessaE where are you getting {pos} from? 03:38 TheInformer good point... 03:47 TheInformer so could i use something like this "local pos = minetest.get_pointed_thing_position(pointed, under)" 03:48 VanessaE if pointed_thing is passed along to your code from the engine, that may work 03:48 VanessaE you always have to start from the notion of the engine passing things to your code, whether it's the player object, the position of a node, or whatever 03:48 TheInformer what do you mean? 03:49 TheInformer oh 03:49 VanessaE whatever callback it is you run your code from, that's what determines what the engine gives you to work with 03:50 TheInformer what callback should i use? 03:50 VanessaE depends on what your code needs to do 03:51 TheInformer find the name of the block the player is pointed at, for now anyways 03:51 VanessaE and where, in your code, is the player at when you do that? 03:51 VanessaE are you running an on_punch? on_joinplayer? 03:51 TheInformer on_joinplayer 03:51 TheInformer which wont work 03:51 TheInformer i think 03:52 VanessaE what exactly are you trying to do? 03:52 VanessaE why do you need to know what the player's pointing at? 03:53 TheInformer So I can display some things on the screen 03:53 VanessaE so you have what, a node that you need to punch to cause a formspec to open? 03:53 TheInformer that have to do with the node 03:53 TheInformer No 03:53 TheInformer No formspecs 03:54 VanessaE well whatever it is 03:54 TheInformer i want it to be automatic where you dont have to punch the node 03:54 VanessaE so you want to show something to the player as soon as he or she joins? 03:55 VanessaE or more like if the user walks over a special node or something? 03:55 thePalindrome Seems to be when they point at the note 03:55 thePalindrome *node 03:56 VanessaE you can't just randomly point at a node. there needs to be some action taken to trigger the event 03:57 cheapie globalstep :P 03:57 VanessaE globalstep doesn't return anything useful except dtime 03:58 cheapie But then you can get a list of players, loop through that, and do whatever. 04:01 VanessaE true, but that's horribly hacky, slow, and you still don't know where the player is and can't determine what they're pointing at, since the latter is client-side 04:01 VanessaE (that's why there needs to be an event that passes pointed_thing or pos to the code) 04:02 VanessaE actually I'm wrong 04:02 VanessaE https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L2931-L2932 04:03 VanessaE so you CAN see what the player's pointed at, maybe 04:03 VanessaE or at least which way they're looking 04:03 VanessaE then you'll have to calculate which node positions are along that vector, read those, and see if one of them should elicit the "display whatever" 04:03 VanessaE but globalstep runs only every 1/10th second 04:04 VanessaE so too slow to catch fast player movements, plus that sort of code would be a CPU hog 04:04 TheInformer i think on_punch will work fine for now 04:05 TheInformer Thanks Very Much for all the help 04:05 TheInformer If i ever release this mod I will give credit 04:05 VanessaE good luck 04:05 TheInformer Thanks 04:05 TheInformer bye 06:49 MinetestBot 02[git] 04nerzhul -> 03minetest/minetest: Fix android build 13607dab2 https://github.com/minetest/minetest/commit/607dab2b0dff3ca5bf59263e18f8eaab3c21b946 (152017-02-08T06:47:56Z) 06:52 Baffy[m] does anyone know how to adjust the spawn rate on Mobs Redo 06:52 Baffy[m] i see the setting, but what's 1000? what metric is it using? 06:53 Baffy[m] or is there a more popular mob addon? 06:53 Baffy[m] i never see animals anywhere with the default settings 06:55 Baffy[m] plz ping me if you know, i might sleep soonish 08:05 PureTryOut[m] is there no official mob API? not planned either? 08:24 sofar PureTryOut[m]: there is no consensus on any API right now, and none have been submitted for inclusion 08:25 PureTryOut[m] so it's not that it's not wanted, it's just that none has been submitted as of yet? 08:25 PureTryOut[m] seeing as there are some API's in the form of mods, I wonder why none of those authors have submitted a core API yet 08:53 PureTryOut[m] Mobs are quite an essential aspect of any game like Minetest, strange that there is no API for it yet 09:17 JamesTait Good morning all! Happy Wednesday, and happy Kite Flying Day! 😃 10:08 passant[m] baffy: well one way is the documented way - manually for each mob or just increase the check radius ... a function somewhere in the api.lua ... i guess default is 16 10:13 passant[m] i guess it was moved to line 45 some days ago - line 2429 in my case 10:13 passant[m] i changed it to 64 which gave the general mob spawn a quite good balance 13:26 Derr If I were a smarter man I'd turn land rush land claims into battle rush arena claims 15:50 rdococ ... 16:07 diemartin greetings 16:09 Krock red-001, srsly 16:09 Krock hi kaeza 16:09 red-001 hi Krock 16:09 Krock hi red-001 16:12 diemartin o/ Krock 16:16 Krock \o/ 16:16 Jordach \o/ 16:37 diemartin \o/? 16:39 agaran Hi diemartin 16:43 diemartin o/ agaran 19:35 luizrpgluiz Hi :) 19:35 Krock hi 19:36 luizrpgluiz Some Brazilian here besides me? 19:54 diemartin uruguayan at chui counts? :p 19:56 diemartin he's gone i guess 20:21 nasuga diemartin: he returned 20:51 Fixer !seen grambuduts 20:51 MinetestBot Fixer: Sorry, I haven't seen grambuduts around. 22:05 Fixer !seen deaco 22:05 MinetestBot Fixer: Sorry, I haven't seen deaco around. 22:10 TheInformer Could i use the code from this mod https://forum.minetest.net/viewtopic.php?f=9&t=10086 as long as i left a link to the source? 22:11 TheInformer And gave credit to the creator ofc 22:13 sfan5 as you can see in the post it's "Code: LGPL" 22:13 sfan5 so you need to follow the license terms of the LGPL 22:14 TheInformer Ok 22:15 TheInformer So I just have to link the source code? 22:17 rubenwardy you also have to license your code under LGPL 22:21 nasuga TheInformer: This might help, [ What are the GPL and LGPL and how do they differ? ] https://www.youtube.com/watch?v=JlIrSMzF8T4 22:21 TheInformer Ok thanks