Jump to content

Griefer Witness of the Mighty Mod


Recommended Posts

Yes, your trusted friend told you that a griefer came over to your base, stole all your thule, took your tam, eyebrella and bearger vest. But you didn't see it. So, how should you do? You could either try to kill that player by weather pain or simply by shenanegan powers, then if proved otherwise, apologize and offer them a amulet.

But that would easily hurt feelings.

You could instead do something like this:

TheSim:FindFirstEntityWithTag('Wigfrig').components.inventory:DropEverything()

This command works when executed on yourself, e.g.:

GetPlayer().components.inventory:DropEverything()

This gives a cool animation by dropping all items instantly but without dying. But the previous command for other players does not work. Any suggestions?

Please try to refrain from any c_*() based commands, since some dedicated servers disable (some) of those commands. However, disabling access to TheSim, TheWorld etc., is not that easy. So, try to stick to a more general command instead of a shortcut

I'm surprised that that command works at all, since there is no tag Wigfrid, there is even no such prefab (Wigfrid's prefab is wathgrithr), and generally player prefabs cannot be distinguished by a tag. Also any attempt to distinguish by prefab name will fail if there are more players with the same character.

Commands from consolecommands are good in that they are tested pieces of code. So if you want to achieve some functionality that they do without using them, the best way is to take their code and use it directly (and possibly introduce some bugs due to typos).

However, I am somewhat puzzled why you need to avoid using them at all. I mean, you can run such commands only if you're an admin of the server, which implies the owner trusts you. You can just suggest to them to not remove the c_* commands. Also, why would they artificially remove the commands? So their admins can't run them? That doesn't make sense; an admin can run any code, thus can define them back for their own convenience or run commands directly, which is exactly what you are trying to do.

You can have your own custom commands to use, file location is <Documents>/Klei/DoNoTStarveTogether/customcommands.lua

I have my own that dumps out the inventory contents of everyone called 'cz_showinventories':

local function cz_showinventories_print_item(tab, item)
    print(string.format("%s(%s) <%s>", tab, item.name, item.prefab))
end
local function cz_showinventories_print_slots(slots)
    for _, v in pairs(slots)
    do
        cz_showinventories_print_item("  ", v)
        if((v.components~=nil)and(v.components.container~=nil))
        then
            for _, v2 in pairs(v.components.container.slots)
            do
                cz_showinventories_print_item("    ", v2)
            end
        end
    end
end
function cz_showinventories()
    for _, v in pairs(AllPlayers)
    do
        print(string.format("%s (%s) <%s>", v.name, v.userid, v.prefab))
        if((v.components~=nil)and(v.components.inventory~=nil))
        then
            cz_showinventories_print_slots(v.components.inventory.itemslots)
            cz_showinventories_print_slots(v.components.inventory.equipslots)
        end
    end
end

 

On 5/10/2016 at 4:51 PM, CarlZalph said:

You can have your own custom commands to use, file location is <Documents>/Klei/DoNoTStarveTogether/customcommands.lua

I have my own that dumps out the inventory contents of everyone called 'cz_showinventories':


local function cz_showinventories_print_item(tab, item)
    print(string.format("%s(%s) <%s>", tab, item.name, item.prefab))
end
local function cz_showinventories_print_slots(slots)
    for _, v in pairs(slots)
    do
        cz_showinventories_print_item("  ", v)
        if((v.components~=nil)and(v.components.container~=nil))
        then
            for _, v2 in pairs(v.components.container.slots)
            do
                cz_showinventories_print_item("    ", v2)
            end
        end
    end
end
function cz_showinventories()
    for _, v in pairs(AllPlayers)
    do
        print(string.format("%s (%s) <%s>", v.name, v.userid, v.prefab))
        if((v.components~=nil)and(v.components.inventory~=nil))
        then
            cz_showinventories_print_slots(v.components.inventory.itemslots)
            cz_showinventories_print_slots(v.components.inventory.equipslots)
        end
    end
end

 

In OSX steam installed DST, I am not sure I have anything related to DST under ~/Documents.

26 minutes ago, hyiltiz said:

In OSX steam installed DST, I am not sure I have anything related to DST under ~/Documents.

From http://support.kleientertainment.com/customer/portal/articles/1239590-i-need-technical-support-what-do-i-need-to-send-you-

Quote

PC: Go to your documents folder at Documents\klei\donotstarve\log.txt 

Mac: Go to your documents folder at ~/Documents/Klei/DoNotStarve/log.txt

Linux: Go to your Klei folder at ~/.klei/DoNotStarve/log.txt

So the Klei folder under OS X should be in <username>/Documents/Klei.

Do note that the customcommands.lua file does not exist at the start and should be manually made.

On 5/10/2016 at 7:12 AM, Muche said:

I'm surprised that that command works at all, since there is no tag Wigfrid, there is even no such prefab (Wigfrid's prefab is wathgrithr), and generally player prefabs cannot be distinguished by a tag. Also any attempt to distinguish by prefab name will fail if there are more players with the same character.

Commands from consolecommands are good in that they are tested pieces of code. So if you want to achieve some functionality that they do without using them, the best way is to take their code and use it directly (and possibly introduce some bugs due to typos).

However, I am somewhat puzzled why you need to avoid using them at all. I mean, you can run such commands only if you're an admin of the server, which implies the owner trusts you. You can just suggest to them to not remove the c_* commands. Also, why would they artificially remove the commands? So their admins can't run them? That doesn't make sense; an admin can run any code, thus can define them back for their own convenience or run commands directly, which is exactly what you are trying to do.

i am aware that the game files does not use 'Wgifrig' but I did manage to despawn myself using: TheSim:FindFirstEntityWithTag('Wigfrig'):Despawn(); But some other mod was also trying to despawn me by calling me through AllPlayers, so am not actually sure which one made the effect.

On 5/13/2016 at 0:58 AM, CarlZalph said:

From http://support.kleientertainment.com/customer/portal/articles/1239590-i-need-technical-support-what-do-i-need-to-send-you-

So the Klei folder under OS X should be in <username>/Documents/Klei.

Do note that the customcommands.lua file does not exist at the start and should be manually made.

I created a file /Users/hyiltiz/Documents/Klei/DoNotStarveTogether/customcommands.lua, and it only has the code chunk you provided above. When I reload the game and enter a dedicated server where I am admin (can use "remote" commands), the game can autocomplete the command; a proof for loading the customcommands.lua file; when i type `cz_` and hit TAB, it autocompletes to `cz_showinventories`. However, it shows nothing on the log. I tried something even simpler: defined a function which turns me into godmode by just created an alias to c_godmode(), which works if I type in manually. However, that command did not work as well, though being able to autocomplete.

 

I think it might have something to do with running in remote mode. Any ideas why and how to make it work?

The file Documents\Klei\DoNotStarveTogether\customcommands.lua is loaded only on the client side, so commands/functions defined inside of it are available on the client only (i.e. non-remote mode).

Dedicated server can load its own file (e.g. mine is located at Documents\Klei\DoNotStarveTogetherDedicated\Cluster_1\Master\customcommands.lua). Commands/functions defined in it will be available to be run in the remote mode console.

 

In that case, unless I have something like SSH access to the server which runs the "dedicated server", I can't really define my own functions. However, making the function a psudo-oneliner would also work, by separating each line with comma etc., then pasting those into the console instead of typing each time. However, I have never been able to perform copy/paste into the console. (Have no idea how some people can input Chinese characters into the chat, for that matter).

Any idea how to do a copy paste then? When I press Command+C/V (OSX shortcuts for copying and pasting), nothing happens.

When I'm pasting into the console with CTRL+V (Windows), the text gets pasted, but before submitting it I just have to press CTRL again to toggle the remote mode on. If the default key for toggling the console's remote mode under OSX is Command as well, then pressing it again should toggle the mode on, I guess.

If you have admin rights, then you can inefficiently make the server run commands of rather large lengths by sending it the lua to run from your client customcommands.lua:

local my_custom_server_commands = 
[[
function my_custom_command_1()
  if(ThePlayer and ThePlayer.components and ThePlayer.components.talker)
  then
    ThePlayer.components.talker:Say("Command 1 Ack'd!")
  end
end
function my_custom_command_2()
  if(ThePlayer and ThePlayer.components and ThePlayer.components.talker)
  then
    ThePlayer.components.talker:Say("Command 2 Ack'd!")
  end
end
]]
function init_custom_commands()
    local x, y, z = TheSim:ProjectScreenPos(TheSim:GetPosition())
    TheNet:SendRemoteExecute(
        my_custom_server_commands,
        x,
        z
    )
end

Do note that every time you run the command "init_custom_commands()" the entirety of it will output to the server's log file and can cause high clutter.

Also you won't be able to see anything the server prints out because it prints out to the server's console.

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...