Obi554's Recent Forum Activity

  • Thanks for this,

    My list is still showing up blank however when I click on it.

    Im trying to populate it with items from Y=1 to Last item at X=0 on the array

  • Does anyone have this issue?

  • You do not have permission to view this post

  • Hi,

    Thanks so much for this!

    Yeh I was confused with the new forum. Took me a while to get used to it.

    Thanks again :)

  • Hi,

    I want to player to click on the list box and see all the items in his inventory listed from the drop-down menu. The items are currently stored inside an array, with each item's name on the Y axis at X=0.

    I've tried the 'set text' and the At expression for my array, but nothing happens when I preview the game - list box stays empty.

    Thanks for any help with this :)

    Oh - I was wondering if there is a way to set this up so that the list box automatically populates for each item in the inventory, instead of programming the entries for every single array item?

    Thanks

  • There are many ways to do it - with arrays, dictionary, CSV/XML files etc.

    Here is an example where list data is stored in string variables:

    Hi dop2000,

    I was wondering is this demo you created still available for download?

  • > Do you know how I can use the array.At expression to point the return value to a specific line on the array, say the second or third row?

    >

    1 dimensional array: Array.At(1) - returns value at element of index 1

    2 dimentional array: Array.At(1,3) - return value at element of index 1 on the X-axis and index 3 on the Y-axis

    3 dimentional array: Array.At(1,3,5) - return value at element of index 1 on the X-axis and index 3 on the Y-axis and index 5 on the Z-axis

    I highly recommend you reading manual (https://www.construct.net/pl/make-games ... onstruct-3) when you don't get something. You can find there many really useful information. At the beginning you probably should read these two parts:

    https://www.construct.net/pl/make-games ... ves/events

    https://www.construct.net/pl/make-games ... nd-guides/

    It would allow you to get better understanding how evertyhing works in Construct and prevent you from making mistakes that results from many misconceptions <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink" />

    > Also, how do I cycle through the Y axis instead of the X? Some of my buttons will cycle downwards through the array instead of across.

    >

    >

    You make the same things as in my capx but the only difference is that you change Y index instead of X index. So it would be "Set text to Array.At(0,itemNR)" if you want to cycle through elements of index 0 on X-axis.

    Wow it's working now!!

  • itemNR tells you which item is currently selected. "Set item to: (itemNR+1)<=2 ? itemNR+1 : 0" lets you go through your list. It goes like this: 0 (remember that it's the first index in the array), 1, 2... and in my example you don't have 3rd array index, so you have to return to 0 index. So the exact performance is:

    - your current itemNR=2,

    - on touched Sprite the condition is checked: (2+1)<=2; it's not true, so Construct sets itemNR value to 0.

    Take a look at Operators part here:

    https://www.scirra.com/tutorials/77/nat ... onstruct-2

    Thanks I understand it now <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    Do you know how I can use the array.At expression to point the return value to a specific line on the array, say the second or third row?

    Also, how do I cycle through the Y axis instead of the X? Some of my buttons will cycle downwards through the array instead of across.

    I'm trying to work it out myself but I keep getting incorrect expression etc....

  • Use array.At(X,Y,Z)

    If you have the names stored on x just do Array.At(variable) and every time the button is clicked, increase variable by 1. At the end just make sure that the variable loops back to 0 or stops increasing once you reach the end of the array.

    variable > array.width - 1

    Set variable to 0

    Hi,

    Would you mind explaining this please:

    variable > array.width - 1

    Set variable to 0

  • itemNR tells you which item is currently selected. "Set item to: (itemNR+1)<=2 ? itemNR+1 : 0" lets you go through your list. It goes like this: 0 (remember that it's the first index in the array), 1, 2... and in my example you don't have 3rd array index, so you have to return to 0 index. So the exact performance is:

    - your current itemNR=2,

    - on touched Sprite the condition is checked: (2+1)<=2; it's not true, so Construct sets itemNR value to 0.

    Take a look at Operators part here:

    https://www.scirra.com/tutorials/77/nat ... onstruct-2

    Ok thank you so much! I'll take a good look at this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here you have an easy way to achieve this:

    https://www.dropbox.com/s/riibqex9fb8wt ... .capx?dl=0

    Thanks,

    Would you mind explaining this code please?

    (itemNR+1)<=2 ? itemNR+1 : 0

    I know itemNR is the global variable, but I don't understand the sequence or other numbers/symbols here.

    Thank you for your help - it will assist me greatly!

  • I'm trying to work out how I display text from the 'next' cell down or across in the array when the player clicks on the 'next item' button. The array is basically storing 'available items' in a player shop, and when the player clicks on 'next item', the text above should list the next item.

Obi554's avatar

Obi554

Member since 1 Oct, 2017

None one is following Obi554 yet!

Trophy Case

  • 7-Year Club

Progress

7/44
How to earn trophies