Jump to content

modding noob that needs help with creating a badge


Recommended Posts

Hello! :)
English is not my first language so forgive me if I make any mistakes.

I am currently making a character mod and I’d like to add a custom badge(?) to her. I have the idea and the art part is fine but coding definitely isn’t something I’m very good at. Anyway, I still want to believe it’s possible despite my coding experience so this is where I ask for help. Here is what I want to do: I want to give her a stat that starts out at 150 and slowly drains overtime. If it reaches 0 then her health will start to drain as well. I want to split the badge into 3 stages somehow? so when it’s at max (150-100) her other stats (sanity,health and hunger) drain a bit slower and her walking speed is a bit faster, middle (99-50) makes her neutral so there is nothing special about it and at the lowest (49-1) her walking speed becomes slower. Of course I want to display those 3 stages with 3 different pieces of art for the badge just like the other stats do in the game (health going from the big heart to the little one) if that makes sense? Thing is, I also want to connect it with a structure she can make. For example the sisturn which is exclusive to wendy has an area in which you get sanity from, but I want the structure of hers to fill up the custom stat instead. And of course this structure can only help her and her alone, as she’s the only one with the stat in the first place. I want to somehow add fuel to it too like the petals used in the sisturn but I am very lost on how I’d go on making this. 

I would appreciate it a whole lot if anyone has some time to help me and maybe explain what’s possible and what isn’t :) I have been trying to look through scripts of other mods with badges.. as well as scripts like wigfrids inspiration bar.. but I’ve still ended up confused with many questions! I’d love to hear from someone directly. 

Link to comment
Share on other sites

Widgets (and by extension Badges) are on the more complicated side of things because they take data on the client side rather than the server side, meaning you need to mess with net_vars for transferring that data from server to client in order to give the widget something to update from.

I've never messed with structures directly so I'm not much help on setting the prefabs and placers for those up but you'd just be giving it an aura that only effects your character. For everything else it should be feasible to get working, I'm not 100% sure on slowing sanity and health draining outright (health especially, as that doesn't technically "drain") but hunger has its own function for setting the drain rate so that's incredibly simple.

There are a bunch of posts on the forum with stuff about widgets and badge widgets but I think this post reply does a good job of setting one up in a more easily understandable way that shouldn't be hard to build off, and this tutorial post has good information on sending data between server and client. For the stat you can do what the first post did and set it up to your character directly or what the second does and make a component with a replica. I personally prefer the replica component (even though it takes more to setup) as its easier to work with if you want to add more on later. (For the animations and images, I don't personally have much experience setting them up for widgets so I don't exactly know how to get those to appear properly with them once you've got them ready)

You'll want to get the actual stat variables and how it gets updated setup before starting on the widget in my opinion. It'll be easier and you'll actually have the data the widget wants once it is setup. I can explain more in-depth or help work through setting stuff up if needed, though others on the forum might have better ways to go about doing so then I do.

  • Thanks 1
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...