Something is seriously wrong with my spawner!!

DrGlickertDrGlickert Member Posts: 1,135
edited November -1 in Tech Support
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???

Comments

  • simo103simo103 Member, PRO Posts: 1,331
    is the spawner 'spawning' instantly or on a timer? And how are you tracking if the total 30 is spawned (visually or with a attribute)?

    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?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    Here's a way to be sure that the player can destroy all bricks and move on:

    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.
  • simo103simo103 Member, PRO Posts: 1,331
    Also didn't want to waste a joke opportunity ... but also didn't not want to help as I know when it gets frustrating the last thing you probably want is a joke BUT since I provided my helpful thoughts first ...... ;^)

    "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!
  • DrGlickertDrGlickert Member Posts: 1,135
    @simo103 - I tried that. I HAD it on a timer at EVERY 0 seconds spawn actors... Then I went to .1, then .3, now I've got it now to about .7 seconds... Still having those issues. I'm tracking the spawner with a game.attribute. So every time something is spawned it adds +1 to the counter until it gets to 30 and then it's supposed to stop.

    @ scitunes - I will try that way now to see if it helps at all.

    @simo103 (again) - nice one. Always love jokes!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Sorry I saw this title and all I could think is "well your problem is your using a spawner". LOL

    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.
  • DrGlickertDrGlickert Member Posts: 1,135
    NOPE! That didn't work either.

    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)
  • DrGlickertDrGlickert Member Posts: 1,135
    My bad. I found some code that was effecting the bricks from "completely spawning" long story short...it was all me.

    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!
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    DrGlickert said:
    My bad. I found some code that was effecting the bricks from "completely spawning" long story short...it was all me.

    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!

    I hate how its almost always user error. I wish sometimes the GameSalad Creator would accept it is screwing up instead of proving me wrong.

    Glad you got it worked out doc.
  • FranzKellerFranzKeller Member Posts: 517
    probably not in your case, but actors can destroy if they go too far beyond screen boundaries. They just never come back
Sign In or Register to comment.