Rule suddenly not working (change attribute/ change image)

nati22nati22 Member Posts: 11
edited May 2016 in Working with GS (PC)

Hi there,

I have a character, whose features (eyecolor, lips, etc.) colors can be changed. Each feature is a separate actor. Here is how I did it:

I made a text attribute named as each actor (eyecolor, lips,etc.).

I have icons for the colors, these icons have the following rule:

if touched, change game.attribute to color

then, the actors rule is:

when game.attribute is color, change image to ..

So far these worked perfectly with the first 5 actors.

Now, as I wanted to make the 6th actor, this suddenly stopped working. I have 10 colors for each actors, meaning it worked 50 times so far. Now on the 6th actor, only the first and the last color works, if I'm lucky, but most of the time either one works or none at all. I tried deleting all the rules, deleted and re-added the images, checked a billion times if I wrote everything correctly. I have no clue why it worked so far, but now it won't.

Could it be a glitch?

Thanks for any help

edit:

here are the screenshots of the codes:


Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    There´s probably something wrong with your code, but it´s impossible to help without seeing some screenshots of the rules.

    Mental Donkey Games
    Website - Facebook - Twitter

  • KevinCrossKevinCross London, UKMember Posts: 1,894

    Keep in mind that there's a bug where you can't have spaces in your image name when using the expression window for Change Atrribute: self.Image so check to see if that's your problem with the new changes you've made

  • nati22nati22 Member Posts: 11

    @MentalDonkeyGames said:
    There´s probably something wrong with your code, but it´s impossible to help without seeing some screenshots of the rules.

    Thanks, I added two screenshots

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited May 2016

    Looked at your screenshots and can see you're using the Change Image behaviour instead of Change Attribute: self.Image so the space in files names isn't a problem and can see you're using underscores in the file names.

    Have you considered using Change Attribute: self.Image you might be able to cut down the number of rules by stringing together different attributes i.e.

    Change Attribute: self.Image: "eyes_"..game.eyeSize.."_"..game.eyeStyle.."_"..game.eyeColour

    Your image name might look like this:

    eyes_large_natural_green.png

    Edit: You could do away with half a dozen rules with just one behaviour. I have no idea on all the options and colours you have but might be something worth considering.

    I had to amend my code above by slashes in front of the underscores as they disappear when put between quotes. If you transferred it to GameSalad you would need to remove the slashes before the underscores

  • nati22nati22 Member Posts: 11

    @KevinCross said:
    Looked at your screenshots and can see you're using the Change Image behaviour instead of Change Attribute: self.Image so the space in files names isn't a problem and can see you're using underscores in the file names.

    Have you considered using Change Attribute: self.Image you might be able to cut down the number of rules by stringing together different attributes i.e.

    Change Attribute: self.Image: "eyes_"..game.eyeSize.."_"..game.eyeStyle.."_"..game.eyeColour

    Your image name might look like this:

    eyes_large_natural_green.png

    Edit: You could do away with half a dozen rules with just one behaviour. I have no idea on all the options and colours you have but might be something worth considering.

    I had to amend my code above by slashes in front of the underscores as they disappear when put between quotes. If you transferred it to GameSalad you would need to remove the slashes before the underscores

    I tried the change attribute behaviour instead of the change image one, but it's still the same. First time it works, I add the second color, and it's not working.

    Changing the color is the only option I have.

  • IceboxIcebox Member Posts: 1,485

    Turn all the other rules off and try this one only , if it works , turn 2 rules on , if it works turn 3 rules on , until it fails to work. Then check which rule is contradicting or causing this issue. You can also try adding a timer to the change scene behavior after 0.1 second or 0.005 seconds ( it might work ).

Sign In or Register to comment.