[BROKEN] SetGlobalInt and GetGlobalInt Broken after the new Garry's mod Update Patch

After the new garry’s mod patch yesterday, a lot of my addons was not working correctly that are using : GetGlobalInt, and GetNWString…

Does anyone know how to fix them? the : GetGlobalInt and SetGlobalInt/Vector…

Thank you

???

Make sure your server runs the same version of the game as your client. ( Compare print(VERSION) )

mine are working correctly, have you updated your server?

Yea just tried it. GetGlobalInt and GetGlobalEntity won’t work. Running on 152503 both server and client.

Code:



local need = 12
concommand.Add("d_set", function()
	SetGlobalInt("test2", need );
	print("SET: " .. need )
end);

concommand.Add("d_get", function(ply)
	print("GOT: " .. GetGlobalInt("test2", 0));
	print("EXPECTED: " .. need)
end);


-edit-

Apparently when I merged the two together in the same function they worked fine. Am I doing something wrong? Did anything change?



concommand.Add("d_setget", function(ply)
	SetGlobalInt("test2", need );
	print("SET: " .. need )
	print("GOT: " .. GetGlobalInt("test2", 0));
	print("EXPECTED: " .. need)
end);


I have a feeling you might be running incorrect version, are you sure you have checked the version for both server and client?

Yes, server and client are the same version (152503).

Tried your exact code, worked fine

http://puu.sh/gRpzb/3aaaf00717.png

Do you happen to use some of those “fixes” that have been passed around lately, if not eventually post a list of your addons that you use, maybe one of them fucks it up because they feel like overriding stuff is a good thing.

I have the same issue too.



] lua_run SetGlobalInt("Test", 1)
> SetGlobalInt("Test", 1)...
] lua_run print(GetGlobalInt("Test"))
> print(GetGlobalInt("Test"))...
1

(exit the console, re-open the console and print again)

] lua_run print(GetGlobalInt("Test"))
> print(GetGlobalInt("Test"))...
0


Same issue seems to exist for the rest of the global code (the string for example):



] lua_run SetGlobalString("Test", "String1")
> SetGlobalString("Test", "String1")...
] lua_run print(GetGlobalString("Test"))
> print(GetGlobalString("Test"))...
String1

(exit the console, re-open the console and print again)

] lua_run print(GetGlobalString("Test"))
> print(GetGlobalString("Test"))...



can you please report back the output of “print(GetGlobalString)” and “print(SetGlobalString)”, yes like that without quotes.

That won’t tell you anything except the pointers of the functions, which change every session as far as I am aware.

That will tell me exactly what I need to know by that, either its lua or its a external function, that should eliminate the the possibility that some script overrides them.

I’m still having this problem. I have reinstalled gmod completely, no addons, and just running sandbox.

This is what I get when I print GetGlobalString and SetGlobalString running on version 152503



function: 0x2bc10bb0
function: 0x13bf65d0


GetGlobalString and SetGlobalString work only in singleplayer not on a local scrds server or lissen server for me.

Any fixes?

Try this: Bitbucket

Drop it into addons ( there’ll be an update later in the day, most likely, to include automated data-links ) and use the commands: dev_getdata [ x ], dev_getpdata [ x ], dev_getworlddata ( same as dev_getdata 0 ) where optional x is the EntIndex-Corrected GetID. Because a lot of people are improperly using case with Get/SetGlobal, Get/SetNW, Get/SetNetworked I have made them case-insensitive so Fuel and fuel will both work.

The addon prevents any networking ( which uses the flag system; ie the functions listed above and the data / ent-meta-table variants of Get/SetFlag ) data from being sent to the client until fully connected. It rewrites all usermessage / umsg to net-messages, in addition to altering the following to use net: SendUserMessage( … ), BroadcastLua( x ), _p:SendLua( x ) with others that use user-messages being added as they’re found ( I’m planning on rewriting the entire ent/player/weapon/vehicle meta-tables to use my system soon [ for all AccessorFuncs, DT Vars, Initialization tables, SaveTable, Table, etc… ] ).

Global strings will be under [ lists ] [ globals ] or so, nw vars will be under [ lists ] [ nwvars ], etc… So this’ll let you see the data that is being set vs not being set… ( Not all of the setters / getters are over so if you’re using accessor-funcs then the data may or may not show ) but if you are calling the Setters / Getters yourself then it should show just fine )…

Always do your testing in SRCDS ( with maxplayers being more than 1 ).

_aceMod; has already began! How will JBMod cope.

Garry will check up on GMod at the end of the year and its gonna be a communist game and acecool is the dictator.