From GMod Wiki
|This page has multiple issues.|
See the Page Details section for information.
|Description||Sets the transmit state of Networked Vars of an Entity|
function ENT:UpdateTransmitState() return TRANSMIT_ALWAYS end;
Lets say, you are spawning a SENT somewhere, where a player can't see it. Now, the SENT triggers ( e.g. Entity:SetNWInt(1) ). Sadly, the user won't get this NWInt send to his game because TRANSMIT_PVS is the default value.
Changing TRANSMIT_PVS to TRANSMIT_ALWAYS will send the updated NWInt no matter if a player sees this or not.
Further more, triggering Entity:SetNWInt(1) multiple times with TRANSMIT_ALWAYS will always force the server to send the data to the client, even if the value (here it is 1) hasn't changed. If it's TRANSMIT_PVS, the server will only send this value, if it changed.
This can run into trouble, like so: The SENTs have been spawned and NWInt is getting set to 1. Now a player connects to a server. He will not see the value as 1, even if the SENT is resending it. Only, if the value changes (e.g. NWInt is set to 2, previously 1), will the player recognize this being 2.
- TRANSMIT_PVS - Only send when in the PVS (aka in Players View) - The default value
- TRANSMIT_ALWAYS - Always Send
- TRANSMIT_NEVER - Never Send
|This page has been deemed a mess. It may contain unnecessary information or be poorly organized. You can discuss changes on this article's talk page.|
|This page needs to be edited as it contains information that is unclear or incorrect. Improvement can be discussed on the talk page. Find more pages that need work here.|
Details: None given.