0 Favourites

Is it possible to perform call() on user entered text

  • Is it possible to check entered text and then call a function depending on the wrong or right answer? Can anyone give an example?

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • In theory yes (never bothered to do it myself but the functionality is in place). You will need to retrieve the correct answer from somewhere and store it in a string, but I assume you will be loading new questions via events anyway so you will be doing it then. Once you have text variable [answer] stored do the following on text changed in textbox.

    event

    condition

    User finishes entering answer and confirms (clicks a confirm button or presses enter or something, don;t use the textbox changed text condition as it triggers every time when you type inside it)

    no actions

    sub-event -1

    condition

    textbox compare text to text stored in [answer]

    action

    call function "correct"

    sub-event -2

    condition

    else (system conditons)

    action

    call function "wrong"

  • Hi Pulstar, thanks for your answer. It is quite thought provoking. I have given up the idea for my game as it was really hurting my eyes to debug it. The project is now cancelled. It would be interesting to know how to act upon strings entered in C2 though...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
0 Favourites
[Plugin] tag text
188 25,446
RBuster's avatar
RBuster
Unread hot topic
86 26,181
Ginnita's avatar
Ginnita
Unread hot topic
118 32,901
rexrainbow's avatar
rexrainbow