Jump to content

Modded Weapon Support - Sanity to 0 and Back Again


Recommended Posts

Hey! So this one is simple, and I'm not sure where to start as I've never told the game to change sanity levels immediately before other than eating foods. It may be more complicated than I ask, but I want a certain weapon to, onequip, set the player's Sanity level to a permanent, unfixable 0. The only way to raise the sanity back to the value it was before would be to unequip it, thus being under onunequip. Is there a way to tell the onequip code to save the sanity value under something like "player_sanity_old" and set their sanity to 0, then when the player unequips it, tell it to load "player_sanity_old" and change it back to that? I assume it's not super easy but I want the weapon to do more than induce sanity, be it that it's a weapon of sadism. For those curious, it's the

Spoiler

Worn Dagger from Undertale, the one that a true pacifist would never use.

Also keep in mind that I only want the person equipping it to feel these effects, and if easily added, I want a large sanity drain around the character holding it. Alright, forums, let's see what ya got!

Link to comment
Share on other sites

Just now, NyctoDarkMatter said:

It may be more complicated than I ask, but I want a certain weapon to, onequip, set the player's Sanity level to a permanent, unfixable 0.

Take a look at the nightmare amulet (purpleamulet) code and it should have the basic code you need to accomplish this feature.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...