remove from table
GamingtilDawn
Member Posts: 104
I have a table that spawns actors in specific locations. The actors turn red and need to be touched to turn back to normal. If they are not touched in time they are destroyed. My issue is, how can I remove the destroyed actors from being called by the table? I tried a remove row but once it removed one, the other actors stopped spawning. Also what is an easy way to verify it did remove it?
Comments
How?
That will depend on your answer to the question above.
Display Text tableCellValue(tableName,row,col)
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yeah @Two.E I think that's the problem, when the rows decrease in numbers then they no longer spawn actors.
@tatiang Im not sure how I should explain it it took me forever just to figure it out from tutorials. Is there a way to upload the file to you?
Yep, you can .zip the project file and either attach it to a post or attach it to a private message.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I took a look at the project file. It seems very complicated for something fairly straightforward. For example, you have an expression that selects a random number between 1 and 4 but you use this:
(where the table cell values in the third column are just 1, 2, 3, 4)
I probably don't understand what you're trying to do and it's a lot of code to look through to help you solve a spawning problem that I don't really get yet.
I think there's probably a much easier way to set this up. I'd start by explaining what it is you want to have happen. There may be a larger game context that changes what I'm saying but if the whole game is just clicking on actors that change color and the actors stay in the same position, there's no need to spawn anything. Or is the reason for the table that you're going to be spawning different configurations of actors and different numbers of circles on each level?
Can you describe the game a bit more (without sharing too much, of course)?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks, @tatiang
You actually said it in your last sentence. Pretty much I want it to start with the four actors, then increase each level. The main goal is to touch the actor before time runs out, if not it's destroyed and wont be part of the game anymore (until it's reset).
Okay well I still don't get the larger context. If you have a bunch of actors with positions in a table, I'd use a Loop Over Table behavior to spawn them to those positions. I guess I don't get why you need to delete them from the table at all. If you destroy an actor, it's no longer clickable.
If you had something where you wanted the actors to change color in a specific order (e.g. table row numbers), you could still do that I suppose... 1, 2, 3, 4; if 3 has been destroyed, it just won't change color.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User