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

Text entry name rule #623

Closed
Yaksinikos opened this issue Sep 8, 2018 · 6 comments
Closed

Text entry name rule #623

Yaksinikos opened this issue Sep 8, 2018 · 6 comments

Comments

@Yaksinikos
Copy link

Describe the bug

I've created a "Text" that will display the player a "global-variable string",
what is controlled by a "Text-entry".

As I got "Text-entry" are not allowed to be something with "-" minus-sign in its name.

If I name my "Text-entry": "NewGameNameInput", all my events take place and work flawless.

But as soon as I replace the "Text-Entry" to "NewGame-nameinp" or "NewGame-nameinput" the global variable do catch the text but can not store it, so that the "Text" does not display anything.
I've copied my project and renamed all my events multiple times. Looks like its important.

To make it more easy to understand, here is the wiki-entry about "Text-entries": http://wiki.compilgames.net/doku.php/gdevelop5/objects/text_entry#text_entry_object
Looks like using "-" in names should work regular.

To Reproduce

Steps to reproduce the behavior:

  1. Create two text-entries, one "NameName" and "name-name".
  2. Create two text-objects that will display the text using separate global variables.
  3. Create events that send the keyboard entries from the above create text-entries to Text-Obejcts.
  4. Test both & see that the events of text-entry "name-name" will not display any string.
  5. See error

Other details

GDevelop Version: GD 5 Beta 51
OS: Linux

By the way

It is possible to not create a new line on pressing "Return" in text-entry objects?
I just need a one-line-text-entry.

@4ian
Copy link
Owner

4ian commented Sep 9, 2018

Mmm, this looks like an issue with ObjectNaming. dash (-) should not be allowed in object names - only alphanumerical characters (0-9, a-z/A-Z) and underscore (_) (FYI, this is to preserve compatibility and mimic the situation of most programming languages where identifiers/variable names can't contain a dash, making easier to transpile events).

Is there any issue if you avoid using dash at all?

@zatsme
Copy link
Contributor

zatsme commented Sep 9, 2018

If hyphens are not allowed then the wiki needs changing as the example has hyphens 🤔

@4ian
Copy link
Owner

4ian commented Sep 9, 2018

Indeed, I've not seen that there was a mistake there. I've fixed the wiki :)

@Yaksinikos
Copy link
Author

Yaksinikos commented Sep 10, 2018

Is there any issue if you avoid using dash at all?

No, without dash it works perfecto. 😸

@4ian
Copy link
Owner

4ian commented Sep 10, 2018

Sweet! Will double check the error message that should be displayed in case you use a forbidden character :)

@4ian
Copy link
Owner

4ian commented Sep 10, 2018

This is fixed for next version, an explanation will be displayed in case you try to use invalid characters :)

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

3 participants