L. Ringmaster

  • Content count

  • Joined

  • Last visited

Community Reputation

12 Good

About L. Ringmaster

  • Rank
    Junior Member


Don't Starve
  • Contributor

Recent Profile Visitors

267 profile views
  1. How to modify screen functions?

    @Ultroman Believe it or not that's exactly how my code originally worked. I was concerned that somehow the local variable wasn't working correctly in the OnClick function, so made the call inline. I also tested the "modname" parameter out as a shot in the dark. You are correct, the all_clients_require_mod change was the solution. Thanks again!
  2. How to modify screen functions?

    @Ultroman @rezecibI've gotten it working using TheNet:SendRemoteExecute as a work around. The only problem I'm currently having is my mod config data (DISABLECONFIRMATIONMESSAGE) does not seem to work when running with caves. It always evaluates to the default even when I've configured it to be otherwise.
  3. How to modify screen functions?

    I had thought about trying that, but didn't think it would be necessary since its an administrative mod, so any administrators who needed the mod could manually download it. I'll give that a try and see if it works. @Ultroman *EDIT: I just tried it. No luck, still only have access to replica inventories. I believe that makes sense as the ban button's is executing client side where it won't actually have full access to the player's inventory. If not.... Now that I've confirmed all_clients_require_mod isn't the solution then the following is relevant: I had also traced the ban button back to UserCommands, but kinda stopped there. I hadn't realized (or maybe just hadn't accepted) the fact that it then enters a black box of code I won't be able to manipulate. If that's the case it sounds like I might have to find a different approach. I've also successfully used TheNet:Ban(userid) from console, so maybe I can figure out some way to implement an server side listener for a custom client side command and have the listener use TheNet:Ban. Actually, can't I somehow cause the client to execute arbitrary code on the server? I mean... that's effectively what the client is doing when they execute remote server commands in the console, right? That's really all I want to do seeing as the user clicking the ban button must have admin permissions anyways. EDIT #2: Just found this: TheNet:SendRemoteExecute Will try tomorrow!
  4. How to modify screen functions?

    @rezecib Hmm, now that I'm looking again I'm actually seeing the print statement out put in the client_log.txt when running with caves. This seems to confirm what Ultroman is getting at. My code is running on the client when it needs to be running on the server. @Ultroman Yep, you're right, I am able to find a replica inventory. I think we may be starting to get to the crux of my issue. The player status screen (and thus the ban button and its onClick) executes on the client, but the inventory dropping mechanic I would like to add needs to be executed by the server. I'll need to take another look at how the original onclick function achieves this and how other mods manage it. I'm kind of confused now regarding where my code is actually being executed. As I currently understand it server mods can alter both client and server code. Presumably this is why certain mods have a flag in the modinfo.lua to require all clients to download the server mod as well? Sounds like I'll need to add a command the client sends to the server on the onClick action which causes the server to execute the inventory drop. One thing I don't understand is why I have access to both the inventory and replica inventory when running without caves. I just tested it again: When playing on a server without caves I (Player 1) have access to both the replica and real inventories of another player (Player 2) using the code executed in my mod
  5. How to modify screen functions?

    @rezecib I was looking in both the Caves and Master directories for the clusters I was on, but wasn't seeing my output in any of the log files in those directories. I was surprised to not see the output in either location despite seeing it in the console. I'll double check when I get home to make sure it wasn't just user error.
  6. How to modify screen functions?

    @rezecib @Ultroman I've noticed the mod doesn't seem to work on servers with caves. player.components.inventory:DropEverything() fails as inventory evaluates to nil, however manually executing AllPlayers[n].components.inventory:DropEverything() in console when connected to the server causes the intended behavior. I've been struggling to troubleshoot the cause due to the following issues I experience when running with caves: I can't get console output to work properly on servers with caves. When manually entering commands into console I've I've found that only the "print" function's output shows up in the console, and it only does so when executed in "local" mode. Entering commands such as "c_spawn(...)" or "c_godmode()" has the intended effect, but no output is sent to console like usual. When running with caves, output sent to console with the print commands does not show up in any of my client or server logs. As a workaround I've found that output sent to TheNet:SystemMessage does show up in my client chat log, but only when called manually from the console, not from mods. When running with caves, print statements from my mod do show up in the console, but when I'm printing all the members of a table (to see what members it has for debugging) the console's 20 lines of buffer are quickly exceeded. As far as i can tell there's no way to scroll back or extend this buffer. This would be less of an issue if all output was actually appearing in my logs. Any insights would be appreciated!
  7. How to modify screen functions?

    @rezecib @Ultroman Thanks so much for your help! I've now completed my first mod! Please take a look and critique it for me. Let me know if there's anything I could have done in an easier or better way. Even though it's only 20 lines I spent probably 4-5 hours figuring everything out. https://steamcommunity.com/sharedfiles/filedetails/?id=1725443110
  8. How to modify screen functions?

    @rezecib @Ultroman Pardon my ignorance, but we all start somewhere: How am I supposed to get a specific user's object using their userid? I tried using GetPlayer(playerListing.userid) but it noted that the GetPlayer function is deprecated and I should be using ThePlayer instead, however ThePlayer seems to be specific to my character. I found i can index into AllPlayers. Do I really need to iterate through AllPlayers to find the one with the matching userid? For context I am trying to use the loop: for i,playerListing in pairs(self.scroll_list.static_widgets) do And then use the playerListing to access the player's components table, such as one can do using the following: ThePlayer.components Is there any way I can get additional information regarding the various parameter inputs to the functions I've found? I found I can get the names of members of an object by iterating over and printing the object's name/value pairs: for i,v in pairs(ThePlayer) do print(i,v) end This leaves my knowing what the functions are, but no how to use them. Thus far I've been grepping through data bundles and various mods looking for areas which make use of the function, but that tends to be pretty hit or miss. There's got to be a better way!
  9. How to modify screen functions?

    Thanks so much @rezecib, I think that gives me enough info to continue!
  10. How to modify screen functions?

    I can't seem to find any other mods which modify screens to use as a baseline. The search continues.
  11. How to modify screen functions?

    Sorry, that's where I intended to post. Must've gotten a bit lost!
  12. I'm looking at playerstatusscreen.lua and would like to modify playerListing.ban:SetOnClick's inline function (located on line line 562). How could I go about doing this? For context this is where said function is located: playerstatusscreen.lua (file) PlayerStatusScreen:DoInit (function) listingConstructor (local function) playerListing.ban:SetOnClick (which gets passed in an inline function)
  13. The Gorge Event Extended

    When do we get information about the tournament?
  14. Agreed, I posted on this same topic recently as well. Inventory management and crafting should be a simple addition that would add much to the overall game feel.
  15. I believe that adding a mechanism to toggle the on state of the miner hat would make it a much more user friendly item. I'm not sure exactly how this could be implemented. Potentially, the "examine" shift-click or the ctrl-click feature could be altered so that while equipped it would toggle the on state.