Joeyloveswaffles Posted July 18, 2014 Share Posted July 18, 2014 Hello guys, thank you for clicking on this. I have been experiencing great difficulty trying to create a don't starve character, but I finally managed to do it. It's nowhere near complete and I need some help because i have absolutely no idea where to look to add different health, hunger and sanity amounts. In the game. Also a feature i'm adding to the mod is the character also loses sanity quicker than normal so if you guys could help with that, that would would be appreciated. Thank you, - Joey. Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/ Share on other sites More sharing options...
Dictator Posted July 18, 2014 Share Posted July 18, 2014 (edited) In the prefab of your character (Change X, Y and Z to the numbers you want. inst.components.health.maxhealth = X inst.components.hunger.maxhunger = Y inst.components.sanity.max = Z inst.components.sanity.current = Z For the sanity I'm not so sure but here it is: inst.components.sanity.night_drain_mult = 1 (Sanity drain from night multiplier) inst.components.sanity.neg_aura_mult = 1 (Negative aura multiplier) Edited July 18, 2014 by Dictator Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512569 Share on other sites More sharing options...
Joeyloveswaffles Posted July 19, 2014 Author Share Posted July 19, 2014 (edited) In the prefab of your character (Change X, Y and Z to the numbers you want. inst.components.health.maxhealth = X inst.components.hunger.maxhunger = Y inst.components.sanity.max = Z inst.components.sanity.current = Z For the sanity I'm not so sure but here it is: inst.components.sanity.night_drain_mult = 1 (Sanity drain from night multiplier) inst.components.sanity.neg_aura_mult = 1 (Negative aura multiplier) Thank you for the advise, but i was wondering, should it be under the functions part of the folder, or should it just be at the end of it. (basically im asking is there a specific spot it should be located). I tried what you said but the stats remained exactly the same when i restarted it and started a new world and put it in the functions section. Edited July 19, 2014 by Joeyloveswaffles Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512585 Share on other sites More sharing options...
Dictator Posted July 19, 2014 Share Posted July 19, 2014 prefabs -> character.lua (The lua file of your character)Here is the quote of my .lua (From the section to the final line of the archive) local fn = function(inst) -- choose which sounds this character will play inst.soundsname = "wilson" -- a minimap icon must be specified inst.MiniMapEntity:SetIcon( "wilson.png" ) inst.components.health.maxhealth = 75 inst.components.hunger.maxhunger = 125 inst.components.sanity.max = 250 inst.components.sanity.current = 250 inst.components.sanity.night_drain_mult = 2 inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.2) inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.3) inst.components.hunger:SetMax(TUNING.WILSON_HUNGER * 1.0) inst.components.combat.damagemultiplier = 1.0 endreturn MakePlayerCharacter("wayne", prefabs, assets, fn) Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512586 Share on other sites More sharing options...
Joeyloveswaffles Posted July 19, 2014 Author Share Posted July 19, 2014 prefabs -> character.lua (The lua file of your character)Here is the quote of my .lua (From the section to the final line of the archive) I pretty much copy pasted exactly that (all i did was change the hunger, sanity and stuff to what i wish them to be and set the multiplier to 1.0 for the moment) but it literally changed nothing. I still have the default 150 hunger, 150 health, and 200 sanity in game. For some reason it will not change even after i went into the bronx.lua (thats the character name) and got rid of what was there for the final lines of the script and replaced them with yours. Is there any reason this may be happening and that i might be missing a small detail of some sort? Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512589 Share on other sites More sharing options...
Dictator Posted July 19, 2014 Share Posted July 19, 2014 I pretty much copy pasted exactly that (all i did was change the hunger, sanity and stuff to what i wish them to be and set the multiplier to 1.0 for the moment) but it literally changed nothing. I still have the default 150 hunger, 150 health, and 200 sanity in game. For some reason it will not change even after i went into the bronx.lua (thats the character name) and got rid of what was there for the final lines of the script and replaced them with yours. Is there any reason this may be happening and that i might be missing a small detail of some sort? Did you changed the "wayne" to the name of your character? Remember, in the past everything needs to be written exactly how it is. Just use lowercase names and will be alright. Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512592 Share on other sites More sharing options...
Joeyloveswaffles Posted July 19, 2014 Author Share Posted July 19, 2014 Did you changed the "wayne" to the name of your character? Remember, in the past everything needs to be written exactly how it is. Just use lowercase names and will be alright. I left it as is, and even if i had, wouldn't it have caused the whole mod to crash? Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512595 Share on other sites More sharing options...
Dictator Posted July 19, 2014 Share Posted July 19, 2014 I left it as is, and even if i had, wouldn't it have caused the whole mod to crash? No, you have to change the wayne to the name that you are using to script your character. Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512596 Share on other sites More sharing options...
Joeyloveswaffles Posted July 19, 2014 Author Share Posted July 19, 2014 No, you have to change the wayne to the name that you are using to script your character.When i meant i left it as is, (sorry this was improper wording) i meant it says "bronx" instead of "wayne", should have been more clear on that. Sorry. Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512598 Share on other sites More sharing options...
Joeyloveswaffles Posted July 19, 2014 Author Share Posted July 19, 2014 (edited) No, you have to change the wayne to the name that you are using to script your character.I fixed the problem, thank you for your assistance. I misplaced the mod in the wrong folder. Thank you for the assistance and it has been a great help, now it has the correct amounts of health, hunger and sanity that i want Edited July 19, 2014 by Joeyloveswaffles Link to comment https://forums.kleientertainment.com/forums/topic/38704-just-need-some-help-with-editing-hunger-health-and-sanity/#findComment-512613 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