Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predeclared String Variables are being populated as "0" when empty instead of "" #7267

Open
1 task done
Silver-Streak opened this issue Jan 2, 2025 · 0 comments
Open
1 task done

Comments

@Silver-Streak
Copy link
Collaborator

Is there an existing issue for this?

Describe the bug

Found via Jack on the forums, https://forum.gdevelop.io/t/empty-text-variable/57079/3:

If you predeclare a string variable, and set it to an empty string, the actual string is set to "0" as shown in the debugger or if called via expressions.

I went back and tested before the variable update, and this is new behavior. Previously it would default to "" when the string was empty.

If I had a guess, my bet would be that the "always force number variables to have 0 if empty" is applying to the string variables as well.

Steps to reproduce

  1. Create a global, scene, object, or instance variable.
  2. Change the type to string.
  3. Delete anything after it.
  4. Run the preview with debugger.
  5. The variable's string will be "0"
    image
    image
    Example project: StrVarBug.zip

GDevelop platform

Desktop, Web

GDevelop version

5.4.219

Platform info

OS (e.g. Windows, Linux, macOS, Android, iOS)

Windows

OS Version (e.g. Windows 10, macOS 10.15)

10 Pro

Browser(For Web) (e.g. Chrome, Firefox, Safari)

Vivaldi

Device(For Mobile) (e.g. iPhone 12, Samsung Galaxy S21)

N/A

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant