• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua TFS 0.3.7 - Modifying a global table from inside a script?

Xikini

I whore myself out for likes
Senator
Joined
Nov 17, 2010
Messages
6,812
Solutions
582
Reaction score
5,372
Code:
-- data/lib/000-constant.lua
global_table = {
   a = {aa = 2},
   b= {},
   c = {}
}
I have the table above, and I can access the information inside the table.. but I can't modify the table from another script.
Code:
-- actions.xml
print(global_table.a.aa)
> 2
global_table.a.aa = 3
print(global_table.a.aa)
> 3
-- now I go to movements.xml
print(global_table.a.aa)
> 2
It seems to be just creating it's own local table, which overrides the table value in 000-constant..
Is there another way to edit the table value.. in 000-constant.. so it updates for all scripts?
 
Solution
This will never work in 0.3.7 because in 0.x series of TFS each interface had it's own environment (state) so you cannot share information between them. The only workaround without source edits is to use global storages or filesystem.
This will never work in 0.3.7 because in 0.x series of TFS each interface had it's own environment (state) so you cannot share information between them. The only workaround without source edits is to use global storages or filesystem.
 
Solution
This will never work in 0.3.7 because in 0.x series of TFS each interface had it's own environment (state) so you cannot share information between them. The only workaround without source edits is to use global storages or filesystem.
I figured as much from my testing, but I had hopes. :p

Looks like I'll be writing some really weird functions shortly. xD
 
Back
Top