RBuster's Recent Forum Activity

  • 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!!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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!

  • Thanks for replying tarek2

    I took a good look at your code. I knew it was that line I should change, but I still couldn't figure out how to do that. The other two lines above I had already disabled so as not to create the sequence again. But you are right. I was waiting for something closer to what I needed because I've wasted a lot of time on this project and it's just a demonstration of what I intend to do.

    Analyzing that line you highlighted, this time in the first sequence, there is being stored in the new_sequence array, the order of the frames based on the variable seq1 and the order of the initial frames. You used (-1) to match the frame number since it starts at 0, right? Then, the value of the new_sequence array is passed to another variable (new_result). Despite knowing that I must change something in one of these expressions in that specific line, I think (for me) they are correct as they appear. Therein lies the dilemma.

    The code of this sequence it is like this:

    This is the result I am obtaining:

  • Hi tarek2

    It's me again. Sorry about that :(

    I tried to use my variables, disabling the process of generating random values through the array first, and it didn't work. After that, the system generates several numbers "1" as shown in the print of the variable "New_Result".

    As I understand it, it only works if I generate these numbers randomly, right? As I already generated the values of the 3 sequences, I already disable this action. Maybe I need to add these values into the array, right?

  • Thank you so much for your time, tarek2

    It will help me a lot.

    I'll check/study it and I'll let you know later if I have any questions.

    Many thanks

RBuster's avatar

RBuster

Early Adopter

Member since 29 Oct, 2012

Twitter
RBuster has 2 followers

Connect with RBuster

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

21/44
How to earn trophies