Zuffie Posted April 29, 2017 Share Posted April 29, 2017 (edited) Hello again! I almost did everything with my 1st modded oc character , but my character has special stats that works on night time or on caves, the question is , how can I add special stats (I need to know how to slow hunger and sanity rate + speed and nightvision like Woodie's morph) based on Time ? Last thing , I use Extended character Template for modding , I'm not sure if I can make a custom craft to make an object, or modded start items P.S Yup I'm a newbie about creating mods I'm sorry. P.S.S Sorry for bad english too. Edited April 29, 2017 by Zuffie Link to comment Share on other sites More sharing options...
MorickClive Posted April 29, 2017 Share Posted April 29, 2017 (edited) This will influence sanity rating in theory(not tested): inst.components.sanity.rate_modifier = 1 Found it by searching for sanity in scripts folder for DST (common\Don't Starve Together\data\scripts), nearly anything after "component" will have it's own file where it refers to itself as the following code: Spoiler "ID" = class(function(self, inst)) { self.rate = val -- (self would imply "ID" or ID.rate, which can be applied in component) } All structures and items are considered prefabs(as far as I'm aware), that'd be your best bet to find code functionality. not all objects have in-game names as file labels, the wiki contains debug spawns for any item you're having trouble finding which are usually the lua file name. Luckily it appears beaver vision doesn't seem embedded any further than Woodie's lua file "woodie.lua". Though I cannot say if this will work, player vision might be a component that exists naturally or be implemented as part of "beaverness". If it's not you can always test it by attempting to initialise it yourself (see code comment). Spoiler local function SetBeaverVision(inst, enable) if enable then inst.components.playervision:ForceNightVision(true) inst.components.playervision:SetCustomCCTable(BEAVERVISION_COLOURCUBES) else inst.components.playervision:ForceNightVision(false) inst.components.playervision:SetCustomCCTable(nil) end -- comment: inst:AddComponent("playervision") Creating new prefabs/structures needs Spriter, you need to create an entity with the same name as the object and then give it animations to draw from. This post proved very handy for me, it enabled me to see results and create working animations/objects in Spriter, kudos to Malacath. If all else fails, maybe the mod guides on the central post can help you or a google search for people stuck in similar positions. As far as lua goes, it doesn't hurt to learn; but you can get a feel for the logic, especially if you're use to programming with classes. Edited April 29, 2017 by MorickClive 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