How do I put multiple variables in text?

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
  • Hey,

    I'm making a platform game where the player must perform several actions before they complete the level. I have a trigger at the end of the level that says "You still have X trees and Y flowers to fix before you can finish!"

    X and Y are variables, and I'm having trouble using an event to set the text to include them.

    In my mind the action should read:

    "You still have "&trees" trees and "&flowers" flowers to fix"[/code:36kuzi35] however, if I try to ok this, I get an error that reads "Syntax error! The expression appears to end before here - are you missing something before it?" with the section " trees and " highlighted.
    
    Basically, I don't know what I'm missing or what I'm doing wrong here :/
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're missing the ampersands after your variables. Expression should read

    "You still have " & trees & " trees and " & flowers & " flowers to fix"[/code:1leuo1ed]
  • Ahh awesome, thanks very much! I knew it would be something ridiculously simple >.>

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