Feldoth

Registered Users
  • Content count

    6
  • Joined

  • Last visited


Community Reputation

2 Neutral

About Feldoth

  • Rank
    Junior Member
  1. I didn't get a response on this, so I tried moving my code into a component - that changed the problem but didn't fix it. I was able to get my periodic events to run using this method, but the component's OnLoad function does not get called when running a cave server. I've ended up using a persistent string to save data, however this isn't work on the cave server for some reason (I haven't had much chance to troubleshoot that yet). Any insights into why any of this works like this would be useful...
  2. Hello, I'm trying to debug an issue where various bits of code attached to a custom character, and executed via DoPeriodicTask do not work while inside a cave. These functions are universally executed in master_postinit (using the extended sample character as a base), and about the only idea I have as to why they aren't working is that this code may not be being executed after a cave transition. What I'm not sure about is what I should hook into in order to run this code on transition (I've found an event for before the transition, but not one for after). I'm hoping someone can tell me if there is such an event, and what it is. I'm sure there must be some way to do this, but I've been unable to find it. Alternatively if somebody knows another reason why these would stop working in a cave, please let me know! Thanks!
  3. Guude (Mindcrack)

    Version 1.0.0

    371 downloads

    This is the fan-made mod for GuudeBoulderfist: YouTuber, Streamer, and CEO of Mindcrack. This is the first of several planned mods for various Mindcracker's and their friends (~7 total). This mod is compatible only with DST. Description: Overdosed on the Insect Swarm Plasmid Has a Loyal Companion Is very nervous Guude's main mechanic is the ability to summon swarms of bees (a reference to his Bioshock playthrough). Press the "B" button to summon 5 bees at a time, each bee costs you 2 sanity and you cannot summon more if you don't have enough sanity to pay for them. Guude Bees do slightly more damage and move faster than normal bees, and are visually smaller, however they only last 45s before killing themselves, and have only 1HP each. Bees will automatically target the nearest monster or large animal. They will never target other players, small creatures, other bees, or shadows. Guude's pet cat(coon), Conifer, wanders about killing small wildlife and occasionally hacking up hairballs. He is immortal and will not participate in combat - indeed if he gets too close to a monster he will flee at high speeds. It's not possible to loose Conifer as he will teleport slightly off-screen if he is away from you too long, so feel free to let him wander. Watch what you leave on the ground though, as he might decide he likes it! Guude is an old hand at Don't Starve, and always makes a crockpot as quickly as possible. Any food you eat which is not prepared with a crockpot will cost you 2 sanity (after any benefits or penalties from the food itself), while food made in a crockpot will grant you an additional 2 sanity in addition to its normal effects. Guude's a nervous guy, and has been know to absolutely drench himself with sweat. When Guude's sanity drops to 60 he will begin sweating, this will slowly increase your wetness until you reach 30 wetness. No amount of drying will overcome this effect, but it will stop when your sanity recovers above 60. If you sanity hits 25 Guude's nervousness will really kick in - you will sweat faster, and the cap of 30 wetness is increased to 65. While sweating heavily Guude has an increased chance to drop his weapon while fighting, beyond the normal chance caused by wetness. Sweating will not kick in while it is raining. Credits: This mod, and the others currently in development were a team effort, with various people contributing both small and large amounts to each individual mod. In the case of this mod, the contributions were as follows - but overall the entire "Modcrack" team is contributing ideas, support and time to making each mod be as good as it can be, and the roles are flexible. Programmer: Feldoth (me) Artist: IronClark Testers: Hellfrezer, Quozlet (also a programmer on other mods), Uruso Dialog: Me, Jww243, Axelum Art Support: Geekasaurus (also the artist on some of the upcoming mods) A Github repository for this mod can be found here, contributions are welcome and appreciated: https://github.com/feldoth/DST-Guude
  4. Thanks for your help, I was able to get this working by using net_variables - your comment about the server handling component logic got me on the right track. Here's what I came up with - it feels like I might not have done everything exactly right, but it is working and might be useful to someone else: AddClassPostConstruct("widgets/statusdisplays", function(self) local player = self.owner if player.prefab=="mychar" then local beeCounter = require "widgets/beecounter" player.beeCounter = beeCounter(player) player.beeCounter:Update("") if not player.components.childspawner then -- Update bee counter for cave enabled servers self.netBeeTotal = GLOBAL.net_ushortint(player.GUID, "beeTotal", "mychar_bee_update") self.netBeeTotal:set(0) player:ListenForEvent("guude_bee_update", function(inst) inst.beeCounter:Update("Bees: "..self.netBeeTotal:value()) end) else -- Update bee counter for non-cave servers player:DoPeriodicTask(0, function(inst) inst.beeCounter:Update("Bees: "..player.components.childspawner.childreninside) end) end end end) I used the old method for non-cave servers as that avoided an issue I was having with duplicate id's for my net_var (it was getting added twice since the server and player are the same thing on non-cave servers - so I decided to just not use it on non-cave servers). The other half of this is in my character's prefab script: local master_postinit = function(player) --snip player.netBeeTotal = net_ushortint(player.GUID, "beeTotal", "mychar_bee_update") player.netBeeTotal:set(0) player:DoPeriodicTask(1, function(inst) inst.netBeeTotal:set(inst.components.childspawner.childreninside) end) --snip end That adds the variable on the server, and updates it with the current childspawner count every second, which in turn causes the event to fire on the client, which updates the display widget.
  5. Any ideas, anyone? Even just knowing how/why Cave enabled servers are different from normal servers might help.
  6. Here's the offending code, this is a character specific widget that keeps track of childspawner children (displaying how many are inside the spawner). It is a simple text widget: AddClassPostConstruct("widgets/statusdisplays", function(self) local player = self.owner if player.prefab=="mychar" then local beeCounter = require "widgets/beecounter" self.beeCounter = beeCounter(player) player:DoPeriodicTask(0, function(inst) if inst.components.childspawner then local children = tostring(inst.components.childspawner.childreninside) self.beeCounter:Update("Bees: "..children) end end) end end) The problems start with the line "if inst.components.childspawner then" - this line only exists because if I let the next line execute on a cave enabled server, the game crashes. For whatever reason, at this point the player does not have defined components (for the childspawner at least). However it goes deeper than that, as if I move that DoPeriodicTask function into the character itself, running the code to update the widget causes a disconnect from the server. This may be because I'm not sure what "self" is in the context of the AddClassPostConstruct closure parameter, so I'm not correctly referencing it when I try to move the code out of modmain.lua, however I'm more than a little surprised that the periodic task doesn't start working once the player is spawned in and fully set up - shouldn't they get the component at some point and the if state begin evaluating as true? The component works, things related to it function in game, just this widget fails and I have no idea why. I should mention that this works perfectly on a non-cave enabled server (and does so in several of the different configurations I've tried). Any help would be appreciated. Thanks!