Out of local registers when trying to allocate ... : exceeded limit 200 - is converting local variables into dictionaries can cause lags?

I received this problem when I run into 201 local variables. My question is simple - does converting all this variables into dictionaries will cause lags?
Example:

local variable1 = 1
local variable2 = 2
local variable3 = 3
local variable4 = 4
local variable5 = 5

into

local variables = {
	variable1 = 1,
	variable2 = 2,
	variable3 = 3,
	variable4 = 4,
	variable5 = 5,
}

I dont think it should cause you lags, storing variables in tables( arrays/dictionaries) is really useful and great way to save multiple variables .

I never experienced any lag when doing so.

How did you manage to have 200 variables? thats alot …

I honestly have no idea how you managed to have over 200 variables at any given time in a script. I think it suggests you don’t have an effective data management system in place that should include the use of tables and modules.

1 Like