tarek2's Forum Posts

  • I did what you mentioned and i am able to get the data in the text box, any idea what the issue could be ?

    If it works then the Array should work swell on that layout as on a new layout + New Event-sheet it shouldn't be anything interfering with the Array.

    You can test loading the Array on that layout and if it fails press F12 to check the console logs and see if there is any error as it most probably could be a bug.

    Also, you can validate if the data is a valid Array JSON by printing it on the textbox as you did then copy the data and open a new empty project and add an Array and try to load the Array directly from that JSON string without using any Local storage and see if it works.

  • At first, I was gonna replay the same thing as Fedca as you dont use the "On Item Set" or "Wait for previous actions" when you save at the end of the layout but your picture shows that the Local storage has the Array Json saved so that's why I thought could be something else.

    You can do a quick test since the Local storage has the data:

    1-Create an empty Layout + Attach a new empty Event-Sheet

    2-Add a text box

    3-Add these events:

    4-Preview directly into that new layout

    See if it will print the data from the local storage into the text box

    If it prints the Data then the problem must be something else, if not then it could be the data corrupted, delete the key and save it again using the methods I mention above.

  • Right-click on the Array and choose "Find all references" to check if there is another event changing the values of the Array.

  • Im not sure I understood all the questions as your translator didn't translate all the sentences properly but from what I understood you just need to add tracks to one list either by (File Chooser or Add button) and also make the buttons work for (Next & Previous Track)

    another question can we compose the two file chooser the scent one should add the uploaded track to the first file chooser(URL) realized

    As I tried explained in my first post you cannot add URLs to the file chooser unless you click the button and choose the new files but it will delete all the previous file names and URLs, though you are thinking the wrong way as you can do the same thing in many different ways without using the file chooser to save the list of tracks, basically, the file chooser think of it as is just for adding tracks that's it, so to keep track of all the songs you use different plugins.

    Here is an example, I use instead (Plugin List & Dictionary)

    https://www.dropbox.com/s/q28k88nl1odpjsh/Track%20List.capx?dl=0

    You can add as many File Choosers as you like as you just keep using the same (List & Dictionary). If you add more file choosers you can just put all of them in a Family so you can use just one event to keep track of all of them.

  • 1-For the "News Sprite Movement" you can just add the Drag & Drop Behaviour

    2-And for checking if the News are (Fake or True) on Mouse clicked then you can just add an instance variable to the sprite

    Example:

    Variable = "News_State"

    Then on news created just set that variable "News_State" = (True or False)

    Then add the events as follow:

    On Mouse click News:

    Sub: "News_State" = True ------------------> Your Actions

    Else: is fake then >>>>>> Your actions (Replace the clicked News or Spawn another News)

  • Looks beautiful and the art looks very cute, congrats and good luck!

  • Dont use the "File Chooser" internal FileName List as each time you upload new files it will reset as you discovered, this is so you can always keep track of the last names of files that you uploaded, it is not meant to keep track of all the previous files that you uploaded. So Instead you can use the "List" Plugin to keep track of all the file names as you can keep adding file names to it, you can use one "List plugin" for all the file choosers or you can create each File Chooser with its own "List Plugin" if you need to.

  • > So what are you trying to do in the textboxes?

    This code should be clearer

    https://www.sendspace.com/file/3550lc

    The first thing I would like to understand is why when writing the letter "p" in the input text there is the word potatoes and not pear, I wish there was pear because putting the words in alphabetical order it comes first

    The problem is that you loop and add each matching value that it finds to "InputTestuale" textbox, that's why you see potatoes as you never stop the loop when it finds the value "Pears" first and because Patataos is the last word that it finds then it will be the one that last shows on the Textbox.

    You can avoid this by for example just adding a boolean to know when the first match value is found and added to the textbox so you dont add any more values after that.

    Here is an example:

    https://www.dropbox.com/s/gp9xg1sjgxdjtzr/fruits%20text2.c3p?dl=0

    Note:

    1-The wait for previous actions only works with actions that take longer than a tick to complete, you will see the timer next to them at the Right, so you dont really need it here.

    2-Remember to sort your Array before you start the Search Loop

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

    Honestly, your questions are getting very weird you know that?

    How can I know what you did in your project? I don't know and honestly, I don't have the time for debugging your project.

    I gave you already two working versions and I just tested them again they seem to work without any bugs so whatever problems you having is on your side.

    You have 3 choices:

    1-(Copy & Paste) my exact code in your project and use that as it works 100%, I'm thinking why you didn't do that?

    2-Start Debugging your project as you do with any other game, I don't think it will take you long to find out what's wrong though. Again I'm thinking why you didn't do that?

    https://www.construct.net/en/make-games/manuals/construct-3/interface/debugger

    https://www.construct.net/en/tutorials/checking-for-errors-in-browsers-5

    3-Leave this project, as it looks, is too difficult for you and do some C3 tutorials to start learning the basics when you think you improved your skills come back to this project and you will see how easy was to solve if you just use the "Debugger" + some basic skills.

    I say this because if you have to come back with every little error you have then not sure how you gonna finish any small Game.

    I strongly recommend Option 2 but for this, you need to take the time and debug as you will learn from that also for your future projects. The problem I see is you are always in a hurry and that there is always a deadline to showcase the example etc... so that's why you don't take the time to study the examples or debug your own code so this is a big problem as Game dev needs time and focus.

    I think I helped you already with your main issue so for me, I'm gonna have to end here as I don't have time even for my own projects so I will pass it to anyone else who wants to give it a try, though I wouldn't recommend it as it looks like you are not willing to put effort to learn, sorry I have to tell you the truth, normally I wouldn't mind keeping going the back and forward as long as it takes but on this thread, I'm really scratching my head where are we going with this.

    Also, there is option 4 that just came to my mind:

    I'm pretty sure you can find it on Fiver or any other Services like that, someone that you can pay small money to so it can guide you and answer any questions you will have, like a personal coacher (24/7).

    And think this is the option that you are looking for as here on the forum I will be surprised if anyone will have the time for that when it could work on his own projects.

    I hope you don't take this too personal.

  • 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).

    That's correct

    You are making progress but you're still missing the most important which is the thing that confused you as you try to copy my code exactly.

    This line of code is your issue as you still didn't understand the concept:

    Because my "seq2" starts empty = ""

    So repeat 4 times:

    First Loopindex:

    And I add the First number to "seq2" -------- Example = 2

    So to set the New Value in the Array Sequence I need the last number Added in "seq2" that's why I use -------------- int(right(Seq2,1))

    This will Pick = 2

    So we set the New Value at index = (2) -1 to match the Array index as it starts (from = 0) as you found out

    ===========================================

    Second Loopindex:

    And I add the second number to "seq2" -------- Example = 1

    So to set the New Value in the Array Sequence I need the last number Added in "seq2" that's why I use -------------- int(right(Seq2,1))

    This will Pick = 1

    So we set the New Value at index = (1) -1 to match the Array index again

    ====================================================================

    Third Loopindex:

    And I add the third number to "seq2" -------- Example = 4

    So to set the New Value in the Array Sequence I need the last number Added in "seq2" that's why I use -------------- int(right(Seq2,1))

    This will Pick = 4

    So we set the New Value at index = (4) -1 to match the Array index again

    =================================================

    Four Loopindex:

    And I add the Fourth number to "seq2" -------- Example = 3

    So to set the New Value in the Array Sequence I need the last number Added in "seq2" that's why I use -------------- int(right(Seq2,1))

    This will Pick = 3

    So we set the New Value at index = (3) -1 to match the Array index again

    =================================================================

    So far we have the Sequence modifier = 2143

    Now, where is your problem that I want you to find out?

    If you look closely you cannot use my code:

    int(right(Seq2,1))

    Because you already have the full Number = "2143" created Right?

    So instead you need to loop from the first number to the last one in order, the same way I did but with your own code, that's the only thing you need.

    I create the number on the fly and I pick on each loopindex the last number added but you already have your full number created so you should just loop through your "seq2" number to pick one by one in order.

    2

    1

    4

    3

    the same logic goes for (seq1/seq2/seq3)

    So in truth, the concept was just to loop through the Sequence number in order that's all, the only difference is I add the number and pick the last number and you will loop through yours without picking the last number and instead just do it by index order.

    ===========================================================

    So finally you shouldn't use:

    int(right(Seq2,1)) -1

    Should use something like:

    mid(sq1, loopindex, 1) -1

    Or pick the code you are more comfortable with as they are many ways you could do it.

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

    I don't want to be rude but I have to tell you this to help you:

    Your problem is that you not studying the example they give you that's why most of your threads get (3+ Pages) unnecessary. But I thought that by warning you on my first comment

    "I don't have much time to spend on this so I hope I get it right."

    I will make you try harder to try studying the examples but I see that it didn't work so let me try now differently:

    Lets us analyze what's going on here, how is possible that you need to study only two lines of code to understand what you need to do and still can't figure it out?

    The problem is that you spect users to give you exactly the example that will sync perfectly with your already started project which is impossible as we cannot see it so there's no way that anyone can get it right that way, so automatically your approach it's wrong. The examples they give you are for study and understand them and then you will be able to create your own version or integrate them into any projects easily.

    1-First Part: Starting Number:

    You said that you have your code already so you don't need to study that

    2-Sequence changers:

    You have 3 but in truth is the same code repeated three times so you need to just study and understand one of them to understand what going on.

    Lets Pick Sequence: 2

    You said that you already have your sequences done with your own code (seq1/seq2/seq3) so you don't need that either, then what is left?

    How the new sequence is generated right?

    That's just one line of code

    So if you think logically you need to ask what I'm doing in that line of code?

    I'm just looping through the numbers inside the variables

    "seq2"

    &

    "New_Results"

    At the same time and in index order to shuffle the positions of the numbers so you get the new Result at the end inside the "Array New_Sequence"

    Now if you look closely I'm creating the number "seq2" on the fly so my code will be different than yours as I'm targetting the last number added in "seq2" but your code has already all numbers created so what do you think you need to do? definitely, you cannot target the last number like me as your numbers are added already in your "seq2" so it will give you 4 times the last same number on your "seq2"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tarek2

    I can't understand one thing: in your script, you use 3 variables (Sequence1/Sequence2/Sequence3) and you store the corresponding Array values in these variables. However, I can't find it in the script when you use these variables.

    I think that in this case, I would just change the name of these variables by my variables (seq1/seq2/seq3),

    Because I update the "Sequence1" & the new Results at the same time, that's why I didn't need to reference that variable on that same tick, it was there for you just in case you need to reference it in your events to make it easier for you.

    It looks like the more I tried to make it easier for you including visual debugging the more it confused you so I removed all the things that weren't needed and:

    -Renamed the variables to your (seq1/seq2/seq3) names

    -I referenced your (seq1/seq2/seq3) variables to create the New result number

    So now you should have no problem, just take time to study the code as it's very easy to figure out what's going on so you can update your events.

    https://www.dropbox.com/s/rd4k2a0m7q4l86o/2-Sequence%20Numbers.c3p?dl=0

    Good luck

  • Hi tarek2

    Right in the bull's eye! That's exactly it. Thank you very much!!!!

    Np, glad it was helphul

    The only issue is that in the example the sequences are drawn, but in my case, I already have these values ​​allocated to variables (seq1/seq2/seq3). It is possible to change the script to use these values ​​instead of drawing them, right?

    The drawing sprites it is just for debugging, I tried to explain in my last comment:

    Also, you can remove the sprite events you don't need them they are just for visual.

    You can remove those events

    And Yes for the (seq1/seq2/seq3) you already have them in the Global variables the same as yours, you just have to rename them or copy the results into your variables:

    For example to save Sequence1 look at the (Event 12) (Action 2)

    And the result for that sequence after we modify the value Number is saved into Global "Sequence1_Results"

    The same goes for the other 2 sequences, they are all named exactly matching what they do so it should be no problem to identify them, or at least if I understood you correctly.

    The best thing is to open it on Debug mode as you will see the visually debug sprites on the screen then look at the Global Variables values on the Debugger and you should be able to identify what each variable does and then do your modifications.

    Note:

    Just remember to reset all the Global var whenever you start a new game session.

  • Is this what you need?

    https://www.dropbox.com/s/f58gszxn2ey79mz/1-Sequence%20Numbers.c3p?dl=0

    I don't have much time to spend on this so I hope I get it right.

    I created many Global Variables so you can debug and follow easily but you can change them as your like.

    The final number that you need you will find it on the Global Number "Final_Number"

    Is a string Number so you may have to convert it to an integer if you need to

    On Preview "For each sequence number" you will find the results next to it on the Right

    For example:

    Here the starting Number is "2310"

    And the Final Number after all the sequences are done is "1203"

    Also, you can remove the sprite events you don't need them they are just for visual.

  • 1-Your Array JSON Data includes extra symbols at the end of the Name "Values" that's why does not match the name that you are trying to spawn on the "LoadImage" Variable

    LoadImage Value ="beaucoup"

    Arra Value= "beaucoup\n"

    Remove the "\n" at the end of the values and it should work

    2-Also your second issue is the layer where your spawn the image "Back" you have it invisible by default so you not gonna see the image spawned unless you set it to Visible