TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
Books & Courses
FORUMS
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Chat
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Resolved Questions
→
Why does Number values from Lists turn to Objects? (ANSWERED)
Pages:
1
Why does Number values from Lists turn to Objects? (ANSWERED)
docskull
Posts: 65
January 18, 2012, 04:17:51 pm
Hello there,
I am currently getting troubled by the values of a Game attribute of the "List" type. Their default values are all numbers and set to 15.
My code do not change this Game atributte but then, when the game saves and loads again, the values are not set to 15. A print of the values returns "[object Object]"
Do anyone knows why?
Thanks in advance
« Last Edit: January 21, 2012, 05:17:13 pm by docskull »
Dom818
Posts: 1296
January 18, 2012, 04:43:22 pm
I have also ran into this problem, I would also like to know why this does this. Any ideas?
Effect Apps
Check Out Our Apps
rob1221
Posts: 9472
January 18, 2012, 07:32:41 pm
I don't know why that happens, but a workaround is to set each value of the list in a behavior.
https://twitter.com/Rob1221dev
Jon
Posts: 17529
January 18, 2012, 08:58:48 pm
You have to wrap them in 'as number' to get it working. The reason is that the lists aren't parameterized, so they can store any value. Retrieving the value will return it as the most generic type possible.
docskull
Posts: 65
January 21, 2012, 05:16:50 pm
Thanks Jon, it's all goin right now.
Pages:
1