0 votes

hello,
I do not find the conversion of an 'Array' int ', I find for a bool, string or float but not' Array '

Thank you.

asked Nov 18, 2019 in Engine by vivid (27 points)

An int is a single value whereas an Array can contain multiple values. That does not match. You can get the length of an Array with somearray.size() or you can access a single array element by index with i.e. someint = somearray[0]

If I didn't understand you correctly then provide more details.

If you want to convert a String to an Array then you can use the split functions of the String class:
https://docs.godotengine.org/en/3.1/classes/class_string.html

You can convert to string arrays. Godot will implicitly convert the values to integer when used in contexts like calculations (but will run on an error if the value is not a number).

If you want to store/retrieve a number of different values in/from text files then it'd be best to use JSON which allows to parse an entire dictionary with arrays/values/dictionaries from a string or to encode it to a string.

Yes, i look json..

Thank you wombatstampede

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.