Table "Change Table Value" problem/Changing which actor you control.

autonomousautonomous Member Posts: 3

I'm trying to set up a game where you can control multiple actors by clicking on them to switch it to the one being controlled with move to mouse position rules. I have it setup to change the controlled actor to a random int and then save the clicked on actors name to a one cell table. When it's time to move the actor one of the conditions is self.name is tablecellvalue(Current actor, 1, 1) so only the selected actor moves.

The problem I am having is the table cell value is not updating. I used display text command to do debug testing and figured that much out. If anyone has can see what I'm doing wrong or has a better way to switch between which actor is controlled let me know.

Full size images if it's hard to read
http://s26.postimg.org/at9wwaiif/Gs1.jpg
http://s26.postimg.org/xw0fvgjzr/Gs2.jpg

Comments

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

    I wouldn't use a table for this. A single text attribute should do the trick.

    The only thing I see that might be a problem in your table behavior is that you would have to have set the table column to type "text" for the comparison to work since self.Name is a text attribute. If you are comparing self.Name to an Integer, it may not work right.

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

  • autonomousautonomous Member Posts: 3

    That might be the way to go. But I do want to work out how I'm using the "change table value" command wrong. The table is set to text. I'm uploading the project as a .rar if anyone is willing to take a look and tell me what I am doing wrong I would appreciate it.
    https://drive.google.com/file/d/0B2r2imdj77pSa1Z6MTMtNHFoN2M/view?usp=sharing

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

    A couple points about your Display Text behavior in the Temp button actor:

    1. No need to wrap it inside an every 0 seconds timer. Display Text behaviors constrain (constantly update) their expressions.
    2. You have to select the table name from the Attribute Browser... you can't just type it in. You also have to fix that in your Person actor's Move to Mouse rule. Then it should all work.

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

  • autonomousautonomous Member Posts: 3

    Thank you so much pointer number 2 solved the problem.

Sign In or Register to comment.