Jump to content

Client vs. Host discrepancy with player coordinates - Dedicated Server possible for testing?


Recommended Posts

Hi, I released a 0.0.1 build of my first mod called Coordinate over the weekend. It shows the coordinates of the user at the top of their screen.

 

I've had generally good feedback from users, but also some complaints that it only works for the host of the game, and not the other clients. That kind of removes the point of my mod as coordinates are basically useless if you're the only one who can see them.

 

I'm looking for some general help/advice about interface modding as I've only got 4 hours of experience so far. :-)

 

I've got the following values in my modinfo.lua file:

dst_compatible = trueclient_only_mod = trueall_clients_require_mod = true
I put client_only_mod because the mod only alters the interface for the user, but I'm not 100% positive of the implications of these settings.
 
I had one report that the coordinates never change for a user, even when they're walking around. This made me suspect that it's retrieving the coordinates for the wrong player/object. I'm retrieving the coordinates for the user with the following code:
GLOBAL.ThePlayer.Transform:GetWorldPosition()
I was under the impression that ThePlayer was always going to represent the current player on the machine running the game/mod. Is this correct?
 
I've not been able to confirm any of these bugs yet because I haven't been able to get someone to help test, and I can't be a host and a client at the same time. Is there any possibility of setting up a dedicated server on my VPS or something so that I can test this without relying on a third party?
 
Links to the mod/comments/bug reports
 
Link to comment
Share on other sites

  • Developer
I put client_only_mod because the mod only alters the interface for the user, but I'm not 100% positive of the implications of these settings.

 

You should be seeing a warning in your log file that says "WARNING loading modinfo.lua: "..modname.." specifies client_only_mod and all_clients_require_mod. These flags are mutually exclusive."

You don't need all_clients_require_mod = true in your modinfo if you're expecting that players can have this just locally.

 

You should be able to test this mod by joining any other server, then your mod will be running on your build as a client. If you need all_clients_require_mod to be true and want to test as a client, then you'll either need another player to help you, or you'll have to wait until the dedicated servers are available, which should be coming soon.

Link to comment
Share on other sites

You should be seeing a warning in your log file that says "WARNING loading modinfo.lua: "..modname.." specifies client_only_mod and all_clients_require_mod. These flags are mutually exclusive."

You don't need all_clients_require_mod = true in your modinfo if you're expecting that players can have this just locally.

 

You should be able to test this mod by joining any other server, then your mod will be running on your build as a client. If you need all_clients_require_mod to be true and want to test as a client, then you'll either need another player to help you, or you'll have to wait until the dedicated servers are available, which should be coming soon.

 

Thanks for the response. I was just a bit confused as to the meaning of client_only_mod, thinking that meant it didn't need any server-side components in order to run.

Link to comment
Share on other sites

  • Developer
I was just a bit confused as to the meaning of client_only_mod, thinking that meant it didn't need any server-side components in order to run.

 

 

No, you are correct. The flag "client_only_mod" implies that the mod has no server/sim implications.

"all_clients_require_mod" this flag makes it so that the mod has to be running on both the server/simulation as well as all the clients.

 

There are 3 valid configurations for these flags in your modinfo file

client_only_mod = true, all_clients_require_mod = false - interface mods than don't affect the game simulation

client_only_mod = false, all_clients_require_mod = true - game simulation mod that has assets or code that needs to run on the clients

client_only_mod = false, all_clients_require_mod = false - game simulation mod that has no assets required by the clients

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...