Is there a fast way of... ?

Hello to GS Community,

I am working on a project where I have 102 different pictures. Depending on a randomly chosen number (e.g 25) a picture with name "25" will show up. Is there any way faster than creating 102 separate rules (if game.picture = 1...2...3...4...102) to put that in one or two rules?

I bet there is some way to save some time rather than going through this tedious way of creating 102 rules...

Thank you in advance.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    I think if you name your images the actual numbers (1, 2, 3, etc..). You could place a dummy image on screen and then use a Change Attribute to change the image to the value of the random number.

  • LumpAppsLumpApps Member Posts: 2,881
    edited August 2014

    Use either change like jamie_c says or constrain. (constrain if the image needs to be updated constantly)

    In this example the images are named car1, car2, car3, etc.

  • SocksSocks London, UK.Member Posts: 12,822
    edited August 2014

    It should be as simple as:

    Change image to game.picture

  • BonepileGamesBonepileGames Member Posts: 194
    edited August 2014

    @Socks‌

    if I have 27 pictures of 300kb average and another 102 pictures of 60kb average, will it lag when game.picture changes? I see once game.picture changes, the picture isn't changing immediately, I am not even certain under what circumstances it does.

    I have an actor PICTURE (where a picture should randomly pop up depending on game.picture (1-27)) and another actor QE (where another set of picture should randomly pop up depending on game.qe (1-102)).

  • SocksSocks London, UK.Member Posts: 12,822

    @BonepileGames said:
    Socks‌

    if I have 27 pictures of 300kb average and another 102 pictures of 60kb average, will it lag when game.picture changes?

    Will what lag ?

    @BonepileGames said: I see once game.picture changes, the picture isn't changing immediately, I am not even certain under what circumstances it does.

    I'd guess it's probably the way you have your project set up.

    @BonepileGames said:
    I have an actor PICTURE (where a picture should randomly pop up depending on game.picture (1-27)) and another actor QE (where another set of picture should randomly pop up depending on game.qe (1-102)).

    Sounds good. :smile:

  • SocksSocks London, UK.Member Posts: 12,822

    @BonepileGames said:
    Socks‌

    if I have 27 pictures of 300kb average and another 102 pictures of 60kb average, will it lag when game.picture changes?

    Will what lag ?

    @BonepileGames said: I see once game.picture changes, the picture isn't changing immediately, I am not even certain under what circumstances it does.

    I'd guess it's probably the way you have your project set up.

    @BonepileGames said:
    I have an actor PICTURE (where a picture should randomly pop up depending on game.picture (1-27)) and another actor QE (where another set of picture should randomly pop up depending on game.qe (1-102)).

    Sounds good. :smile:

Sign In or Register to comment.