Time Nick Message 11:32 Nemin32 Hi! 11:33 Nemin32 Is there a command for running an abm once? 11:34 Nemin32 Like i have a block and i want it to put another block on top of it, but only once. 11:35 Nemin32 And if i punch that block out on top thats it. 11:41 Nemin32 I tried making a local var. that turns false when the first spawning happened, but it didnt worked. 11:47 Zefram_Fysh you need to implement your own concept of "once" 11:48 Zefram_Fysh there is no API mechanism to do it for you 12:26 Nemin32 Hmm 12:26 Nemin32 Well, this is sad 12:28 Nemin32 Then can you please comment on my code what is the problem with it: http://pastebin.com/TG6sHTFS ? 14:53 LazyJ Nemin32, I haven't read the pastebin but something that may work (and is much more complex) would be to have the node on top replace the node on bottom "on_punch" or "after_punch" with a node of a *different* name but same texture and definition as the original, bottom node. 14:54 LazyJ That way the ABM only works on the original bottom node but not the near identical node of a different name (i.e. bottom_node vs bottom_node_2). 15:40 Nemin32 Wow, i would never thought that thank you! 15:41 LazyJ yw, I hope it works. ;) 15:46 Nemin32 You know, my friend is a big fan of an anime, where the protagonist has a dimension named the unlimited blade works, where he has every type of swords and stuff, and i wanted to make him a block which spawns a 25*25 area of blocks that spawn "sword-blocks" on top. 15:48 LazyJ It would be a neat effect to pull-off. 15:48 LazyJ What you learn by doing it may help in the future with a similar problem. ;) 15:49 Nemin32 :) 15:52 Nemin32 Great, it works nearly as i wanted! 15:57 Nemin32 Oh, my! It look good. 15:57 Nemin32 My friend will be happy, i think. 16:37 Nemin32 And can i ask you one more thing? Is it possible to orientate my spawning blocks like if i place my block from standing north my square will spawn north etc. etc. 16:37 Nemin32 ? 16:43 Nemin32 WTF, i cant delete my block using minetest.remove_node! 16:45 LazyJ To remove the node, try minetest.set_node("air") 16:45 Nemin32 Yep, i tried that. 16:45 LazyJ The orientated deployment of blocks is something I haven't messed with yet. 16:45 Nemin32 Well then nevermind that 16:46 Nemin32 But the no-remove thing is a problem 16:46 LazyJ Is something putting the block back after it is removed? That is another possibility. 16:47 Nemin32 Hmm 16:47 LazyJ When I come to problems like that, I try to isolate just that block in it's own special "test" mod. 16:48 Nemin32 Well, this is a test mod too. 16:48 LazyJ Comment-out all the stuff that works and is not necessary and focus on just that one problem. 16:48 Nemin32 Just goofing around getting the basics. 16:49 LazyJ Sometimes the problems I've had were the right code in the wrong place or sequence of events. 16:50 LazyJ As for deploying nodes based on the player's orientation, I'd look into thefamilygrog66's "Living Room Furniture" mod, the long sofas. 16:51 LazyJ Another one would be mauvebic's "Ruler" mod. 16:51 Nemin32 Hmm, now its deleting, it seems the problem is in the square generating code 16:51 Nemin32 Ok thanks 16:51 LazyJ Possibly even Sokomine's "Villages" mod. 17:04 Nemin32 Hmm, after some experimenting the blocks vanishes for a moment, howewer it reappears right after 17:05 LazyJ Then something in the code is putting it back. 17:06 LazyJ Use WorldEdit's /i on to "tap" the node that returns. It will display in chat the modname:nodename of that node. That will give you an idea of what to look for. 17:07 LazyJ Especially if you are using doppelganger nodes. 17:07 Nemin32 Umm, i know its name 17:07 Nemin32 The worst that its actually never referenced after the destroy command. 17:08 LazyJ Something before the destroy command may be the issue. 17:08 LazyJ If you are using something to replace the node when the one above it is punched, that replacement code may still be working or the ABM may still be putting it there. 17:09 LazyJ Work your way backwards. 17:10 Nemin32 Hmm, well the spawner block is not affected by the replacement code 17:11 Nemin32 Would you please see my code? 17:13 LazyJ I can take a look, but no promises. I'm struggling with Lua and mods myself. ;) 17:13 LazyJ What's the current version's pastebin? 17:15 Nemin32 http://pastebin.com/pmrkmamx 17:15 Nemin32 This is the ABM of the spawner 17:17 LazyJ Just a guess but: 17:17 LazyJ minetest.remove_node(savedpos) 17:17 Nemin32 Its there 17:17 LazyJ looks like it's telling Minetest to remove a *position* but not *what* to remove. 17:17 Nemin32 Oh 17:18 LazyJ You are trying to do the opposite of: 17:18 LazyJ minetest.set_node(pos, {name = "ubw:dirt_active"}) 17:18 LazyJ Which specifies the position and the item. 17:18 Nemin32 Well, then how could i fix itm 17:18 Nemin32 ? 17:18 LazyJ So try doing that with the remove verion; specify the pos *and* the item. 17:20 Nemin32 so i put minetest.remove_node(savedpos, {name = "ubw:spawner}) but nothing 17:21 LazyJ Say the process out loud sometimes helps. "Minetest, 'remove_node' in this 'pos' if it's 'name' is '{name=ubw:spawner}'." 17:21 Nemin32 the documentation says i only need a position 17:22 LazyJ You have 'pos' identified as 'savedpos'. What describes 'savedpos'? 17:22 Nemin32 in function(pos) savedpos = pos 17:23 LazyJ You have it turned around. 17:23 Nemin32 why? 17:23 LazyJ It should be 'pos = savedpos'. 17:23 Nemin32 I am declaring savedpos, it should be the beginning position, so i can do my thing with pos. 17:24 Nemin32 but i will try 17:24 LazyJ function(pos, name, item_stack) etc... is already taken by the builtin mod. 17:25 LazyJ That's what allows you to do things like 'minetest.get_node(pos).name' 17:25 LazyJ 'pos' 17:25 LazyJ Ahk... 17:25 Nemin32 So i cant modify it 17:25 LazyJ 'pos' is already claimed by another function. 17:25 LazyJ idk. 17:25 Nemin32 *facepalm 17:25 LazyJ Give it a try and see what happens. 17:26 Nemin32 Soo if i put pos into another var, and i place the thing to the another var it will work? 17:27 LazyJ It may work but will it conflict with other functions calling for 'pos'? 17:28 LazyJ If you were to use 'local cobble = minetest.get_node(pos)', then 'minetest.register_node(default:cobble)' may have an issue. 17:28 Nemin32 I have another function who edits pos 17:29 LazyJ That example is just to illustrate. 17:29 LazyJ Other than that, I'm out of ideas. :( 17:30 Nemin32 if i write function(local pos)? 17:31 Nemin32 Or put it into another file and dofile()? 17:31 LazyJ I haven't written my own functions yet to understand them well enough. 17:32 LazyJ So I stick with what other's have written. 17:32 Nemin32 Ok, local does not work, i try the dofile() 17:32 LazyJ Looking at some of the older mods, *everything* was done in a single init.lua file. 17:33 LazyJ Crafts, registrations, ABMs... the whole ball of wax. 17:33 LazyJ So if they could do it all in one file, then you should be able to get yours to work in a single file too. 17:34 Nemin32 But it worth one try. 17:34 LazyJ Unless the rest of your mod is huge, in which case it's easier to keep your sanity if you break it into smaller files. 17:36 Nemin32 No its small (for now) 17:53 Nemin32 OK, so i have two variations: one) It works, howewer only for the first, then every other just dissapears two) like before modifiyng. 18:02 LazyJ Try allowing only 3 to spawn. If it is consistently evens or consistently odds that disappears, then the likely suspect is the position(s) used in the code. 18:03 LazyJ If it's consistently random, then look for other things that tell Minetest to either remove, replace, or expire something. 18:06 LazyJ "Simplify. Identify. Retry." 18:06 Nemin32 Is there a function to check if a node *removed* not *dug* 18:07 LazyJ I've never had an instance to look for one yet. 18:07 LazyJ By default, whenever something is "dug", Minetest records it in the logs. Key into that perhaps? 18:08 LazyJ If it's not dug, then assume it was removed. 18:09 Nemin32 Hmm, well i must go, a sleep may help :) Anyway thank you very much for your help! And bye! 18:09 LazyJ Good luck ;)