darkscaryforest

  • Content Count

    16
  • Joined

  • Last visited

Community Reputation

1 Neutral

About darkscaryforest

  • Rank
    Junior Member
...

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Enable
  1. I got it working by using an RPC: -- modmain AddModRPCHandler("ChangeCharacter", "PLAYAS", function(player, name) player.playAsCB(player, name, false) end) local CharButton = Class(Widget, function(self, owner, charName, pos, playas) Widget._ctor(self, "Character Button") local buttonName = charName .. "_button.tex" local buttonMouseOverName = charName .. "_button_mouseover.tex" self.owner = owner self.hud_focus = owner.HUD.focus self.charName = charName self.playas = playas self.button = self:AddChild(ImageButton("images/widgets/character_buttons.xml", buttonName, buttonMouseOverName, buttonName)) self.button:SetOnClick(function() self:ChangeCharacter() end) self.button:SetPosition(pos.x, pos.y, pos.z) self.button.inst.UITransform:SetScale(.4, .4, .4) end) function CharButton:ChangeCharacter() SendModRPCToServer(MOD_RPC["ChangeCharacter"]["PLAYAS"], self.charName) end When I originally made this, I used the game's resurrect button widget as an example. It looks like a crap load of stuff changed in there and it is using a similar RPC. Now there's some kind of separation between client and server data here. Or something. I have no idea. Regardless, the player object you get in the RPC callback has all the components you'd expect from the initialization player_common.lua gives you.
  2. Hey community. I had a working feature on my character mod break with the last update and am having trouble patching it. Long story short, I had a widget (a series of buttons) where if you click on the button attributes of the character would change to mimic existing characters. Here's some sample code: -- modmain function StatusPostConstruct(self) local yAmount = -40 local pos = {x = 40, y = -200, z = 0} for index, name in pairs({"my_custom_character","wilson","wendy","webber","winona"}) do self:AddChild(CharButton(self.owner, name, pos)) pos.y = pos.y + yAmount end end AddClassPostConstruct("widgets/statusdisplays", StatusPostConstruct) local CharButton = Class(Widget, function(self, owner, charName, pos) Widget._ctor(self, "Character Button") local buttonName = charName .. "_button.tex" local buttonMouseOverName = charName .. "_button_mouseover.tex" self.owner = owner self.hud_focus = owner.HUD.focus self.charName = charName self.button = self:AddChild(ImageButton("images/widgets/character_buttons.xml", buttonName, buttonMouseOverName, buttonName)) self.button:SetOnClick(function() self:ChangeCharacter() end) self.button:SetPosition(pos.x, pos.y, pos.z) self.button.inst.UITransform:SetScale(.4, .4, .4) end) function CharButton:ChangeCharacter() playAs(self.owner, self.charName, false) end -- my_custom_character.lua function playAs(inst, name, initial) -- change character attributes blah blah blah ... inst.AnimState:SetBuild(name) end local master_postinit = function(inst) inst.playas = "my_custom_character" end return MakePlayerCharacter("my_custom_character", prefabs, assets, common_postinit, master_postinit, start_inv) The self.owner object passed into StatusPostContruct used to be the actual character object that was initialized and returned inside my_custom_character.lua. Now however, it looks like it was replaced with some other representation object since I've noticed components missing from self.owner that used to be there (and self.owner.playas is nil now). The problem is I don't know anyway to have the widget access the actual character object to change stuff anymore. I thought maybe I could use a global variable outside of the callback, but doing require("prefabs/my_custom_character") would just return me a whole new sets of variables...I think? I am a total lua newbie, so let me know if there's something in the language I can do that I'm missing. Thanks for any help
  3. Hey sorry I never got back to you, I got busy with thanksgiving and forgot I just came here to say it's fixed! Even my megabase game quits in like 30 seconds now! I didn't need to rename the documents folder, the latest updates must have solved the issue. Thanks!
  4. Thanks for your really fast response. For comparison, loading up the game (when I host or otherwise) takes about 15 seconds A. I was able to reproduce when quitting on a freshly created world (a few seconds into day 1) B. No, it is pretty fast quitting a game hosted elsewhere. C. Yes, I've always had caves enabled D. I was running a few client mods, so I did what you said- disabled them, quit, validated steam files (it said all files validated successfully), created a new world and tried quitting again and got back to the main menu in 7 or so minutes, so I suppose mods are not helping here I then followed your 7 steps. The saving indicator following the c_save command went away about 3 seconds after. For some reason, I couldn't get this new server to write log files in the corresponding master and caves directories...is there a command I can use to force it to write to the log? I did have my client_log.txt located at Documents\Klei\DoNotStarveTogether\client_log.txt client_log.txt
  5. Apologies if this is a duplicate, I couldn't find this issue. When save/quitting any don't starve together server I'm hosting, it takes an extremely long time to get back to the main menu (usually about half an hour). The game runs fantastic otherwise, starting a game/running it. Opening task manager after trying to quit shows that memory and cpu usage are way under maximum, and the two don't starve together dedicated servers running seem to still be doing things. I've also seen this happen when playing the single player shipwrecked and vanilla don't starve games. Any wisdom or workarounds are greatly appreciated. Thanks!