Can you convert a string to a number?
ookami007
Member Posts: 581
Is there a way to convert a string to a number? Specifically an Integer?
Comments
If you are talking about changing a string of numerical characters (such as "125"), into an integer, the answer is yes.
Just use a change attribute behavior:
Change Attribute: self.myInteger To: self.myNumString
Thanks... I guess the variables are like var's in java rather than typed variables in C.
GameSalad runs on Lua if that's helpful...
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Numbers contained in strings can be used as integers. You can perform maths on them etc. Normally there's no reason to specifically convert them.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support