RBuster's Forum Posts

  • Thanks a lot for the example. It is now clear what you explained earlier.

    I can then store the whole array in local storage and each time the game comes in I must populate it with the array information and then insert the new data according to the new scores, right?

  • I really can't understand things without examples. I appreciate your help so far. Thanks.

    Let's see if I can get some help from someone else.

    I tried this code:

    On function 'populateArray'
    -> Array_Score: Set value at (0, 0) to Score_Date
    -> Array_Score: Set value at (0, 1) to Score_Rights
    -> Array_Score: Set value at (0, 2) to Score_Wrongs
    -> Array_Score: Set value at (0, 3) to Score_Level
    -> Array_Score: Push front Array_Score.At(0,LoopIndex) on X axis
    -> Array_Score: Delete index 5 from X axis
    ----+ System: Repeat Array_Score.Width times
    -----> Score: Append LoopIndex+1&" - "&Array_Score.At(LoopIndex)&newline
    

    I don't understand why it doesn't display all columns of the first row of the array.

    I already tried this code too:

    On function 'populateArray'
    -> System: Set arrayData to str(Score_Date&" "&Score_Rights&" "&Score_Wrongs&" "&Score_Level)
    -> Array_Score: Push front arrayData on X axis
    -> Array_Score: Delete index 5 from X axis
    ----+ System: Repeat Array_Score.Width times
    -----> Score: Append LoopIndex+1&" - "&Array_Score.At(LoopIndex)&newline
    

    I only got the 1st line with this code but it doesn't seem very natural for me. I believe the right thing was to handle this directly from the array

    Could someone explain to me what is wrong or missing?

  • Thanks again.

    Yes, I intend to use this solution to store data. In this case, I will store the entire array in the local storage, right?

    You said I can use the array coordinates to store the information, but how can I do that? I believe that if I have 4 columns I have to use "Y" coordinate but from 0 and keep this position in the X coordinate for all the information to be at the top of the list (like this: (0,0/0,1/0,2/...). Is that right? If you

    Understanding this is the most complicated for me until now. If you could post a pseudo code here I think it would illustrate this very well.

  • Thanks.

    I have some questions:

    - I need to have 5 rows and columns corresponding to the data I want to show, right? In this case, it would be date/rights/errors/level

    - Do I need to store the array data in variables or simply pull these data from the array and display them in order whenever I show the score?

    - Should I always populate the array at the end of the game and then use local storage to store this data on the user's machine? how would the data be updated in local storage?

    - How to store array data in the local storage? Storing the data in variables first?

    The biggest question I have is how to include 4 different pieces of information (date/rights/errors/level) in the array.

    EDITED***

  • I need to display the last 5 results of a game, for which I was thinking of using the local storage for this, which includes the date, level, amount of right and wrong points, and the time in minutes referring to the duration of the game. I tried to solve this by accessing some tutorials and I saw that I will need to use an array for this, but I don't know how to include this information in it so that it is displayed on the screen and how to manage it. I don't need to sort the results for the highest amount. Just show them in play order. Could anyone help me understand how to do this?

  • Thanks for the suggestion. I will do it.

  • I need "choose" to go in the first field because the value would be the third variable. What I need is to randomly choose one of the two variables mentioned and assign the value of another variable to the chosen variable

  • Is it possible to randomly choose between two variables, the one that will receive the value of a third variable?

    I thought to use the "set value", but in the first field I can only select a variable instead of writing a command line, otherwise I could use "choose" for that.

  • Hi

    I have one more question on this same subject.

    Could I invert the values, for example, of positions 2 and 3, directly in the array or would I have to use a second array to determine the position where each of the values that I will be bringing from the first array will be stored?

  • Thank you very much!!!

  • Actually I would just like to know if there is a way to use the value of a variable as an index of an array. It would be great if you could give an example of how to do this. Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can someone please tell me why I'm not able to store the data from an array in another array using a variable as a base for the indexes? The code is below.

    Exemplifying:

    Sequence1 will store the value of the startingSymbols variable in ascending order

    Sequence2 should store the values that are in Sequence1 using the values of another variable (correct) as indexes.

    Array Sequence1: 0132 (startingSymbols)

    Variable "correct": 4231

    Array Sequence2 should have the following values: 2130

  • I did not ask you to help me to find the error on my project. I only ask you an objective question:

    "The only difference for your code, is that I'm using the "trigger once" event instead of using the "on start of layout", because this code is inside a function. Do you think this could be the problem?"

    But it's okay. No problem. You helped me a lot. So "thank you" anyway. Have a nice day/week/year. Arrivederci!

    EDITED: I found the problem. It's in your project too. The first conversion is a way of positioning the frames, doing it correctly, unlike the next two conversions.

    On this new try, the first sequence is wrong

  • Hi tarek2

    The results on my project are unstable, sometimes the first is right and the other two are wrong, other times the first and third are right and the second is wrong, despite the variables being shown at the correct value. The only difference for your code, is that I'm using the "trigger once" event instead of using the "on start of layout", because this code is inside a function. Do you think this could be the problem?

    Some screenshots:

  • Now I got it!

    Just to use the same expression I am using to loop over starting_numbers (specifically talking about the "sequence 1" commands).

    Thank you so much for your time and also for your enormous patience!