Set a different text when my player find différent message

0 favourites
  • 4 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • Hi everybody.

    In my game, my player can find messages on computer. I want to make a code useful and simple.

    When my player collide with a computer, he can activate it with A button and a specific message appear. Each computer has its own message.

    So how can I do that?

    Currently, when my player collide I know how to show à text message. But not how to show thé message 1 on the computer 1. The message 2 on computer 2...

    Need your help. Thanks a lot ^^

  • If it is basic one message per object then the easiest way is to set the object instance variable (computer.variable) to the text to be displayed. Then when you collide you can say set text to ""&computer.variable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Plinkie ^^

    I made what you said and it works, but what I want to do is a bit different. I want to display a custom message called by a variable.

    1/- When my player collides with the computer, it becomes active.

    2/- If the player presses A when it's active a message appears. On the computer with variable "message"=1, the messages displayed is the 1. If he collides with computer 2, it's the message 2 which appears.

    Currently when the text field displays "1". What I would, it's displayed the message 1 "Il y à une trappe sous les arcs électriques." (sorry it's in french ^^)

    Thanks a lot for your help

  • Hmm you still have the variable as a number. If it is one message per computer then you can just have A pressed, computer is active, set text to computer.message (where message variable is "c'est vide" for example, not a number). Or are you saying a computer will use multiple messages? Are you trying to do something where it shows the message once then says a different message after that?

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