imjustglue Posted November 18, 2022 Share Posted November 18, 2022 trying to make a small little walter rework and i want to make so you gain a bit of sanity when petting woby, but i have no idea what var or isnt declares you can pet woby Link to comment Share on other sites More sharing options...
Mikrell Posted November 21, 2022 Share Posted November 21, 2022 (edited) On 11/19/2022 at 5:57 AM, imjustglue said: trying to make a small little walter rework and i want to make so you gain a bit of sanity when petting woby, but i have no idea what var or isnt declares you can pet woby I actually just did a character mod with a pet that does this! function WobyChanges(inst) local function onpet(inst) if inst.components.follower ~= nil and inst.components.follower.leader ~= nil then local leader = inst.components.follower.leader if leader.components.sanity ~= nil then leader.components.sanity:DoDelta(amount) end end end inst:ListenForEvent("critter_onpet", onpet) end ^ This should handle the onpet function. I believe Woby also counts as a critter so the "critter_onpet" event handler found in SGcrittercommons should fire as well AddPrefabPostInit("wobysmall", WobyChanges) Edited November 21, 2022 by Mikrell Link to comment Share on other sites More sharing options...
imjustglue Posted November 21, 2022 Author Share Posted November 21, 2022 16 hours ago, Mikrell said: I actually just did a character mod with a pet that does this! function WobyChanges(inst) local function onpet(inst) if inst.components.follower ~= nil and inst.components.follower.leader ~= nil then local leader = inst.components.follower.leader if leader.components.sanity ~= nil then leader.components.sanity:DoDelta(amount) end end end inst:ListenForEvent("critter_onpet", onpet) end ^ This should handle the onpet function. I believe Woby also counts as a critter so the "critter_onpet" event handler found in SGcrittercommons should fire as well AddPrefabPostInit("wobysmall", WobyChanges) any specific place i should put this on? like master position or do i just put it anywhere Link to comment Share on other sites More sharing options...
Mikrell Posted November 21, 2022 Share Posted November 21, 2022 5 hours ago, imjustglue said: any specific place i should put this on? like master position or do i just put it anywhere Add both somewhere in your mod main and that's pretty much it. Link to comment Share on other sites More sharing options...
imjustglue Posted November 22, 2022 Author Share Posted November 22, 2022 18 hours ago, Mikrell said: Add both somewhere in your mod main and that's pretty much it. Aight, thanks mate 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