Something is seriously wrong with my spawner!!
DrGlickert
Member Posts: 1,135
So I would say that about ~60% of the time my game works just fine.
I have an invisible actor that spawns random actors (I have different colored bricks and different sizes; blue (small, medium, large), red (small, medium, large), green...etc)
So there are a total of 18 different actors that my invisible actor spawns. The spawner actor has a rule that when game.bricks = 30 to stop randomly spawning the actors.
Then, I have another rule in the scene that sets game.bricksShot to 30 and when game.bricksShot = 0 to end the scene.
EXACTLY LIKE TSHIRTBOOTH'S TUTORIAL VIDEOS...
However, SOMETIMES it doesn't spawn all 30. Let me emphasize "sometimes!" It may spawn 28, sometimes 29...Sometimes it works and spawns 30 and I have no issues.
This poses an enormous problem because then SOMETIMES the player won't be able to finish the scene...
Is this a known bug? or am I seriously doing something wrong here???
I have an invisible actor that spawns random actors (I have different colored bricks and different sizes; blue (small, medium, large), red (small, medium, large), green...etc)
So there are a total of 18 different actors that my invisible actor spawns. The spawner actor has a rule that when game.bricks = 30 to stop randomly spawning the actors.
Then, I have another rule in the scene that sets game.bricksShot to 30 and when game.bricksShot = 0 to end the scene.
EXACTLY LIKE TSHIRTBOOTH'S TUTORIAL VIDEOS...
However, SOMETIMES it doesn't spawn all 30. Let me emphasize "sometimes!" It may spawn 28, sometimes 29...Sometimes it works and spawns 30 and I have no issues.
This poses an enormous problem because then SOMETIMES the player won't be able to finish the scene...
Is this a known bug? or am I seriously doing something wrong here???
Comments
If it were me troubleshooting I would slow down the spawner with a timer so all actions where slower just to see if GS wasn't getting ahead of itself since it is so speedy. The reason I asked if you were tracking it with an attribute is because if your are visually counting is it possible some are exactly on top of each other?
Don't set game.bricks to 30. Instead put "change attribute game.bricks to game.bricks+1" in each brick actor. So if the game only spawns 28 game.bricks the level will start with a brick count at 28 and when all are destroyed game.bricks will equal 0 even though the level didn't have 30 bricks.
"Something is seriously wrong with my spawner!!" ..... my urologist tells me I need to slow down and take it easy once and a while and not to worry so much about my performance!
@ scitunes - I will try that way now to see if it helps at all.
@simo103 (again) - nice one. Always love jokes!
Scitunes suggestion is a good thing to have as a for sure they wont get stuck. I do that for any type of puzzle where collecting or destroying items are needed even when I have laid the level out and know how many are/should be there. its a good fail safe.
Somehow my bricks are disappearing... Has to be a glitch somewhere. I did it just like scitunes said, instead of having a hard counter that counts down, I now have a counter that counts up as bricks are spawned and then through gameplay that number is decreased...
Is it possible that a brick or two can disappear??? I can't think of anything that I'm doing. I've looked over all my behaviors and everything checks out just fine.
Has to be a bug?!
Anyone else? (Thanks for your help though guys)
I apologize to GameSalad for cursing your program multiple times (luckily not on the forums). You guys are great. Thank you. You will make me a millionaire soon enough!
Glad you got it worked out doc.