How can i update the text of one particular text without changing all of them?`

0 favourites
  • 7 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
  • Hi there, so I've been trying a lot of different things and nothing seems to work. I've been experimenting with "add child" to see if this would help but it doesn't.

    I create text box that pops up on the screen and ideally i wanted a text field to spawn with it and update the text only in that text object. What happens instead is that upon the text field spawning and "text update" being used it updates all of them.

    I know I could make lots of unique text boxes and that would be ok, but i'd really like to do it more efficiently and not have potentially dozens of unique text fields to manage spawn / destroy.. just seemed like using a single text object would be more efficient.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Both Text inputs and Text objects support having unique per-instance text. They're not special in any way, it works the same as doing something like setting a per-instance animation for Sprites: use conditions to pick specific instances, and then the actions will only affect the picked instances.

  • how would i know the UID of the instantiated object? i'm using a generic text object called "text"

    I'm trying to build a whole popup dialog system so i'm going to be making numerous conversation boxes appear and disappear. i'm not saying i'm doing it the best way but i was just going to create text field as needed and then update that text box to say whatever is needed at the time.. then destroy it when i'm done.

    maybe you're saying i should do something more like "pooling" where i have some specific boxes for dialog that i call on and dismiss somehow?

    Thanks for the feedback / help!

  • how would i know the UID of the instantiated object?

    Read its UID expression after creating it.

  • Why is text treated differently than sprites? I've done some things before and text has always lacked an "upon created" option like sprites.

    So it's not treated exactly like other objects.

    I also can't include text with family objects which again makes it tricky to work with.

    I tried this but this didn't work.. this still effected all text fields on the screen:

    this is the closest i could get too something like what you mean that upon creation it's just read the UID and hopefully distinguish it.. but it's not taking.

  • Why is text treated differently than sprites? I've done some things before and text has always lacked an "upon created" option like sprites.

    I just explained - text is treated the same as sprites, in terms of picking in the event sheet. Text does have an 'On created' trigger too, as Sprites do.

    It's difficult to comment any further without trying a real project file - that's always the best way to show what you're doing and get the right help.

  • yes i get that.. but if i put on created for a text it changes ALL the text on the screen. i can't nest an "on created" for text in an "on created" sprite.. (the background graphic)..

    I tried to do some kind of variable trigger.. like on created sprite.. set var to 1.. then have the on create

    The point is that i don't understand how i can do an on create outside of another on create situation.. i'm creating the popup sprite that then needs to have text populate on top of that..

    And i really appreciate your help Ashley, I'll keep banging away at this.. maybe i can come up with some different approach..

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