Would it be possible to get an Event or Boolean for when a player hits the edge of a static sized world (World_MaxSector= >-1)?
I would prefer an event over checking a bool every time a player changes position.
Would it be possible to get an Event or Boolean for when a player hits the edge of a static sized world (World_MaxSector= >-1)?
I would prefer an event over checking a bool every time a player changes position.
That's a bit tricky unfortunately
The max sector is basically handled client- and serverside: on clientside, the game smoothly prevents the player from leaving the world bounds. This feels a bit like an "invisible wall", i.e it smoothly stops the player. It's not an actual wall, instead the player movement is slowed down the closer to player gets to edge of the world. Unfortunately the server isn't even aware at this stage that the player is leaving the sector, so unfortunately it couldn't trigger an event.
The server, however, also has a handling for the max sector: if the player still manages to escape the world bounds (e.g. by teleporting, or when moving with a very high speed etc), the server teleports the player back into the world bounds. This is a situation where we could trigger an event, but usually this shouldn't happen very often (considering the clientside handling should already prevent the player from reaching that point in most cases).
However, we could add a serverside check if the player is very close to the world bounds (i.e the point at which the client starts slowing down the player - which is ~ 16 blocks from the world edge), then trigger an event and/or set a bool. It wouldn't be 100% perfect because the player could still move a bit closer to the edge at that stage. Would that still work for you?
QuoteHowever, we could add a serverside check if the player is very close to the world bounds (i.e the point at which the client starts slowing down the player - which is ~ 16 blocks from the world edge), then trigger an event and/or set a bool. It wouldn't be 100% perfect because the player could still move a bit closer to the edge at that stage. Would that still work for you?
this should work. its mainly needed for my server clustering system. i just need a way to know when a player is at the end of the map so i can send them to the next server in the cluster.
Don’t have an account yet? Create a new account now and be part of our community!