Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Moonscript and Table Serilization?

Asked by
algo160 10
10 years ago

I need to turn a Moonscript Class (so, in this case a Table) into a StringValue

Obviously, I will use JSON for Serilization (I don't need MetaTables, just the Value inside of them)

What Would my best approach to this be?

(I'm looking for a solution that would allow me to load any class from JSON - probably via constructor - and then serilize it on the fly - this shouldn't happen too often but atleast once every 8 seconds)

I'm a little confused on how I should implement this.. Ideas?

2
I'm still not sure what you're trying to do here. JSONEncode takes Tables as parameters, how does that not answer your question? I'm legitimately confused. adark 5487 — 10y
0
I have references to other tables in that table. Note the REFRENCES part. algo160 10 — 10y

1 answer

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

I'm not exactly sure what it is you're looking for, but you can use the JSONEncode and JSONDecode methods of HttpService to do as their names suggest.

1
I'm looking for a strategy on how to serililize a Moonscript Class into JSON. I don't need to know the encoding methods, but a strategy. algo160 10 — 10y
0
Since it's already a Table, can't you just pass it as an argument to JSONEncode? Or are you needing to serialze the script from an external source? adark 5487 — 10y
0
Problem is, the table contains *references* to so many other tables. I don't know what to do algo160 10 — 10y
Ad

Answer this question