headofmarimo Posted January 2, 2021 Share Posted January 2, 2021 (edited) I used this topic to give my character the ability to pick up rabbits, but I also want to give him a sanity penalty for MURDERING them, including any other animal not including bugs. I already have a sanity penalty for killing them but I'm not sure how to do it for murdering? I can't seem to find an Event for murder either : ( Edited January 2, 2021 by headofmarimo Link to comment https://forums.kleientertainment.com/forums/topic/125657-lose-sanity-when-murdering-a-rabbitbird/ Share on other sites More sharing options...
Thomas_klei Posted January 3, 2021 Share Posted January 3, 2021 act.doer:PushEvent("murdered", { victim = murdered, stackmult = stacksize }) act.doer:PushEvent("killed", { victim = murdered, stackmult = stacksize }) to use victim and stackmult use data.victim Link to comment https://forums.kleientertainment.com/forums/topic/125657-lose-sanity-when-murdering-a-rabbitbird/#findComment-1412794 Share on other sites More sharing options...
headofmarimo Posted January 3, 2021 Author Share Posted January 3, 2021 (edited) 5 hours ago, thomas4846 said: act.doer:PushEvent("murdered", { victim = murdered, stackmult = stacksize }) act.doer:PushEvent("killed", { victim = murdered, stackmult = stacksize }) to use victim and stackmult use data.victim okay, thanks! What is the stackmult and stacksize variable though? would I do data.victim and data.victim.stackmult? Also would I put my sanity penalty under ListenforEvent then and put this in my character.lua? Edited January 3, 2021 by headofmarimo Link to comment https://forums.kleientertainment.com/forums/topic/125657-lose-sanity-when-murdering-a-rabbitbird/#findComment-1412851 Share on other sites More sharing options...
Thomas_klei Posted January 3, 2021 Share Posted January 3, 2021 local stacksize = murdered.components.stackable ~= nil and murdered.components.stackable:StackSize() or 1 stacksize is the how many there are in the stack if there is one stackmult is just the name of it when you use it if data.stackmult then delta = delta * data.stackmult --do delta but stacked end I think you would use it like this so if you kill more than 1 it will add the additional amount instead of just the one or run a loop with the amount of murdered ones Link to comment https://forums.kleientertainment.com/forums/topic/125657-lose-sanity-when-murdering-a-rabbitbird/#findComment-1412899 Share on other sites More sharing options...
headofmarimo Posted January 13, 2021 Author Share Posted January 13, 2021 thank you!! Works like a charm :) Link to comment https://forums.kleientertainment.com/forums/topic/125657-lose-sanity-when-murdering-a-rabbitbird/#findComment-1416280 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