Tenshin Posted May 28, 2014 Share Posted May 28, 2014 Hey, I've been trying to change the loot given by burnt items from ash to something else, but I can't figure it out. Does anyone know how to do this? e.g. Burnt "boards" should give "charcoal" instead of "ash" Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/ Share on other sites More sharing options...
DeathDisciple Posted May 28, 2014 Share Posted May 28, 2014 You will likely want to override lootdropper component, more precisely, LootDropper:DropLoot() Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/#findComment-490415 Share on other sites More sharing options...
simplex Posted May 28, 2014 Share Posted May 28, 2014 You will likely want to override lootdropper component, more precisely, LootDropper:DropLoot()It's actually the burnt callback that controls this.@standardcomponents.lua:function DefaultBurntFn(inst) local ash = SpawnPrefab("ash") ash.Transform:SetPosition(inst.Transform:GetWorldPosition()) if inst.components.stackable then ash.components.stackable.stacksize = inst.components.stackable.stacksize end inst:Remove()endSo, OP, what you'd want to do is implement custom versions of a function like the above, and then doinst.components.burnable:SetOnBurntFn(my_very_own_burnt_fn) Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/#findComment-490428 Share on other sites More sharing options...
DeathDisciple Posted May 28, 2014 Share Posted May 28, 2014 I thought about the 'death on fire' loot getting turned to ash thing, not the actual burning of objects - you're right, I read the op wrong. Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/#findComment-490441 Share on other sites More sharing options...
Tenshin Posted May 29, 2014 Author Share Posted May 29, 2014 Thanks for the quick replies.I also wasted alot of time with lootdropper.lua but it seems the answer is in "standardcomponents.lua". I've been able to change "ash" with "charcoal", but if I copy the file to "mods\modname\scripts\standardcomponents.lua" it doesn't do anything.I also tried to implement the function in modmain.lua but I get a crash the following crash: modmain.lua:79: attempt to call global 'SpawnPrefab' (a nil value) local function BoardsBurntFn(inst) local cc = SpawnPrefab("charcoal") cc.Transform:SetPosition(inst.Transform:GetWorldPosition()) if inst.components.stackable then cc.components.stackable.stacksize = inst.components.stackable.stacksize end inst:Remove()endlocal function MakeBoardsBurnable(inst) inst.components.burnable:SetOnBurntFn(BoardsBurntFn)endAddPrefabPostInit("boards", MakeBoardsBurnable)Don't know what else to try. Any ideas? An easy workaround would be to just make crafting recipe but I wanted to figure this out... Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/#findComment-490665 Share on other sites More sharing options...
Mutation142 Posted May 29, 2014 Share Posted May 29, 2014 Try using the global call like so, local cc = GLOBAL.SpawnPrefab("charcoal") Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/#findComment-490809 Share on other sites More sharing options...
Tenshin Posted May 29, 2014 Author Share Posted May 29, 2014 @Mutation142: Thank you! That was it! It's working now. Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/#findComment-490961 Share on other sites More sharing options...
Mutation142 Posted May 29, 2014 Share Posted May 29, 2014 Your welcome, Tenshin. Glad I could actually help you on that one, since I'm new to modding DS and have much...much more learn. Link to comment https://forums.kleientertainment.com/forums/topic/36945-how-to-change-loot-from-burned-objects/#findComment-490978 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