[Solved] Change image by using attribute

GamepencilerGamepenciler Artist/Game DeveloperMember, PRO Posts: 326
edited September 2015 in Working with GS (Mac)

Hello,
I want to change the image by using attribute but I can't make it work.
I'm trying to do this:

self.image = imagename..game.attribute(int)..".png"

I wanted the last name of the file to be an attribute but It doesn't seem to work, anybody have done this to correct this line of code?

Artist/Game Developer / Animator at your service..

Comments

  • kobayaashikobayaashi Member, PRO Posts: 143

    Hi @Thorhammer - is this any good for you? The top value, where the game.image attribute value references the values in the table, includes a random value only for my own amusement, to see whether that would work...

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2015

    @Thorhammer said:
    Hello,
    I want to change the image by using attribute but I can't make it work.
    I'm trying to do this:

    self.image = imagename..game.attribute(int)..".png"

    Place quotes around the name of the file, no need to include the extension (.png).

    So . . . change this:

    imagename..game.attribute..".png"

    . . . to this . .

    "imagename"..game.attribute

  • kobayaashikobayaashi Member, PRO Posts: 143

    What @Socks said! :smile:

  • GamepencilerGamepenciler Artist/Game Developer Member, PRO Posts: 326

    oh i made it wrong now it's working thanks @Socks !

    Artist/Game Developer / Animator at your service..

Sign In or Register to comment.