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.

JackJohnsn

Is it possible to alter game's mechanism without mods?

Recommended Posts

JackJohnsn    139

I've been setting up some dedicated servers recently, on Linux. I realize that you can tweak the world regeneration settings by modifying the `leveldataoverride.lua` file, for example setting the carrots to more.

But, from time to time, I notice some servers that are not modded, yet they have some settings that I do not see in the world generation screen ( The on in the game client ). For example, there's a dedicated server that has cave bananas on surface, or a server that does not reset when everyone dies ( not endless ), and none of them are modded.

How can this be done? I couldn't find much documents regarding this. If it's possible, how far can it be extended? e.g, is it possible to prevent fire spread without installing a mod?

Any help is appreciated.

Share this post


Link to post
Share on other sites
CarlZalph    3,170

Alternatively you could also run any code you'd want using customcommands.lua and interfacing with the game directly without the nice API the mod interface exposes.

Share this post


Link to post
Share on other sites
BeliarBAD    564

hmm i had mushtreees growing on my overworld and i didnt had a mod. i did some mistakes in the lua

Share this post


Link to post
Share on other sites
Daniel86268    369
22 hours ago, BeliarBAD said:

hmm i had mushtreees growing on my overworld and i didnt had a mod. i did some mistakes in the lua

Normal mushrooms turn into their respectively coloured mushtrees during a full moon. Maybe that's what happened to you.

Share this post


Link to post
Share on other sites
BeliarBAD    564
1 hour ago, Daniel86268 said:

Normal mushrooms turn into their respectively coloured mushtrees during a full moon. Maybe that's what happened to you.

nah thats only in ds. in dst they dont grow to mushtrees on fullmoon. i had blue mushtrees spawning in overworld at the end of the first winter. in spring green ones were spawning and in summer red. 

i did something wrong. 

also i had few times when i created my deticated server with steam tools 2 overworlds. when i was jumping in a sinkhole i came out in a second overworld lol

Share this post


Link to post
Share on other sites
BakaSchwarz    32
On 3/18/2019 at 3:16 PM, CarlZalph said:

Alternatively you could also run any code you'd want using customcommands.lua and interfacing with the game directly without the nice API the mod interface exposes.

This of course, or you could always edit the game files directly. Beware of updates in this case though

Share this post


Link to post
Share on other sites
JackJohnsn    139
On 3/18/2019 at 5:46 PM, CarlZalph said:

Alternatively you could also run any code you'd want using customcommands.lua and interfacing with the game directly without the nice API the mod interface exposes.

Well thank you for the link. Although, I'm having the same trouble as this topic. I'm trying to test it on my PC, on a hosted game ( not dedicated ), So i created the file at the following directory, but it does nothing:

C:\Users\MyUser\Documents\Klei\DoNotStarveTogether\customcommands.lua

which MyUser is my username. Isn't this the correct folder? You mentioned something about server's folder and remote command in your last comment on this topic.

Share this post


Link to post
Share on other sites
CarlZalph    3,170
5 hours ago, JackJohnsn said:

Well thank you for the link. Although, I'm having the same trouble as this topic. I'm trying to test it on my PC, on a hosted game ( not dedicated ), So i created the file at the following directory, but it does nothing:


C:\Users\MyUser\Documents\Klei\DoNotStarveTogether\customcommands.lua

which MyUser is my username. Isn't this the correct folder? You mentioned something about server's folder and remote command in your last comment on this topic.

The file paths have changed a little bit since then.

Client: ~/Klei/DoNotStarveTogether/<Steam 3 ID>/customcommands.lua

Server 1: ~/Klei/DoNotStarveTogether/<Steam 3 ID>/Cluster_<1-5>/Master/customcommands.lua

Server 2: ~/Klei/DoNotStarveTogether/<Steam 3 ID>/Cluster_<1-5>/Caves/customcommands.lua

Share this post


Link to post
Share on other sites
JackJohnsn    139
10 hours ago, CarlZalph said:

The file paths have changed a little bit since then.

Client: ~/Klei/DoNotStarveTogether/<Steam 3 ID>/customcommands.lua

Server 1: ~/Klei/DoNotStarveTogether/<Steam 3 ID>/Cluster_<1-5>/Master/customcommands.lua

Server 2: ~/Klei/DoNotStarveTogether/<Steam 3 ID>/Cluster_<1-5>/Caves/customcommands.lua

Thanks, that fixed it.

Share this post


Link to post
Share on other sites
JackJohnsn    139

I was able to achieve some success through this, but once again I'm stuck since I'm not familiar with Lua much. According to this post, some functions such as `AddClassPostConstruct` are only accessible inside the mods. I'm not sure how to interact with the core classes via the customcommands.lua file, since I don't know the scopes and there's not much documentation about it.

Do you know whether it's possible or not to override/alter these classes or their methods via customcommands? Any clue, link, guide, etc is appreciated.

@CarlZalph

Share this post


Link to post
Share on other sites
CarlZalph    3,170
5 hours ago, JackJohnsn said:

I was able to achieve some success through this, but once again I'm stuck since I'm not familiar with Lua much. According to this post, some functions such as `AddClassPostConstruct` are only accessible inside the mods. I'm not sure how to interact with the core classes via the customcommands.lua file, since I don't know the scopes and there's not much documentation about it.

Do you know whether it's possible or not to override/alter these classes or their methods via customcommands? Any clue, link, guide, etc is appreciated.

@CarlZalph

There's not real documentation for customcommands.lua, you're going in feet first and have to interface with underlying things.  It's supposed to be used to create commands for your server to use, hence the name, so using it for this purpose isn't its direct intention.

The other method of loading a client mod forcefully on a dedicated to hide the mod might be better suited for your use, since you want to use some of its API.  The mod will function identically to one that's registered as a server mod, so plenty of help could be assisted here, it's just that you're hiding it at the end product stage.

Share this post


Link to post
Share on other sites
JackJohnsn    139
11 hours ago, CarlZalph said:

There's not real documentation for customcommands.lua, you're going in feet first and have to interface with underlying things.  It's supposed to be used to create commands for your server to use, hence the name, so using it for this purpose isn't its direct intention.

The other method of loading a client mod forcefully on a dedicated to hide the mod might be better suited for your use, since you want to use some of its API.  The mod will function identically to one that's registered as a server mod, so plenty of help could be assisted here, it's just that you're hiding it at the end product stage.

I was actually trying to do your suggestion here, hiding the admin badge via customcommands. The badge is handled via the `PlayerStatusScreen` class located in the `screens/playerstatusscreen`, and by the `listingConstructor` Method. I was able to do it using `AddClassPostConstruct` in a mod, but since I already mentioned that function isn't available in customcommands.

Although I didn't understand the last paragraph. Did you mean force enabling a client-only mod of workshop? Or did you mean by using `ForceEnableMod()` in the `modsettings.lua` file? because that will still flag the server as modded.

Again thanks for sharing the info and your time.

Share this post


Link to post
Share on other sites
CarlZalph    3,170
1 hour ago, JackJohnsn said:

I was actually trying to do your suggestion here, hiding the admin badge via customcommands. The badge is handled via the `PlayerStatusScreen` class located in the `screens/playerstatusscreen`, and by the `listingConstructor` Method. I was able to do it using `AddClassPostConstruct` in a mod, but since I already mentioned that function isn't available in customcommands.

Although I didn't understand the last paragraph. Did you mean force enabling a client-only mod of workshop? Or did you mean by using `ForceEnableMod()` in the `modsettings.lua` file? because that will still flag the server as modded.

Again thanks for sharing the info and your time.

Ah, well let me stop you from wasting further time- the information about rendering the badge is sent from the server to the client and the client renders the badges.  Any mod on the server won't stop clients from rendering it.  What you'd end up having to do is alter the memory of the server to remove the bit that marks if someone's an admin, which requires deeper knowledge on the memoryspace of DST as well as good debugging skills.

 

Forcing a client-only mod to be enabled on a dedicated makes it not show up as modded.

Share this post


Link to post
Share on other sites
JackJohnsn    139
3 hours ago, CarlZalph said:

Ah, well let me stop you from wasting further time- the information about rendering the badge is sent from the server to the client and the client renders the badges.  Any mod on the server won't stop clients from rendering it.  What you'd end up having to do is alter the memory of the server to remove the bit that marks if someone's an admin, which requires deeper knowledge on the memoryspace of DST as well as good debugging skills.

 

Forcing a client-only mod to be enabled on a dedicated makes it not show up as modded.

Ah I get ya now. You mean using `client_only_mod = true` in the `modinfo.lua`? That works, and also is a nasty way. I don't know how it's allowed :) Thanks again.

Share this post


Link to post
Share on other sites