Changing actor's image based on other actors location
this has been mind-...ing for the last 2 days now, thought id try the forums for some help!

as you can see in the picture, i have achievements in the centre that are scrollable, and at the bottom a description of how to unlock it, what I'm asking is for a method for the text at the bottom to change to comply with the appropriate achievement that is above it.
i feel as if I've tackled the mechanics to make this work logically but it doesn't appear to be the case. this is what i did on the text actor's rules:
when:
game.current scene.layer.awards.award2.sizewidth is = to 148.
change image to:
award2.text
as the awards are half the size until they are in the centre in which they change to 148 width, so it would only trigger once they are locked in the centre. and so on for all the other awards, this does indeed work, but its VERY glitchy. it works for a little while scrolling through the awards and the text changes correctly but then it mucks up very quickly and starts to display the wrong text to the wrong award.
i tried debugging this by making all the awards display their size width and even though all the other awards were not 148, somehow it was messing up and the wrong text was very oftenly getting displayed on the wrong award.
it makes sense to me but somehow its not working. any ideas?

as you can see in the picture, i have achievements in the centre that are scrollable, and at the bottom a description of how to unlock it, what I'm asking is for a method for the text at the bottom to change to comply with the appropriate achievement that is above it.
i feel as if I've tackled the mechanics to make this work logically but it doesn't appear to be the case. this is what i did on the text actor's rules:
when:
game.current scene.layer.awards.award2.sizewidth is = to 148.
change image to:
award2.text
as the awards are half the size until they are in the centre in which they change to 148 width, so it would only trigger once they are locked in the centre. and so on for all the other awards, this does indeed work, but its VERY glitchy. it works for a little while scrolling through the awards and the text changes correctly but then it mucks up very quickly and starts to display the wrong text to the wrong award.
i tried debugging this by making all the awards display their size width and even though all the other awards were not 148, somehow it was messing up and the wrong text was very oftenly getting displayed on the wrong award.
it makes sense to me but somehow its not working. any ideas?
Best Answer
-
tatiang Posts: 11,949
I actually didn't save it. I literally changed that one condition in each rule. In the screenshot below, the original/incorrect condition is shown at the top and my correction is shown at the bottom:
Answers
when it was triggered it set a self.attribute integer value to 1, otherwise its 0. so i did the same thing as before but instead of size width = 148 it was self.attribute = 1.
but somehow its still gets the text wrong after very short use of navigating the awards
http://www.filefactory.com/file/zgfvvbz7y3n/n/1.5.gameproj.zip
It works if I remove the condition Attribute scene.level blocks.lockedbox X.Size.Width = 148 and replace it with the condition Attribute game.selected level = 1 (or 2 or 3 or...) then Change Image to [image name]. This is on the highrollertext actor.