GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Changing Attributes in Loop

Is it possible to change Attributes in a Loop, similar to changing TableCellValue in Loop?

Let's say I have Attributes called Score1, Score2, Score3...Score10. And another attributes called NoOfScores.

Change Attribute : NoOfScores to 1

Loop While NoOfScore <= 10
Change Attribute : Score..NoOfScore to Some Values.
Change Attribute : NoOfScores to NoOfScores+1

Would combining two Attributes work in GS? (Score..NoOfScores = Score1?)

Comments

  • tatiangtatiang Posts: 11,766Member, Sous Chef, PRO, Senior Sous-Chef

    Yes, you can certainly change an attribute inside of a loop (try it!).

    No, you can't reference an attribute's name by using an expression (e.g. Score.._NoOfScore). That would require storing the values in a table -- one in each row --- and then increasing the row by one in a Loop over Table behavior.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • pokapolapokapola Posts: 143Member

    Thank you @tatiang!

Sign In or Register to comment.