lionz's Forum Posts

  • Ya, what that guy said.

  • It is :

    array contains data

    text box relates to each line of the array with an instance variable, so 0= position 0, 1 = position 1 etc

    array dynamically updating with whatever is in the text box for that position

    then on save : save current array in json format to local storage

    on load : load array in json format from local storage

    Because all data is stored in an array, you don't need to also store data as global variable. I link a text input object to a specific location in the array with an instance variable. My thought process was first to avoid global variables because you have to save and load them individually. Using an array is nice and powerful for this. Next step is to allow you up to update array data and I did this with an instance variable acting as position for the array.

  • That sounds reasonable, I just don't like too many objects! )

  • Someone has kindly posted it later on in the thread : dropbox.com/s/e3w1b3bt7skrj6d/lunarray.litetween.C2.zip

  • You should use one object with 26 animations which are the letters named after the letter, and trigger anything you want that way. You could even use 26 frames of one animation but I would definitely just make this one object only. It's not clear to me what functionality you are trying to do here, prompt a letter when a letter is clicked, but whatever it is, it'll be much easier with one sprite.

  • There is a 'loop' option in the animations editor, did you use this?

  • ahh ok it's ant#4434 :)

  • Yeah I got confused there about what you wanted, try this : dropbox.com/s/q0v4pidsjpvqdya/imput2.capx

    To clarify my method there is the instance variable on the text input object is the line in the array. If arraypos=0 it is 0 in the array.

  • Change 'on 1 pressed' to 'on start of layout' so it does the load on start of layout instead.

  • Also I fixed the other logic, it's one event now. There is no need to use global variables or multiple objects. I use a method of instance variables to track array position, have a look :

    dropbox.com/s/uff9hdnf7trftwo/imput.capx

  • email supporticl@construct.net with the file, they might be able to help fix the error. It is probably something quite normal from the look of it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You really need to understand where the data is coming from before you can attempt that. Look at the array in debug view. The question and answers are one string and he pulls the info out using 'tokenat' which uses a divider between text such as a comma to differentiate one word to the next. Once you know exactly what is going on, I would do it by putting the stats in a separate file but the same order. In an identical way you can pull the data from it but the stats would be in a different array location, so where the question and answer is in Y=0, the stats are at Y=1. Then you can easily apply the same tokenat logic so if you select answer 4, then you can read stat 4 and apply it. Once you know what you're doing it is just one event to do everything, it's just about understanding the arrays.

  • He is grabbing all the question and answer data from a text file and storing each question with the answers in one cell for each question. Then he picks a random question. Answers are always in the same order though. He has 4 answers and 1 which is to detect the correct answer.

    Where the actions are for correct or incorrect, replace the text with add or subtract from a global variable. If it is different for each question you would have to add that logic into the text file with the answers and output it so if it said "Health" then it knows if you get a question wrong it would subtract from health, so create new logic in a sense, so you would need to understand what he's doing with arrays.

  • This post is so generic and vague, I'm not sure you asked a proper question?