Ryguy9999 Posted January 12, 2015 Share Posted January 12, 2015 Hey guys, is it possible to mod in a new status bar, like health and hunger? For example, thirst. The bar looks like the other three, and sits with the others too, however the mod controls how the bar behaves. Link to comment https://forums.kleientertainment.com/forums/topic/48989-possible-to-add-a-new-stat-bar/ Share on other sites More sharing options...
DarkXero Posted January 12, 2015 Share Posted January 12, 2015 I modded wetness in so I'm gonna go with yes.AddClassPostConstruct("widgets/statusdisplays", function(self) local MoistureMeter = GLOBAL.require "widgets/moisturemeter" self.moisturemeter = self:AddChild(MoistureMeter(self.owner)) self.moisturemeter:SetPosition(0,-115,0)end) Link to comment https://forums.kleientertainment.com/forums/topic/48989-possible-to-add-a-new-stat-bar/#findComment-600723 Share on other sites More sharing options...
Ryguy9999 Posted January 12, 2015 Author Share Posted January 12, 2015 is this mod for DST and on the workshop? I'd love to download it and see more about it! Link to comment https://forums.kleientertainment.com/forums/topic/48989-possible-to-add-a-new-stat-bar/#findComment-600724 Share on other sites More sharing options...
DarkXero Posted January 12, 2015 Share Posted January 12, 2015 is this mod for DST and on the workshop? I'd love to download it and see more about it! It is not on the workshop. It is a bit of a mess because there are many wetness related things. But what I did was add the MoistureMeter as it is in RoG and added moisture as a component to players. MoistureMeter reacts on each computer using GetMoisture and GetDelta and getting rates from the player, so if the clients and the host had these values for themselves, no extra changes are needed. I wasn't sure of what I was doing by the time so it's probably not optimized. (For example, in the number round ups for moisture and delta values I did, and in the string netvars I used because I had no idea about netvars.)AddPlayerPostInit(function(player) player:AddComponent("moisture")end)And I attach the moisture component. It's the RoG one with host/client separations, like in Peter's The Hunt mode mod. And read netvars.lua to know what netvars to use.moisture.lua Link to comment https://forums.kleientertainment.com/forums/topic/48989-possible-to-add-a-new-stat-bar/#findComment-600734 Share on other sites More sharing options...
Nofew Posted January 12, 2015 Share Posted January 12, 2015 It's entirely possible, and from what I understand, does not require re-purposing the Moisture meter from RoG and possibly breaking all compatibility when that comes to DST. Go search the workshop for "Wunk the Punk". It's single-player only as far as I remember. To make a long story short, the authors added a "drug meter" that decreases over time, and causes a sanity drain when it gets below a certain threshold as a sort of anti-drug statement. (The mod's page explains this way better than I do. x.x...) Considering he's not available on DST, you'll still need DarkXero's code to make it work here. Link to comment https://forums.kleientertainment.com/forums/topic/48989-possible-to-add-a-new-stat-bar/#findComment-600811 Share on other sites More sharing options...
DarkXero Posted January 12, 2015 Share Posted January 12, 2015 No repurposing needed, I just posted the moisture thing as an example. The logic is:1) put a widget on everybody,2) make the widget request some values when updating,3) give these values to both host and client. Host calculates, client just stores. No replicas needed. Link to comment https://forums.kleientertainment.com/forums/topic/48989-possible-to-add-a-new-stat-bar/#findComment-600853 Share on other sites More sharing options...
Ryguy9999 Posted January 12, 2015 Author Share Posted January 12, 2015 Would anyone be willing to share a little lesson about custom widgets? I sort of get ideas from other mods that do stuff that I want to, the only problem is I don't always know what they are doing or if what they are doing is something that I need to do, or just something that their doing for their specific purpose. Link to comment https://forums.kleientertainment.com/forums/topic/48989-possible-to-add-a-new-stat-bar/#findComment-601067 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