godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.04k stars 21.18k forks source link

String problem? #67376

Open Raffa064-zz opened 2 years ago

Raffa064-zz commented 2 years ago

Godot version

3.5.1.stable

System information

Android 10, 64bits

Issue description

apparently the engine crashes whenever I concatenate strings, both in print() and in a label.... even in variables!

Steps to reproduce

I don't known, bud i think that the problem is on .so files

Minimal reproduction project

No response

akien-mga commented 2 years ago

There's no information in this report to debug the issue.

We don't know what you do exactly, nor what happens exactly, nor what the errors are.

Raffa064-zz commented 2 years ago

There's no information in this report to debug the issue.

We don't know what you do exactly, nor what happens exactly, nor what the errors are.

when you try to concatenate string it crashes on execution

Raffa064-zz commented 2 years ago

There's no information in this report to debug the issue.

We don't know what you do exactly, nor what happens exactly, nor what the errors are.

when you try to use string it crashes on execution

Zireael07 commented 2 years ago

which is it? use or concatenate?

If the latter, I think it was already reported but can't find issue #

Mickeon commented 2 years ago

This is very vague. Could you record the issue happening, or attach a crash log, or share the project where this is occurring?

Raffa064-zz commented 2 years ago

Sorry, it was a mistake... I don't know if it was supposed to be like this, but I found out what is happening:

The engine is crashing when you concatenate string with some other value, like int, float, boolean, etc.

Example: var value = 64 var string = "Number: "+value //It will crash

I found that to solve it, you can do it like this:

var value = 64 var string = "Number: "+str(value) //It will work

But the biggest problem is godot itself doesn't warn you that you can't concatenate different values... If someone like me, used to Java, Javascript or other languages ​​that allow concatenating values ​​of different types, tries to use the engine, he ends up forgetting that he has this problem, since the engine doesn't say that this is not allowed...

I'm going to take advantage of the fact that I'm already writing about it and complain once again about this problem with the engine crashing when you click to go back to the editor. It is currently one of the biggest problems...

Raffa064-zz commented 2 years ago

Sorry, it was a mistake... I don't know if it was supposed to be like this, but I found out what is happening:

The engine is crashing when you concatenate string with some other value, like int, float, boolean, etc.

Example: var value = 64 var string = "Number: "+value //It will crash

I found that to solve it, you can do it like this:

var value = 64 var string = "Number: "+str(value) //It will work

But the biggest problem is godot itself doesn't warn you that you can't concatenate different values... If someone like me, used to Java, Javascript or other languages ​​that allow concatenating values ​​of different types, tries to use the engine, he ends up forgetting that he has this problem, since the engine doesn't say that this is not allowed...

I'm going to take advantage of the fact that I'm already writing about it and complain once again about this problem with the engine crashing when you click to go back to the editor. It is currently one of the biggest problems...

Mickeon commented 2 years ago

Implicit String concatenation may not be supported, but there's a lot of ways to do the same operation, in a tidier manner, as well. See https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_format_string.html.

MGilleronFJ commented 2 years ago

By "crash", you mean the game shuts down with a system error, or does the Godot editor suspends the game pointing you the line that isn't working in the script editor? If the former, that's a bug that needs to be fixed, because the latter is supposed to happen. If the latter... it works as intented.