Little help with csv please

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • This is probably a basic thing just my logic is broken but I can�t figure it out. Sorry.

    I�m working on creating a catalog of my �stuff.

    I will have a �list� layout which I will generate from a database: for each item, a sprite with a thumbnail picture than item name ,like so:

    thmbn 1, item1

    thmbn 2, item 2

    thmbn n, item n

    I created a variable. When I input variable N(than click button) it creates line in the list layout:

    thmbn N (sprite is loading from csv file At(�thmbn� variable).jpg.)

    it�s all good.

    Click button again creates new list item underneath. good.

    problem:

    When I change variable and click, it displays new list item with correct thmbn.jpg. but changes thmbn.jpg of all other items already displayed.

    I tried using local variables but.. same result. How can I keep .jpg already displayed unchanged. Thank you!

    P.S. love love love Construct2!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I guess you are using load from url, so probably you are loading all jpg's into the same sprite and the same frame of the sprite like in this topic:

    load from url

  • Hey, thanks a lot for the speedy response! I did load all the jpg's in separate frames like in your example, which is great. But I still have the same problem: all the displayed list items show the last thmbn.jpg I loaded (the last frame). I know what my problem is: it's the logic. All the create thmbn happen in the same event (on different button clicks) so the all the images reset to the last one.

    I have to exclude the existing thumbnails from the loop. Or prevent the resetting by affecting only the current create of thmbn.

    Can you point me into the right direction, please? Thanks in advance!

  • If you set the frame in a subevent of the creation event, only the created instance will be affected.

    If this doesn't work you should read up on picking instances in the FAQ-thread on this forum.

    I don't know how you have your events set up, so this is all I can do without seeing your capx.

  • If you set the frame in a subevent of the creation event, only the created instance will be affected.

    What is this magic? It worked! I don't really understand how, but it did. So easy. Obviously I have a lot to learn about subevents and C2. Thanks a million!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)