Perhapsfruitcake Posted August 1, 2015 Share Posted August 1, 2015 Hello everybody,This is my first forum post here on this site, and to coincide, this post is about my first ever DS + RoG mod.And for this character mod,I have some perks I would like for this character to have. However, this is my first experience with any kind of coding (let alone with lua) so it goes without saying that I am not skilled with coding. And this is where I need help.For the first perk, I would for like this character to gain sanity when around friendly/hostile creatures (such as, but not limited to, Chester, Glommer, beefalo, bunnymen, etc)But I would also like for this character to lose more sanity than Wilson's base sanity loss when around hostile creatures (such as, but not limited to, bees, spiders, Maxwell's chess monsters, merms, etc.). I would also like for items with a negative aura (like those dark flowers and graveyards) to remain at their base sanity loss.If these actions are even possible, help and examples would be highly appreciated by the coding newbie I am, haha.For the second perk, I would like for this character to get cold slower than Wilson's base during winter(since their character model has a black hoodie on), so it will take longer for them to reach the brink of freezing over with hypothermia in winter. And opposing this, I would like for this character to get heated up faster than Wilson's base heat gain in the summer (since their character model has a black hoodie on), so they will reach the point of over heating with hyperthermia quicker.Again, if it is even possible for things like this to be done, help and examples would be highly appreciated.And for one last thing, in what file would the coding to make these perks possible, go? And their location in the file itself does not matter right? As long as it is in the file, it will work?Thank you all for taking your time to read this, and I look forward to chatting with you all soon. Have a great day or night! Link to comment https://forums.kleientertainment.com/forums/topic/56677-assistance-needed-with-coding-a-custom-character-mod/ Share on other sites More sharing options...
Mobbstar Posted August 1, 2015 Share Posted August 1, 2015 The sanity things are ideally in modmain.lua using AddPrefabPostInit. I'm sure there's plenty of character mods that show you the way it's done. The freezing thing should be doable in the character file using the temperature component. Read here for basic informations. Link to comment https://forums.kleientertainment.com/forums/topic/56677-assistance-needed-with-coding-a-custom-character-mod/#findComment-659123 Share on other sites More sharing options...
Perhapsfruitcake Posted August 3, 2015 Author Share Posted August 3, 2015 The sanity things are ideally in modmain.lua using AddPrefabPostInit. I'm sure there's plenty of character mods that show you the way it's done. The freezing thing should be doable in the character file using the temperature component. Read here for basic informations. Thank you Mobbstar for pointers on what to do! And knowing me, I may come back with more questions, apologies, haha.But before anything, may I ask you if this looks correct concerning the slower freezing rate and faster overheating rate?if inst.components.temperature theninst.components.temperature.inherentsummerinsulation = -60inst.components.temperature.inherentinsulation = 70endStill looking into the sanity loss+gain from creatures. Thank you again for your help! Link to comment https://forums.kleientertainment.com/forums/topic/56677-assistance-needed-with-coding-a-custom-character-mod/#findComment-659716 Share on other sites More sharing options...
Mobbstar Posted August 3, 2015 Share Posted August 3, 2015 Thank you Mobbstar for pointers on what to do! And knowing me, I may come back with more questions, apologies, haha.But before anything, may I ask you if this looks correct concerning the slower freezing rate and faster overheating rate?if inst.components.temperature theninst.components.temperature.inherentsummerinsulation = -60inst.components.temperature.inherentinsulation = 70endStill looking into the sanity loss+gain from creatures. Thank you again for your help! I don't know. If you don't get a comparable difference through playtesting, try an extreme number. Link to comment https://forums.kleientertainment.com/forums/topic/56677-assistance-needed-with-coding-a-custom-character-mod/#findComment-659729 Share on other sites More sharing options...
Perhapsfruitcake Posted August 3, 2015 Author Share Posted August 3, 2015 I don't know. If you don't get a comparable difference through playtesting, try an extreme number. Hello again, Mobbstar.I have playtested my character several times, I compared them to Wilson in the summer and winter, and I have changed the numbers on each occasion.local fn = function(inst)if inst.components.temperature theninst.components.temperature.inherentsummerinsulation = xinst.components.temperature.inherentinsulation = y endendThis is how it looks in my modmain.lua.For the x, I tested -60, -600, and -6,000. (It's negative due to them overheating faster.)For the y, I tested 70, 700, and 7,000.And regardless of the number there, it takes my character the same amount of time to freeze and overheat to death as it does Wilson's base status. Any ideas on why this isn't working? Thank you for all your help so far Link to comment https://forums.kleientertainment.com/forums/topic/56677-assistance-needed-with-coding-a-custom-character-mod/#findComment-659848 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