lincolnsalles's Recent Forum Activity

  • You can start with a system 'for loop' to run through each row so from 0 to array.width. Then within that loop you compare X,Y of the array using array conditions, where X is loopindex and Y is 1. Then again add a sub event using array conditions to compare current value if = 51, then you can stop loop and grab the value from array.at(loopindex,0) which is the other column. Note that I'm talking in terms of (x,y) your post seems to describe the array in terms of (y,x)

    I understand the logic you're talking about, but some things are new to me, like this for each loop that I hardly used, and the array expressions, which, as much as I read the manual, it's just in practice. Could you describe the logical step by step? I'm trying to implement but I don't know how to do certain parts, even though you explained it well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In the array below, I want to look for a certain value only in column Y1, I don't want it to look for that value in the entire array. Let's say I want the value 51, it's at (1,4) and also at (2,4) and still at (3,4). So I want the program to look only in column Y1. And when it finds the value, which in this case as an example I want the number 51, in the column that I want to be Y1, which is in (1,4), I want it to return the value of the y column on the side , that is y-1, that is, in this case it would be (0,4) or (1-1,4).

    If anyone can help me I would be grateful, thanks.

    Tagged:

  • Thanks a lot, you saved me. I'm going to use Local Storage on data missing to check if there are any saves, if not, I load them from the original json. Thank you very much, you helped me a lot.

  • hmm, thanks, I'll try that. But anyway I'm going to have to save this array when I exit the game, so would it be more productive if I always save in jason and reload in the array, or just at the end of the level save all changes in jason and then in local storage? But anyway I thank you, I think you already solved the question, thanks.

  • You do not have permission to view this post

  • Note that you must leave the animation speed at 0 (inside the animation editor).

    The example file is also attached.

    https://drive.google.com/file/d/10QBXo0lUKxun404SFW7bGD6QBMEw2kOw/view?usp=share_link

  • Hello, thanks for the replies. I think I found the problem, but I don't know how to solve it. I forgot to mention that this array I included using json. So every time I change something in this array, when I enter another layout, it reloads the original json data into the array. So I believe that when I change something in the array, I need to save it in the json first, so that when I enter another layout it will download the already changed json to the array. To do this, I think you have to use local storage, right? I will send the file.https://drive.google.com/drive/folders/1Gf0PN-ucJylsJnP9VVvtTGQzVUTnwRCx?usp=share_link

  • Yes it is an array and it is marked as global. I really don't understand why it's not holding the value when I change layout. I don't have layout start events changing array. But thanks for answering, I'm definitely missing something, because I create other examples of changing the array and when I change the layout the value always changes in any new example that I do.

    But at the same time I always create a global variable and also write the value to it. In the global variable even when I change the layout it records the value as expected, but the array does not.

  • No. I made another example to test in a new file that I created, and the same thing happens. It normally changes the matrix, but when I change the layout it returns to the value that was in the matrix. As I'm new to matrix maybe I'm missing something. I want to change the value in the array and it stays changed as long as I stay in the game. It's like a global variable, but I don't understand why it's not keeping it.

  • Summary: I can change the array value, but when I change the layout the array value returns to what it was before.

    In this code here in the photo, if I press Enter on the button option called Right : a variable called Record_keycode becomes True and the sprite font blinks for 5 seconds. At that time in another event, if I press any key on the keyboard it writes that keycode of the pressed key to a specific location in the array called Button_map at (2,54). The problem is that when I leave the menu layout and go to another layout, the array value returns to what it was before, it is not being recorded. I'm not talking about exiting the game (which I'm going to save to local storage), I'm talking about changing layouts. Then I created a test variable called Right_test and also recorded this value in it. The value was saved in the variable. I started messing with array and dictionay a little while ago and found this problem...

  • You were amazing. It's hard to believe, you gave me both examples, I saw the code, well summarized, very clear. This will help me a lot, I didn't know the expression "SRT", although it's in the documentation, there's always something there to see. It's the kind of thing I'm going to study for a few days, practicing different examples of this to better memorize. I thank you very much for donating your time to this. Thank you very much, God bless you.

  • Here's my imaginary Json I made for this example here, which is nothing more than these keys and values in the construct's own visual dictionary editor. All the keys are numbers (the keycodes) and the values are the keys.

    What I wanted was that when the player pressed any key, the corresponding key appeared in a sprite font. In fact, I already managed to do this yesterday without a variable, without a dictionary or json, just with: Keyboard.StringFromKeyCode(Keyboard.LastKeyCode)

    I didn't know that there was this expression in the keyboard object called StringFromKeyCode, I only knew the LastKeyCode, that's why I tried to do it like this. But let's assume that I had to do this by json, would you know how to look for the keycode corresponding to the last key pressed by the keyboard in that json and return the value of that key?

    {

    "c2dictionary": true,

    "data": {

    "9": "TAB",

    "13": "ENTER",

    "17": "CTRL",

    "18": "ALT",

    "32": "SPACE",

    "37": "LEFT",

    "38": "FORWARD",

    "39": "RIGHT",

    "40": "BACKWARD",

    "41": "\\",

    "45": "-",

    "48": 0,

    "49": 1,

    "50": 2,

    "51": 3,

    "52": 4,

    "53": 5,

    "54": 6,

    "55": 7,

    "56": 8,

    "57": 9,

    "61": "=",

    "65": "A",

    "66": "B",

    "67": "C",

    "68": "D",

    "69": "E",

    "70": "F",

    "71": "G",

    "72": "H",

    "73": "I",

    "74": "J",

    "75": "K",

    "76": "L",

    "77": "M",

    "78": "N",

    "79": "O",

    "80": "P",

    "81": "Q",

    "82": "R",

    "83": "S",

    "84": "T",

    "85": "U",

    "86": "V",

    "87": "W",

    "88": "X",

    "89": "Y",

    "90": "Z",

    "91": "[", "93": "]",

    "97": 1,

    "98": 2,

    "99": 3,

    "100": 4,

    "101": 5,

    "102": 6,

    "103": 7,

    "104": 8,

    "105": 9,

    "106": "*",

    "107": "+",

    "108": "L",

    "109": "-",

    "110": ",",

    "111": "/",

    "180": "´",

    "188": ",",

    "190": ".",

    "191": ";",

    "192": "'",

    "193": "/",

    "194": ".",

    "199": "Ç",

    "222": "~",

    "231": "Ç"

    }

    }

lincolnsalles's avatar

lincolnsalles

Member since 16 Aug, 2015

Twitter
lincolnsalles has 1 followers

Trophy Case

  • 9-Year Club
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies