Jump to content

no deconstruction tag for structures with placer


Recommended Posts

Hello again.

I have another problem. I'm not sure if I understand script for adding recipes correctly. Maybe someone could explain for what is each "nil" responsible in order? I was trying add some recipes that cannot be affected by Deconstruction Staff. I have found this tag "{no_deconstruction = true}" in Walter's ammo recipes and it's working fine with crafting items but I cannot apply that to structures for some reason. Is there a conflict with placer possibly? When I put {no_deconstruction = true} tag right after level, then there's no "placing" option and character plants that structure where it stands during crafting. But when I try to put that tag in any other place then game crashes, structure is still affected by Green Staff or atlas images are missing.

I need someone to explain that script to me and if it's possible to add both placer and no_dec. tag to a structure recipe, to tell me how to do it.

Link to comment
Share on other sites

When you take a look at the function you call with addrecipe it hat the following param
function(self, name, ingredients, tab, level, placer_or_more_data, min_spacing, nounlock, numtogive, builder_tag, atlas, image, testfn, product, build_mode, build_distance).

 

the placer-or-more-data is resolved this way:
if type(placer_or_more_data) == "table" then
        placer = placer_or_more_data.placer
        more_data = placer_or_more_data
    else
        placer = placer_or_more_data
    end

 

so you need to add your placer options in the additional options too, like
{no_deconstruction = true, placer = XXX}

  • Thanks 1
Link to comment
Share on other sites

This is exactly what I wanted to know. Thanks a lot.

Other method I've found in mean time if someone is interested in this topic is creating an item that can works like placer similar to walls or spider egg sack. But since there's a simpler solution I'll definitely use it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...