Making a change attribute behavior depending upon a Boolean column

digitalzerodigitalzero Member, BASIC Posts: 639

I am totally not sure why I'm having trouble with this.... In my game you are able to purchase "toys" from a capsule machine... It randomizes so you may or may not get the same toy... I have a table placed because there are a lot of toys you can get... In the table there is a column that is a Boolean telling you if the toy is unlocked or not... I thought I had the code right so that it would be able to show the "new toy" actor but it's definitely not right... I have tried it two different ways and none seemed to work...

First example:

Rule:

If self.time is < 1 AND table cell value(game.TB_capsule items, game which capsule toy, 2) = 0

Change attribute self.not new to true

Rule:

if game.capsulepurchased? Is true AND if self.not new = 0

Change attribute self.coloralpha to 1

Second example:

Constrain attribute self.not new to table cell value(game.TB_capsule items, game which capsule toy, 2)

Rule:

if game.capsulepurchased? Is true AND if self.not new = 0

Change attribute self.coloralpha to 1

BASICALLY what I want is for the damn icon to appear if the capsule is new!

This is probably the best that I have ever explained ANYTHING in this forum hahahahahahahaha

Comments

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

    @digitalzero said:
    This is probably the best that I have ever explained ANYTHING in this forum

    :)

    First of all, don't use a time-based rule condition like you have in example 1 and don't constrain a table value like you have in example 2. Just use a rule that checks the table cell value for whatever value you want.

    Have you verified that game.capsulepurchased? is true and self.not new equals zero? How and when have you verified that (e.g. with Display Text, Log Debugging Statement, etc.)?

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

  • digitalzerodigitalzero Member, BASIC Posts: 639

    Not exactly sure what any of that means Hahahahahahahahahahahaha

Sign In or Register to comment.