ABM question.

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

ABM question.

by Gatharoth » Thu Jan 05, 2012 22:28

Alright, so I'm working on a mod/extension for a mod. Now if I register a ABM, will that apply to all future blocks of the same node?

(example)

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_abm({
    nodenames = {"somemod:somenode"},
    interval = 1,
    chance = 1,
    action = function(pos, node, active_object_count, active_object_count_wider)
                    minetest.env:remove_node(pos)
})


Will this abm be applied to future nodes of the "somenode"? Or does it affect only nodes currently placed?
 

kahrl
Member
 
Posts: 236
Joined: Fri Sep 02, 2011 07:51

by kahrl » Thu Jan 05, 2012 23:53

It will affect all nodes of that type. It is irrelevant when they were placed or generated.
 

Gatharoth
Member
 
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Fri Jan 06, 2012 03:36

Damns. Well, that ruins some plans for code. Mmm... I guess I could do a work-around using time-of-day, but that could screw things up. Hmmm.... oh wells, thanks :)
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 10 guests

cron