x3fold's Recent Forum Activity

  • I think you need to pick a 'trueFalse' Text instance also. I think that's why everything is set to True.

    But how do you do that when you're picking actions?

  • still not able to get this to work

    I need it so that when the button is pressed the input into ansBox0 is checked against the the entry in an array, and if it is correct the it changes true/false0 to "true"

    I can do it one ansBox, true/false field at a time, but I need to be able to do it for all at the same time - its possible in every other programming language using a For loop, but I cant figure out how in C2.

    My current code is:

    but this changes all true/false fields to "true" if only one of the ansBox entry fields matches the array

  • now I have this working I'm having a similar related issue that I can't figure out.

    I have a series of text boxes that the user enters numbers into. On a button press these are compared to data in an array.

    If the input and array entry match a text field is marked "true"

    This works fine for 1 text box and 1 text field, but how do I do it if these is multiple of each?

    How can you Pick nth instance and compare at the same time??

  • Thanks guys. I had actually figured it out in the end.

    Am using the following with several instances of the same object

    System -> For "i" from 0 to 4
        System -> Pick myTextBox0 instance loopindex("i"):   myTextBox0 -> Set text to myArray.At(loopindex("i"), 0)
    [/code:1yheo6zg]
    
    Still finding my feet with C2, its difficult when you're used to hand coding stuff to then work with event and behaviors
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes I'm using separate text box objects as if I just use one then they all show them same text each time.

    Also I'm not sure if it makes a difference but its the text field object I'm using not a text box (my mistake for use of phrase)

  • Hi,

    I'm used to programming in different language and I'm giving construct a try to see if I can make prototypes quicker using it.

    I'm struggle a little bit with what should be basic stuff, but I can't figure out if theres a quick way of doing this.

    I need to pull multiple values out of an array and enter each one into a series of text boxes.

    Normally I would right something similar to this:

    for (i = 0; i < 10; i ++){
    	this.myTextBox[i] = myArray[i,0]
    }[/code:1lwa1qi6]
    
    However, when using C2 I can't see a way to access multiple text boxes at once using a for loop. Do I have to write to each one separately?
    
    [code:1lwa1qi6]
    myTextBox0: Set text to myArray.At(0,0)
    myTextBox1: Set text to myArray.At(1,0)
    myTextBox2: Set text to myArray.At(2,0)
    myTextBox3: Set text to myArray.At(3,0)
    myTextBox4: Set text to myArray.At(4,0)
    myTextBox5: Set text to myArray.At(5,0)
    myTextBox6: Set text to myArray.At(6,0)
    myTextBox7: Set text to myArray.At(7,0)
    myTextBox8: Set text to myArray.At(8,0)
    myTextBox9: Set text to myArray.At(9,0)
    [/code:1lwa1qi6]
    
    Surely I'm missing something obvious here??
  • ah yes, of course

    using TextBox.Text="" works fine

    thanks

  • sorry it was a typo above I meant ""

    currently I have

    Button On Clicked
    System -> Compare Two Values -> int(TextBox.Text) = ""
    Text -> Set text to "empty"[/code:21sy3pkg]
    
    I set the Text field up so I could see if there function was working... which it isn't
  • thanks, that worked perfectly

    one further question... is there such a thing as null values in Construct?

    I have it set that if the Textbox is equal to CorrectAnswer its correct, else its wrong, but I would like it that if nothing has been entered into the Textbox then nothing happens

    I've tried

    Int(TextBox.Text) equals " "
    Int(TextBox.Text) equals Null
    Int(TextBox.Text) equals NaN[/code:378j1uy1]
    
    So I'm guessing this isn't the way to do it in Construct
  • Yes, I already have a textbox, but I don't know how to access/compare when the button is pressed?

  • Hi,

    I'm trying to make some elearning math content.

    I need to be able to show on screen a question (eg 1 + 2), then have a input text field that the user will enter the answer into.

    Once they've entered the answer they need to click a check answer button that then marks the question right or wrong.

    Can someone point me in the right direction, I've look through the docs and the forum but can't see anything similar to this.

    Thanks

  • Hi,

    I need to add a single php require_once statement to the default index.html file that is created when publishing to html5.

    In the past when I've create website and web apps I've just been able to add the php code to a page/file and change the extension of the file from .html to .php and its all worked fine.

    Unfortunately that doesn't seem possible when using C2.

    Not sure if this is possible or if someone has a workaround/can point me in the right direction.

    Thanks

x3fold's avatar

x3fold

Member since 11 Sep, 2017

None one is following x3fold yet!

Connect with x3fold

Trophy Case

  • 7-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies