Faintly Macabre Posted May 30, 2016 Share Posted May 30, 2016 I'd like to make a few items automatically stack the way hounds teeth, monster meat, and some others do. I know I need to add the "selfstacker" component to the items to do so, but I'm wondering if (and hoping) it's possible to add that component to them without having to replace the entire prefab file? Link to comment https://forums.kleientertainment.com/forums/topic/67768-alter-item-without-replacing-prefab/ Share on other sites More sharing options...
Aquaterion Posted May 30, 2016 Share Posted May 30, 2016 5 minutes ago, TheHalcyonOne said: I'd like to make a few items automatically stack the way hounds teeth, monster meat, and some others do. I know I need to add the "selfstacker" component to the items to do so, but I'm wondering if (and hoping) it's possible to add that component to them without having to replace the entire prefab file? --modmain.lua AddPrefabPostInit("cutgrass", function(inst) if not GLOBAL.TheWorld.ismastersim then--needed for components to not crash clients I believe return inst end inst:AddComponent("healer") end) ^ just an example Link to comment https://forums.kleientertainment.com/forums/topic/67768-alter-item-without-replacing-prefab/#findComment-778188 Share on other sites More sharing options...
Faintly Macabre Posted May 30, 2016 Author Share Posted May 30, 2016 3 minutes ago, Aquaterion said: --modmain.lua AddPrefabPostInit("cutgrass", function(inst) if not GLOBAL.TheWorld.ismastersim then--needed for components to not crash clients I believe return inst end inst:AddComponent("healer") end) ^ just an example Awesome, thanks. Though, wouldn't a change like this make for a server-only mod? Is that check still necessary? Link to comment https://forums.kleientertainment.com/forums/topic/67768-alter-item-without-replacing-prefab/#findComment-778189 Share on other sites More sharing options...
rezecib Posted May 30, 2016 Share Posted May 30, 2016 4 hours ago, TheHalcyonOne said: Awesome, thanks. Though, wouldn't a change like this make for a server-only mod? Is that check still necessary? If it's server-only, yes. But if this were to be included in an all-clients mod, you would need it. Link to comment https://forums.kleientertainment.com/forums/topic/67768-alter-item-without-replacing-prefab/#findComment-778271 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