How do I read a part of a text

0 favourites
  • 5 posts
From the Asset Store
OpenAI TTS
$10 USD
Text-to-Speech plugin.Allows your Construct 3 project to convert written text into spoken words
  • hey guys i need help again this time i need to read a part of a textbox. I can't use block separation with globals or anything like that. As I'm using the multiplayer object my intention is to read the room and read the name of the room but this information goes in one wave just for example... if a textbox has

    " layout 2 / room 1 - europe"

    the player only has to read the layout so I would only have to read a part of that block... and in another case on the lobby screen a textbox would read only the name of the room but the string contained everything (layout 2 / room 1 - europe) summary: I need to read a part of a large text that may have the sum of information.

    hero1 - maxhp40 - maxmp80 - power30 - house1 - layout3 - age40 ...

  • You can use the system expression tokenat(src, index, separator).

  • You can use the system expression tokenat(src, index, separator).

    Thanks can you do a example?

    Src ?

    Index is the character count?

    Separador ir the Second count value ?

    I no understand the use.

  • here's an example:

    If you set: MyString = "hero1 - maxhp40 - maxmp80 - power30 - house1 - layout3 - age40"

    Then:

    tokenat(MyString, 0, " - ") == "hero1"

    tokenat(MyString, 1, " - ") == "maxhp40"

    And so on

    Where MyString is the source; 0 or 1 is the index; " - " is the separator

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • here's an example:

    If you set: MyString = "hero1 - maxhp40 - maxmp80 - power30 - house1 - layout3 - age40"

    Then:

    tokenat(MyString, 0, " - ") == "hero1"

    tokenat(MyString, 1, " - ") == "maxhp40"

    And so on

    Where MyString is the source; 0 or 1 is the index; " - " is the separator

    I'll go try...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)