Gdevelop: Text entry name rule

Created on 8 Sep 2018  路  6Comments  路  Source: 4ian/GDevelop

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.

Most helpful comment

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

All 6 comments

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?

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

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

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

No, without dash it works perfecto. :smile_cat:

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KinkGD picture KinkGD  路  5Comments

Jeje2201 picture Jeje2201  路  5Comments

BWPanda picture BWPanda  路  4Comments

Wend1go picture Wend1go  路  5Comments

PascalLadalle picture PascalLadalle  路  3Comments