Ramrodiger Posted August 18, 2015 Share Posted August 18, 2015 Hey all; I'm trying to mod chester in 3 ways. 1) I'm going to reskin him 2) I want to make his inventory inaccessible by everyone (including owner because of the next alteration) and 3) I want him to drop 2 meat ONLY when he dies. I'm trying to find the lua that has all of this information but cannot find it for the life of me. I downloaded the personal chester mod but cannot seem to locate files (other than the re-skin). Any advice would be greatly appreciated. Link to comment Share on other sites More sharing options...
DarkXero Posted August 18, 2015 Share Posted August 18, 2015 (edited) @Ramrodiger:It's all in chester.lua. I want to make his inventory inaccessible by everyone Remove the container component. I want him to drop 2 meat ONLY when he dies.local loot = { "meat", "meat" }inst:AddComponent("lootdropper")inst.components.lootdropper:SetLoot(loot) Edited August 18, 2015 by DarkXero Link to comment Share on other sites More sharing options...
rons0n Posted August 18, 2015 Share Posted August 18, 2015 @DarkXero, Sorry for off-topicness but I'm curious why loot dropper doesn't work for characters? I die so many times but my character simply doesn't drop them upon death. What should I do? Link to comment Share on other sites More sharing options...
DarkXero Posted August 18, 2015 Share Posted August 18, 2015 @rons0n, because of stategraph differences. Monsters usually use the death commonstate for their stategraphs (stategraphs/commonstates.lua).Players have a different death state. In only one of them this is calledinst.components.lootdropper:DropLoot(inst:GetPosition())What I do is:1) Make a lootbag prefab.local function fn() local inst = CreateEntity() inst.entity:AddTransform() -- Non-networked entity inst:AddComponent("lootdropper") return instendreturn Prefab("lootbag", fn)2) Have a listener on playersinst:ListenForEvent("death", OnDeath)3) Generate a lootbag, customize it, drop the loot, and remove it.local function OnDeath(inst) local lootbag = SpawnPrefab("lootbag") local loot = { "meat", "meat" } lootbag.components.lootdropper:SetLoot(loot) lootbag.components.lootdropper:DropLoot(inst:GetPosition()) lootbag:Remove()end Link to comment Share on other sites More sharing options...
rons0n Posted August 18, 2015 Share Posted August 18, 2015 @DarkXero, Thanks, I'll take a whirl at this. Information has been very helpful! I'll prolly PM if i ever hit a problem as to not interfere with OPs original topic. Goodluck OP! Link to comment Share on other sites More sharing options...
Ramrodiger Posted August 19, 2015 Author Share Posted August 19, 2015 Not sure how I missed it but thanks! Would I add the loot script to chester.lua or SGchester.lua? Link to comment Share on other sites More sharing options...
DarkXero Posted August 19, 2015 Share Posted August 19, 2015 (edited) chester.lua or SGchester.lua? To your copy of chester.lua. SGchester.lua relates the animations of chester, with its actions and events that happen to him.If Wilson opens Chester, the stategraph handles it to display Chester with mouth open, panting. Edited August 19, 2015 by DarkXero Link to comment Share on other sites More sharing options...
Ramrodiger Posted August 19, 2015 Author Share Posted August 19, 2015 Hey again; So I spent a couple hours trying to tinker with it and get it to work and I even went to your "Moar Loot" post and tried to take elements from your Lootbag.zip file there and use them to no avail. I just can't seem to get chester to spawn 2 meat when he dies. Further, when I try to remove the container elements I get this error here: http://i.imgur.com/bBHLsFO.png I attached what I have for the chester.lua in hopes that you might once again help a frustrated noob out. personal_chester.lua Link to comment Share on other sites More sharing options...
DarkXero Posted August 19, 2015 Share Posted August 19, 2015 @Ramrodiger:The stategraph has some container interactions, so I commented them out in a new stategraph.scripts.zip Link to comment Share on other sites More sharing options...
Ramrodiger Posted August 24, 2015 Author Share Posted August 24, 2015 (edited) @DarkXero Do you know how to make it so the chester bone spawns for just the custom character? Edited August 24, 2015 by Ramrodiger Link to comment Share on other sites More sharing options...
DarkXero Posted August 24, 2015 Share Posted August 24, 2015 @Ramrodiger, put a "personal_chester_eyebone" on the start_inv of your character.That way your character spawns with the eyebone for himself? Link to comment 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