gaminslab's Forum Posts

  • if i directly set value to array and add item to list, it's working.

    and on Notepad, list.selectedtext and arra.curvalue seems same.

  • useloom.com/share/15f5a3a2ace14a4692a1610bc3815c5a

    this is my event sheet.

    so basically on start of layout, xml file saved into array and list.

    then I click the start button, compare list selectedtext and array.at(0~60). if list selectedtext = array.curvalue, stop loop, show up on text.

    but for some reason, only array 0 work properly.

    I really don't know why this is happening.

  • thanks! that's what I wanted.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sorry for my bad title.

    I'm neither a professional developer nor a fluent english speaker.

    I just want to put some 'text' into the middle of dialogue.

    for example...

    (I'm going to use .csv file to store dialogues)

    "I want Y(1~50) units of X("Water" or "Food" or "Ammunition")"

    how do I put text into 'Y' and 'X' in dialog above?

  • ok. thanks.

  • there is a sprite that has these kind of instance variables.

    instance variable1

    instance variable2

    instance variable3

    instance variable4

    instance variable5

    instance variable6

    instance variable7

    instance variable8

    instance variable9

    instance variable10

    => how do i get the values from instance variables using for loop.

    I mean these kind of function.

    On left button clicked.

    for "test" from 1 to 10.

    set TEST to sprite.variable&loopindex.

  • Thanks. Problem solved perfectly with your solution.

  • oh... ok. i'll look into it more.

  • [quote:aautvm8u]X axis indicates 'UID' of objects.

    So do you actually store UIDs in the array or do you use UID as an index for X axis?

    For example when you do Array Set At(5,0) to 99 - does it mean that UID of the 5th object's is 99, or does it mean that object with UID=5 has HP=99?

    If you use UID as X-index and don't actually store it in the array, then you can't sort it!

    If you do store UID in the array, you can swap columns 0 and 1 and sort, then swap them back.

    Here is a demo:

    dropbox.com/s/88wse8qyrr3ys ... .capx?dl=0

    For other methods, see this post:

    viewtopic.php?f=147&t=67745

    Also, why do you need this array anyway? In C2 many things you normally would do with arrays, can be done much easier without them!

    You can store all these values (HP, size etc) in instance variables. And then you can sort them any way you like using "System->For each (ordered)" and similar events.

    Thank you but I think this is not what i meant.

    For example, there is a list like this.

    X axis(UID) / Y1(HP), Y2(DISTANCE), Y3(SIZE) ...

    125 / 100,421,1024

    84 / 125,552,512

    62 / 625,126,256

    If I sort X axis in this array, it should looks like this.

    62 / 625,126,256

    84 / 125,552,512

    125 / 100,421,1024

    And I would like to these kind of array sorting.

    (Order by HP)

    125 / 100,421,1024

    84 / 125,552,512

    62 / 625,126,256

    (Order by DISTANCE)

    62 / 625,126,256

    125 / 100,421,1024

    84 / 125,552,512

    (Order by SIZE)

    62 / 625,126,256

    84 / 125,552,512

    125 / 100,421,1024

  • I have a 100 x 9 x 1 array.

    X axis indicates 'UID' of objects.

    Y axises indicate distance, HP, size, velocity, ETC...

    in X axis, 'sort X axis' event works well. but problem is Y axises.

    I want to sort X axis by values of Y axises.

    So if I click HP button list should sort by order of HP....

    Is it possible?

    or should I try something else?