How do I check if a line of text is displaying?

0 favourites
  • 3 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
  • I have Ajax request a text file --- trim(tokenat(Dictionary.Get("ReadData"),random(0,300),";")) --- as you can see it's randomized so any of the 301 lines could be displayed upon System Create Object Text and Text display one of these lines.

    I needed to check which line is being displayed so that I could create another event based on which line is displayed.

    Hope I made myself clear. thanks and help if you can.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure where are you going with this but you could create a temp variable that takes the random number and compare it later. Also the random function will generate decimals so you have to use int, floor or ceil to round it.

    For instance:

    Set varrandom to floor(random(0,300))

    Set whatever to trim(tokenat(Dictionary.Get("ReadData"),varrandom,";"))

    Since you've set the varrandom to a random number, you can compare this number so you can tell which line it got.

  • I'm not sure where are you going with this but you could create a temp variable that takes the random number and compare it later. Also the random function will generate decimals so you have to use int, floor or ceil to round it.

    For instance:

    Set varrandom to floor(random(0,300))

    Set whatever to trim(tokenat(Dictionary.Get("ReadData"),varrandom,";"))

    Since you've set the varrandom to a random number, you can compare this number so you can tell which line it got.

    I am making this game basically with questions and answers and instead of creating several documents, which would be excrutiating, I want to have it in one document so that when the player chooses a certain answer to a question there will be a reply to that answer, this reply has to match the answer he chose. A little consfusing but your insight will work fine for me. I am going to try it.

    Thank you a lot!!

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