Duckies Posted November 9, 2015 Share Posted November 9, 2015 I'm pretty new to Lua in general so I scavenged the forums only to find one thread where I got the following code. I like structures having a smaller min_spacing, but deployables don't seem to be listening. Berrybushes, mainly. I have not been able to see if the second part of the code is working or not, but either way it's not doing bushes.for _,v in pairs(GLOBAL.AllRecipes) do v.min_spacing = 1endAddComponentPostInit("deployable", function(comp) if not comp.inst:HasTag("structure") then comp.min_spacing = comp.min_spacing or 1 comp.min_spacing = math.min(comp.min_spacing, 1) endend)Any help would be much appreciated. Link to comment https://forums.kleientertainment.com/forums/topic/58919-reducing-min-spacing/ Share on other sites More sharing options...
Mobbstar Posted November 9, 2015 Share Posted November 9, 2015 This may be of your interest: if data.mediumspacing then inst.components.deployable:SetDeploySpacing(DEPLOYSPACING.MEDIUM) end [...] { name = "berrybush", }, { name = "berrybush2", }, { name = "sapling", mediumspacing = true }, { name = "grass", mediumspacing = true }, { name = "marsh_bush", mediumspacing = true }, Link to comment https://forums.kleientertainment.com/forums/topic/58919-reducing-min-spacing/#findComment-685279 Share on other sites More sharing options...
Duckies Posted November 9, 2015 Author Share Posted November 9, 2015 Thank you for the reply, but I don't really know what to do from there. How do I modify that part of the function in plantables? Link to comment https://forums.kleientertainment.com/forums/topic/58919-reducing-min-spacing/#findComment-685314 Share on other sites More sharing options...
DarkXero Posted November 11, 2015 Share Posted November 11, 2015 (edited) AddPrefabPostInit("dug_berrybush", function(inst) if inst.components.deployable then inst.components.deployable:SetDeploySpacing(GLOBAL.DEPLOYSPACING.MEDIUM) end end) -- DEPLOYSPACING.MEDIUM is 1 on constants.lua, the number acts as id -- DEPLOYSPACING_RADIUS[DEPLOYSPACING.MEDIUM] is 1 on constants.lua, this number acts as the min_spacing on CanDeployAtPoint on components/map.lua -- Using SetDeploySpacing of deployable propagates the spacing change to inventoryitem which propagates to its replica, reaching the client Edited November 11, 2015 by DarkXero Link to comment https://forums.kleientertainment.com/forums/topic/58919-reducing-min-spacing/#findComment-685589 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now