Hey, after the recent gmod update and looking into these network related vars can some please explain the difference between stuff like [url=http://wiki.garrysmod.com/page/Entity/SetNWInt]SetNWInt[/url], [url=http://wiki.garrysmod.com/page/Entity/SetNetworkedInt]SetNetworkedInt[/url], [url=http://wiki.garrysmod.com/page/Entity/NetworkVar]NetworkVar[/url], and [url=http://wiki.garrysmod.com/page/Entity/DTVar]DTVars[/url]?
I use SetNWInt and SetNetworkedInt just as an example though anything SetNW* and SetNetworked* is what I'm referring to.
When should one be used but not the other and is there a best/better one to be using? Thanks
Edit:
From what I gather it seems like [url=http://wiki.garrysmod.com/page/Entity/NetworkVar]NetworkVar[/url] is the way to go?
Use SetNW* and NetworkVar for data that changes a lot, use net otherwise. The rest you shouldn't use at all.
[QUOTE=StonedPenguin;47387226]Use SetNW* and NetworkVar for data that changes a lot, use net otherwise. The rest you shouldn't use at all.[/QUOTE]
Thanks for the response, one last question. Since SetNW* is causing issues for now would NetworkVar be a stable alternative?
NetworkVar and DTVars are one and the same. The Set/GetDTVar functions are just all internal, we don't use those anymore. SetNWInt and SetNetworkedInt are also the same, they are just aliases. The SetNetworked* are deprecated though, and you should use SetNW* functions.
So that leaves SetNW* and DTVars. Currently, the SetNW* functions are kind of finicky with the latest update. Previously SetNW* functions were very inefficient, and DTVars were definitely the best bet, but the latest update has put SetNW* function on the same level as DTVars performance-wise. Once the bugs get ironed out, then it is probably just a matter of preference. You aren't going to go wrong with either if you do it right.
[sp]Await the impending plug for Acecool_Network_System; addon[/sp]
As mentioned above, NetworkVar is a wrapper function for DTVar. All it does is it adds Set/Get functions to the entity, which call Set/GetDTVar.
SetNetworked(Int) are exactly the same functions as SetNW(Int), you should use the latter ( SetNW(Int) ) because they are shorter.
Sorry, you need to Log In to post a reply to this thread.