Jump to content

[Help] Abilities based on Naughtiness-level


Recommended Posts

Hey there!

I would like to add my character some abilities when she reaches certain Naughtiness-levels. My quesion is: How can I reference to these values in codings? I've looked around in the Krampus lua file, but I didn't found anything about it.

Bonus question: Is this meter resets when a Krampus spawns, or is it grows to infinity?

Thanks in advance!

Link to comment
Share on other sites

If you have both Combined Status Bar, and the Insight mod (Penguin actually coded it). It should show you your naughtiness value. So if you dig in to his (the Insight) code, you'll be able to see where he finds it.

Also, I'm pretty sure it resets to 0 when a Krampus is spawned.

I'm also pretty sure that he can spawn above a certain naughtiness value, but a chance. Then guaranteed when it hits the upper limit.

  • Wavey 1
Link to comment
Share on other sites

2 hours ago, Bigfootmech said:

I'm also pretty sure that he can spawn above a certain naughtiness value, but a chance. Then guaranteed when it hits the upper limit.

You just have to pass the threshold. Once you do, krampii spawn, your threshold changes and your naughtiness is reset to 0.
Additionally, your naughtiness resets when you leave/enter caves/surface, or leave/rejoin a game.

@BillTheCipher Naughtiness stuff is handled in components/kramped.lua
You have to use the debug library to get at the stored values though.

Basically, you want the "_activeplayers" upvalue from any member of kramped that references it (GetDebugString is probably your best bet, as it's the least likely to get overridden by another mod).

 

Edited by penguin0616
  • Like 2
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...