Actors Checking Tables
VoltzStudios
Member Posts: 38
I still can't figure this out...
I have a Level Selector Scene where a user can select their level, but I only want them to be able to select the next level if the previous level was completed.
I am trying to use tables, but I can't find a rule or behavior that checks with a table value before moving to the next level.
Any help?
I have a Level Selector Scene where a user can select their level, but I only want them to be able to select the next level if the previous level was completed.
I am trying to use tables, but I can't find a rule or behavior that checks with a table value before moving to the next level.
Any help?
Comments
I would throw together a demo, but I am on the road. If you still need help in a few days I'll put something together.
Thanks.
When Self.Level is lessthan or equal to (select this from the drop down list in the expression editor) TableCellValue(yourtable,1,1). Replace "yourtable" with your table, selected from the attribute list. Then specify the row and column where the value is stored.
When I test it, I can't click on the first level (The table value is 1 and the self.LEVEL is also 1, both integers)
I think that's right. Take a look, tell me if you need more. Thanks.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Maybe there is a simpler way to do things. I just started with GameSalad and it's all new to me.
The only other thing I can think is it has something to do with the main character actor. I will try to get a screenshot of that up if you could take a look at that for me.
This is for the main character actor (What you move around in each level). Right now, when it touches the Finish actor, it should change the table value, and switch to the Win scene that says "Level Complete!"
I think the above is correct, but it doesn't seem to be working.
I suggested using a table cell because I've been using tables to store all my miscallaneous game data. I think it makes things smoother when you don't have to save/load attributes every time the game is opened.
@VoltzStudios
I'm away on a buisness trip right now, but I'll be back at my computer tomorrow. If you're still having this issue I'll throw together a project that does what you're trying to do. Looking at your code, I have no idea what's wrong.
And in reply to @tatiang, I was just reading that storing information in tables is highly suggested because it keeps all of the game data in a central location. I'm sure there are other ways to do things, but I am going to stick to tables unless there is truly a simpler way to do things.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
It was really my fault. In the actor, I had TableCellValue instead of tableCellValue... Apparently capitalization matters. Oh well, I got it working now.
Thank you to both of you!
You definitely helped me though; I would have almost never figured out the whole tableCellValue(table,1,1) thing in the first place. But now I am complete done with the level selectors all thanks to you, and 2/3 done with the levels themselves.
Thanks again!