Sarcen
Registered Users-
Posts
59 -
Joined
-
Last visited
Reputation
21 ExcellentBadges
-
Don't Starve Together
Contributor
-
Oxygen Not Included
Alpha Contributor
Recent Profile Visitors
1667 profile views
-
Well, all your questions stem from a not understanding how the game works in multiplayer. The server is the only one that runs all world simulation code. And the client has as little information available as required to see the result of the servers simulation. Like you want to spawn an item when you hit a frog? Well that only needs to run on the server, the server will spawn a networked item so the client can see and interact with it. Running it on both would turn out badly because then the client will spawn an item the server knows nothing about so you won't be able to interact with it. ThePlayer only makes sense on code that runs purely on clients. All simulation code runs on the server; and the server isn't a player (unless you are playing non dedicated) so that's why ThePlayer is nil. I'm terrible at explaining this stuff, but once you get your head around how it works it's just as easy as non networked code, just... logic... .
-
New mod: DJPaul's Sort Inventory
Sarcen replied to DJPaul's topic in [Don't Starve Together] Mods and Tools
Just taking a glance at the code, it doesn't look like it has any automatic sorting? One thing that has always annoyed me is that if you craft a item you can end up with two stacks of the same (e.g. have one stack of 20 grass and one of 10, craft something that costs 10 grass it will pick the first stack it finds leaving you with two stacks of 10 that could easily stack). Would be nice if it sorted after crafting and such so you don't get these things either. -
Map reveal *with* entities visible.
Sarcen replied to Zinfidel's topic in [Don't Starve Together] Mods and Tools
Entities are only loaded in a large circle around you, you can see it my changing your camera distance as client (TheCamera.maxdist = 200 or so in console). Also, You can't zip around the map without the server putting you there, with that I mean is that the server is already actively sending all those entities around you, even if going at fast speeds... With dummy objects I mean simple prefabs spawned on the client side that only contain an icon for the specified prefab. The location and prefab would be specified by the server in a global (no transform) networked entity. -
Map reveal *with* entities visible.
Sarcen replied to Zinfidel's topic in [Don't Starve Together] Mods and Tools
Easily, no. Even if your client knew about the icon I'm pretty sure it wouldn't be drawing it. The icons you see in the distance are cached icons on the mini map. It would be possible but would require a lot of work and it wouldn't be done very cleanly. (Creating dummy objects for a second to cache the icon on the minimap) -
Change option doesn't works on server dedicated
Sarcen replied to ToNiO55's topic in [Don't Starve Together] Mods and Tools
Damn, Can't believe I missed that. I debugged printed the table and the entry wasn't in it at all. I would have figured it would have contained a nil if it was such a mistake lol. -
Change option doesn't works on server dedicated
Sarcen replied to ToNiO55's topic in [Don't Starve Together] Mods and Tools
*edit* nevermind this too.. -
Change option doesn't works on server dedicated
Sarcen replied to ToNiO55's topic in [Don't Starve Together] Mods and Tools
I'm not sure if mod config is networked at all. If its not (which I think it isn't...) the client recipe shows the clients mod setting (normal by default). But when you craft it it will probably still consume the amount specified on the server. *edit* Never mind, just examined the code and it is networked -
(Help!) Custom Character Art Bug Fix Needed
Sarcen replied to Ryudragon's topic in [Don't Starve Together] Mods and Tools
The atlas comes with a xml file that determines the coordinates used. I guess what you did is just paint on top of an existing atlas. Its easier to generate the atlas from seperate textures. *edit* As this is a character it works slightly different and is slightly harder then I thought. But I believe the bugs I'm seeing are because of incorrect placement on the atlas. -
Looks like you are just creating an entity right there and then, one without a name. It can't network that. You should create a projectile prefab for that. Also anything that comes after the first "projectile.entity:SetPristine()" should probably only be run on the server side (TheWorld.ismastersim) *edit* @DarkXero, you beat me to it
-
Both are doable, although, banned is probably slightly trickier depending on if the banned player is still on the client table at the moment of the event... age would simply be checking player.components.age.GetAgeInDays() > somenumberSomething along the lines of this would probably work... local clientinfo = nilfor k,v in pairs(TheNet:GetClientTable()) do if v.userid == player.userid then clientinfo = v break endendlocal banned = falsefor k,v in pairs(TheNet:GetBlacklist()) do if clientinfo.steamid == v.steamid then banned = true break endendthen checking if banned is true. But this is assuming the banned player is still in the ClientTable at the moment despawn is called. It could be that he is not. If not you could check him by name. *edit* you could also possibly check by user id, but I'm not sure how unique that is, but it seems pretty unique . local banned = falsefor k,v in pairs(TheNet:GetBlacklist()) do if player.userid == v.userid then banned = true break endend
-
@Kzisor. Yes, I agree you should be using the locomotor:SetExternalSpeedMultiplier. But that's a completely different issue from how to trigger it. A 1 second timer will still be better on performance, both cpu and network performance. Since changing it every frame will also cause it to be transmitted over the network every (network)tick.
-
Bug. Invisible light of custom item.
Sarcen replied to Maris's topic in [Don't Starve Together] Mods and Tools
I guess equipped items only exist on their owner and server. That`s why the normal the torch spawns a separate prefab for the light effect.