. . . Posted April 22, 2021 Share Posted April 22, 2021 (edited) I tried this but it seems the reason "success" doesn't ever even get triggered even upon catching a fish with the oceanfishingrod local function CatchFish(inst, data) if data.reason == "success" then data.fisher.components.sanity:DoDelta(10) end end inst:ListenForEvent("oceanfishing_stoppedfishing", CatchFish) anyone know what im doing wrong? Edited April 22, 2021 by --- -.- Link to comment https://forums.kleientertainment.com/forums/topic/129177-sovled-how-to-make-character-gain-sanity-upon-successfully-catching-a-fish/ Share on other sites More sharing options...
penguin0616 Posted April 22, 2021 Share Posted April 22, 2021 (edited) It seems like "oceanfishing_stoppedfishing" is used for cases where the fisher fails to catch a fish. I'd recommend taking a look at components/oceanfishingrod.lua at the CatchFish method. Seems like it calls a function to indicate success when a fish is caught, so you might want to try overriding that function on your fishing rod. Here's a rough example. local oldfn = inst.components.oceanfishingrod.ondonefishing inst.components.oceanfishingrod.ondonefishing = function(inst, msg, lost_tackle, fisher, fish, ...) print("Caught a fish!") if oldfn then return oldfn(inst, msg, lost_tackle, fisher, fish, ...) end end Edited April 22, 2021 by penguin0616 Added example. 1 Link to comment https://forums.kleientertainment.com/forums/topic/129177-sovled-how-to-make-character-gain-sanity-upon-successfully-catching-a-fish/#findComment-1451420 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