Mayli-Song Posted January 6, 2017 Share Posted January 6, 2017 (edited) So I've decided to give modding a try for me and a few friends. I'll be using the Extended Sample Character Template and it looks like that covers a lot of it, but I'd still really love some pointers since this is my first time doing something like this. Even if you can point me to where I can find it in the existing code it would appreciated. *EDIT* It's just down to the custom items now, and I have a vague idea of where to start thankfully Character A- WX's trait of no negative effect for eating spoiled food - Lower max health- Immune to overheating- Immune to wetness effects Character B- Sanity regen / slightly weaker version of Maxwel's dapper effect- Won't eat meat -- I have a vague idea of how to do this one, help would still be appreciated - Immune to cold- A very weak positive sanity aura on nearby players Character C- Wickerbottom's knowledge trait- Lower Max Sanity - Custom item that slowly regenerates sanity when equipped. Craftable/useable by this character only Character D- Certain mobs are/become passive towards character: Pigs, hounds, frogs, tallbirds, mctusks, rabbits don't flee -- possibly the rabbit bit, it may be fun - Custom item that restores some sanity when crafted. Craftable by this character only- Hunger decreases slower, sanity decreases faster Edited January 7, 2017 by Mayli-Song Link to comment Share on other sites More sharing options...
Mayli-Song Posted January 7, 2017 Author Share Posted January 7, 2017 Um, bump I guess, I really need some help with the temperature, vegetarian, and passive mob codes, I'm having a lot of trouble. Link to comment Share on other sites More sharing options...
zUsername Posted January 7, 2017 Share Posted January 7, 2017 (edited) Immune to overheating inst.components.temperature.maxtemp = 25 Immune to wetness inst.components.moisture.maxmoisture = 0 Immune to cold inst.components.temperature.mintemp = 25 Vegetarian inst.components.eater:SetDiet({ FOODTYPE.VEGGIE, FOODTYPE.INSECT, FOODTYPE.SEEDS, FOODTYPE.GENERIC, FOODTYPE.GOODIES }) Passive mods ThePlayer:AddTag("houndfriend") -- hound ThePlayer:AddTag("merm") -- merm ---------------------------------------------------- ThePlayer:AddTag("guard") ThePlayer:AddTag("werepig") -- werepig and pig guard. ---------------------------------------------------- ThePlayer:AddTag("tallbird") -- tallbird ThePlayer:AddTag("walrus") --walrus ThePlayer:RemoveTag("scarytoprey") -- rabbit ---------------------------------------------------- ThePlayer:AddTag("frog") AddPrefabPostInit("frog", function (inst) --frog if not GLOBAL.TheWorld.ismastersim then return inst end local _targetfn = inst.components.combat.targetfn inst.components.combat.targetfn = function (target) if target:HasTag("frog") then return end _targetfn(target) end end) ---------------------------------------------------- Edited January 7, 2017 by zUsername Link to comment Share on other sites More sharing options...
Mayli-Song Posted January 7, 2017 Author Share Posted January 7, 2017 Spoiler 11 hours ago, zUsername said: Immune to overheating inst.components.temperature.maxtemp = 25 Immune to wetness inst.components.moisture.maxmoisture = 0 Immune to cold inst.components.temperature.mintemp = 25 Vegetarian inst.components.eater:SetDiet({ FOODTYPE.VEGGIE, FOODTYPE.INSECT, FOODTYPE.SEEDS, FOODTYPE.GENERIC, FOODTYPE.GOODIES }) Passive mods ThePlayer:AddTag("houndfriend") -- hound ThePlayer:AddTag("merm") -- merm ---------------------------------------------------- ThePlayer:AddTag("guard") ThePlayer:AddTag("werepig") -- werepig and pig guard. ---------------------------------------------------- ThePlayer:AddTag("tallbird") -- tallbird ThePlayer:AddTag("walrus") --walrus ThePlayer:RemoveTag("scarytoprey") -- rabbit ---------------------------------------------------- ThePlayer:AddTag("frog") AddPrefabPostInit("frog", function (inst) --frog if not GLOBAL.TheWorld.ismastersim then return inst end local _targetfn = inst.components.combat.targetfn inst.components.combat.targetfn = function (target) if target:HasTag("frog") then return end _targetfn(target) end end) ---------------------------------------------------- Thank you so much, this is perfect and way more concise than anything I was working out. 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