Boss ain't spawning on my game Zombie Survivors W.I.P
id: 750241
category: Help with Scripts
posts: 21
Mar 25, 2024 23:33:07
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
heres the game
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.
(thanks for the help!)
Mar 25, 2024 23:39:36
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
MineTurte
loading
heres the gameOh god. You again (no offense lol). Luckily I have more time this time to look at it in detail. Hold on one second while I take a look at it!
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
Mar 25, 2024 23:40:52
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
heres the gameOh god. You again (no offense lol). Luckily I have more time this time to look at it in detail. Hold on one second while I take a look at it!
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
alright, take your time!
Mar 25, 2024 23:45:31
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
MineTurte
loading
heres the gameOkay I genuinely can't find out what's wrong and everything seems to be working fine but I'll just completely rewrite your code and hope it works better. One second
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
Mar 25, 2024 23:46:31
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
heres the gameOkay I genuinely can't find out what's wrong and everything seems to be working fine but I'll just completely rewrite your code and hope it works better. One second
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
wait so does it look fine but it doesn't work or does it look fine and you verified that it works
also I changed something that was wrong I forgot to change earlier so you should probably refresh
Mar 25, 2024 23:47:29
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
MineTurte
loading
Did you just fix it because it looks exactly how I was about to make it lolheres the gameOkay I genuinely can't find out what's wrong and everything seems to be working fine but I'll just completely rewrite your code and hope it works better. One second
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
wait so does it look fine but it doesn't work or does it look fine and you verified that it works
also I changed something that was wrong I forgot to change earlier so you should probably refresh
Mar 25, 2024 23:48:45
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
Malicondi
loading
Alright, I was able to make the boss spawn naturally and I figured out the problem (it took around 3x as long as it should, I'll explain why). So, since you have all 3 different zombies resetting the timer to increase their difficulty, they get out of sync, and then only one zombie will increment at a time. For example, the electro zombie will increase difficulty by one, then the normal then the big zombie, and all of that would take ~60 seconds, much longer than it should. alright, take your time!
The solution to this is to have one zombie controlling the reset timer, and broadcasting to all the other zombies to increase difficulty, and that one zombie will also spawn the boss.
Hope this helps! fun game btw :)
Mar 25, 2024 23:56:42
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Alright, I was able to make the boss spawn naturally and I figured out the problem (it took around 3x as long as it should, I'll explain why). So, since you have all 3 different zombies resetting the timer to increase their difficulty, they get out of sync, and then only one zombie will increment at a time. For example, the electro zombie will increase difficulty by one, then the normal then the big zombie, and all of that would take ~60 seconds, much longer than it should. alright, take your time!
The solution to this is to have one zombie controlling the reset timer, and broadcasting to all the other zombies to increase difficulty, and that one zombie will also spawn the boss.
Hope this helps! fun game btw :)
Oh my god, I was thinking about fixing that but I got lazy. It's there because I copy and pasted the zombies and just changed the code from there for different types without seeing a reason to clean it like that. Didn't realize it actually would become out of sync. Cheers to you for striking this one right in the eye, my friend.
Mar 26, 2024 00:04:42
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
Malicondi
loading
Also, if you're wondering why this is case, one thing you should know is scratch runs scripts in an order, so it might do the normal zombies first, then the electro etc. This is because scratch runs the scripts in order of the layers the sprites are on, so if the normal zombie sprite is at the front layer, then all it's scripts will run first. Oh my god, I was thinking about fixing that but I got lazy. It's there because I copy and pasted the zombies and just changed the code from there for different types without seeing a reason to clean it like that. Didn't realize it actually would become out of sync. Cheers to you for striking this one right in the eye, my friend.
Also not sure if this was intentional or not, but a little nitpick I had with your game is that dead zombies will still hurt you, and you can just change the damage script to have this block:
if <(costume [number v] ::looks) = (1)> thenso that that doesn't happen. Not necessary but it think it makes it better. :D
damage scripts
end
Mar 26, 2024 00:12:48
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Did you just fix it because it looks exactly how I was about to make it lolheres the gameOkay I genuinely can't find out what's wrong and everything seems to be working fine but I'll just completely rewrite your code and hope it works better. One second
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
wait so does it look fine but it doesn't work or does it look fine and you verified that it works
also I changed something that was wrong I forgot to change earlier so you should probably refresh
and thanks for the help, I'll be relying on you for later bugs because you always seem to be active lol!
Mar 26, 2024 00:14:22
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
MineTurte
loading
Heh trust me, I am.Did you just fix it because it looks exactly how I was about to make it lolheres the gameOkay I genuinely can't find out what's wrong and everything seems to be working fine but I'll just completely rewrite your code and hope it works better. One second
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
wait so does it look fine but it doesn't work or does it look fine and you verified that it works
also I changed something that was wrong I forgot to change earlier so you should probably refresh
and thanks for the help, I'll be relying on you for later bugs because you always seem to be active lol!
Mar 26, 2024 00:16:03
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Also, if you're wondering why this is case, one thing you should know is scratch runs scripts in an order, so it might do the normal zombies first, then the electro etc. This is because scratch runs the scripts in order of the layers the sprites are on, so if the normal zombie sprite is at the front layer, then all it's scripts will run first. Oh my god, I was thinking about fixing that but I got lazy. It's there because I copy and pasted the zombies and just changed the code from there for different types without seeing a reason to clean it like that. Didn't realize it actually would become out of sync. Cheers to you for striking this one right in the eye, my friend.
Also not sure if this was intentional or not, but a little nitpick I had with your game is that dead zombies will still hurt you, and you can just change the damage script to have this block:if <(costume [number v] ::looks) = (1)> thenso that that doesn't happen. Not necessary but it think it makes it better. :D
damage scripts
end
good to know also that was the intention to have the zombie blood be poisonous lol it adds difficulty
Mar 26, 2024 00:48:22
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Also, if you're wondering why this is case, one thing you should know is scratch runs scripts in an order, so it might do the normal zombies first, then the electro etc. This is because scratch runs the scripts in order of the layers the sprites are on, so if the normal zombie sprite is at the front layer, then all it's scripts will run first. Oh my god, I was thinking about fixing that but I got lazy. It's there because I copy and pasted the zombies and just changed the code from there for different types without seeing a reason to clean it like that. Didn't realize it actually would become out of sync. Cheers to you for striking this one right in the eye, my friend.
Also not sure if this was intentional or not, but a little nitpick I had with your game is that dead zombies will still hurt you, and you can just change the damage script to have this block:if <(costume [number v] ::looks) = (1)> thenso that that doesn't happen. Not necessary but it think it makes it better. :D
damage scripts
end
okay so I attempted to add a menu screen after you die so you can just click play and play again
now the spawns are duplicated on the 2nd run and the character has became immortal.
Mar 26, 2024 01:00:18
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
Malicondi
loading
Well, that escalated quickly- okay so I attempted to add a menu screen after you die so you can just click play and play again
now the spawns are duplicated on the 2nd run and the character has became immortal.
–
To fix the immortal problem, put this script:
foreverinto a “when I receive start” hat block.
set [timer v] to (timer)
if <(health) < (1)> then // no need for both, they mean the same.
broadcast [dead v]
end
For the duplicated spawns problem, this will take a bit, sorry I would recommend to either add a delete this clone when I receive start, like this:
when I receive [start v]to every sprite that clones, to prevent the clones from also cloning, causing duplicate spawns, or you can make this block: (with a new broadcast)
repeat (1)
delete this clone
end
... // rest of scripts
when I receive [delete clones v]and use it like this:
delete this clone
when I receive [dead v]both of these scripts will solve the issue of the clones also making clones, hope this helps!
broadcast [delete clones v]
why do you have a broadcast named “baka” ;-;
Mar 26, 2024 01:14:28
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Well, that escalated quickly- okay so I attempted to add a menu screen after you die so you can just click play and play again
now the spawns are duplicated on the 2nd run and the character has became immortal.
–
To fix the immortal problem, put this script:foreverinto a “when I receive start” hat block.
set [timer v] to (timer)
if <(health) < (1)> then // no need for both, they mean the same.
broadcast [dead v]
end
For the duplicated spawns problem, this will take a bit, sorry I would recommend to either add a delete this clone when I receive start, like this:when I receive [start v]to every sprite that clones, to prevent the clones from also cloning, causing duplicate spawns, or you can make this block: (with a new broadcast)
repeat (1)
delete this clone
end
... // rest of scriptswhen I receive [delete clones v]and use it like this:
delete this clonewhen I receive [dead v]both of these scripts will solve the issue of the clones also making clones, hope this helps!
broadcast [delete clones v]
why do you have a broadcast named “baka” ;-;
bugs fixed! thanks
we dont talk about the “baka” broadcast
Mar 26, 2024 02:28:22
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Well, that escalated quickly- okay so I attempted to add a menu screen after you die so you can just click play and play again
now the spawns are duplicated on the 2nd run and the character has became immortal.
–
To fix the immortal problem, put this script:foreverinto a “when I receive start” hat block.
set [timer v] to (timer)
if <(health) < (1)> then // no need for both, they mean the same.
broadcast [dead v]
end
For the duplicated spawns problem, this will take a bit, sorry I would recommend to either add a delete this clone when I receive start, like this:when I receive [start v]to every sprite that clones, to prevent the clones from also cloning, causing duplicate spawns, or you can make this block: (with a new broadcast)
repeat (1)
delete this clone
end
... // rest of scriptswhen I receive [delete clones v]and use it like this:
delete this clonewhen I receive [dead v]both of these scripts will solve the issue of the clones also making clones, hope this helps!
broadcast [delete clones v]
why do you have a broadcast named “baka” ;-;
So I've actually wondered this for a while because I've tried it in previous projects and ran into this same issue and never understood why this doesn't work.
The code is used to open and close a menu but it ends up doing absolutely nothing.
when this sprite clicked
if <(costume #) = [1]> then
switch costume to [costume2]
broadcast [armor menu]
if <(costume #) = [2]> then
switch costume to [costume1]
broadcast [menu]
end
I know a longer way of doing it that works but I wanna know if there's a way around that
Edit: alr the second “if, then” block is not supposed to be inside the first one, I have no clue how to post these scratch blocks lol. also I realized how frequent I've been asking you stuff I need to chill it
Mar 26, 2024 02:56:37
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
Malicondi
loading
Don't worry, we're happy to help, you don't have to feed bad about how often you're asking things. also I realized how frequent I've been asking you stuff I need to chill it
Usually what I do for buttons is this:
when gf clickedand when it's clicked once, it does the first action, and when clicked twice. it does the second, this works for any amount of clicks.
set [clicks v] to (0)
when this sprite clicked
set [clicks v] to ((1) - (clicks))
if <(clicks) = (1)> then
broadcast (armor menu v)
switch costume to (costume 2 v)
else
broadcast (menu v)
switch costume to (costume 1 v)
Also, the crosshair sprite is in the way of clicking, so either make it hide until the game starts, or make it so “if touching crosshair and mouse down” instead of when this sprite clicked.
Mar 26, 2024 03:10:21
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Don't worry, we're happy to help, you don't have to feed bad about how often you're asking things. also I realized how frequent I've been asking you stuff I need to chill it
Usually what I do for buttons is this:when gf clickedand when it's clicked once, it does the first action, and when clicked twice. it does the second, this works for any amount of clicks.
set [clicks v] to (0)
when this sprite clicked
set [clicks v] to ((1) - (clicks))
if <(clicks) = (1)> then
broadcast (armor menu v)
switch costume to (costume 2 v)
else
broadcast (menu v)
switch costume to (costume 1 v)
Also, the crosshair sprite is in the way of clicking, so either make it hide until the game starts, or make it so “if touching crosshair and mouse down” instead of when this sprite clicked.
this will come in handy! thanks
Mar 26, 2024 22:28:15
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Don't worry, we're happy to help, you don't have to feed bad about how often you're asking things. also I realized how frequent I've been asking you stuff I need to chill it
Usually what I do for buttons is this:when gf clickedand when it's clicked once, it does the first action, and when clicked twice. it does the second, this works for any amount of clicks.
set [clicks v] to (0)
when this sprite clicked
set [clicks v] to ((1) - (clicks))
if <(clicks) = (1)> then
broadcast (armor menu v)
switch costume to (costume 2 v)
else
broadcast (menu v)
switch costume to (costume 1 v)
Also, the crosshair sprite is in the way of clicking, so either make it hide until the game starts, or make it so “if touching crosshair and mouse down” instead of when this sprite clicked.
alr I added the armor system to the game finally. does it feel clean? any suggestions?
Edit: also a little nitpick with my game that I've had is whenever you go to the edge of the map and then shoot, the bullets are instantly broken by the “bullet breaker” sprite that is made to delete bullets after reaching the edge to prevent clones from piling up although I am not sure why because the sprite is so thin and the bullets are so small that it just doesn't add up to me how they are even touching the sprite in the first place. And its very annoying, especially when your cornered and you wasted half of your ammo for none of the bullets to shoot dang that was a long yap session i just had there
Edit: another thing, so when you start getting late late game and kill the boss a few times the clone limit comes into play and it comes to a point where you can no longer shoot your guns and then the zombies just stop spawning. Probably nothing I can do about it but it's pretty annoying. What could I implement to fix this?
Mar 27, 2024 00:45:35
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
toad_duzz
loading
Heh trust me, I am.Did you just fix it because it looks exactly how I was about to make it lolheres the gameOkay I genuinely can't find out what's wrong and everything seems to be working fine but I'll just completely rewrite your code and hope it works better. One second
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
wait so does it look fine but it doesn't work or does it look fine and you verified that it works
also I changed something that was wrong I forgot to change earlier so you should probably refresh
and thanks for the help, I'll be relying on you for later bugs because you always seem to be active lol!
and if your online could you check out any of the bugs I mentioned? would be nice
Mar 27, 2024 13:47:04
Boss ain't spawning on my game Zombie Survivors W.I.P
view on scratch
view on legacy ocular
MineTurte
loading
Yeah I can. Hold on while I read everything lol.Heh trust me, I am.Did you just fix it because it looks exactly how I was about to make it lolheres the gameOkay I genuinely can't find out what's wrong and everything seems to be working fine but I'll just completely rewrite your code and hope it works better. One second
We're looking at the “boss zombie” sprite. Its coded to spawn when it receives the broadcast “bossfight”
In the “normal zombie”, “electro zombie”, and “tank zombie” sprites, at the end of the spawning scripts it should be broadcasting “bossfight” approximately 130 seconds into the game after picking up the first gun but it never seems to be doing so and instead just continuing to spawn the zombies instead of spawning the boss. Not sure what's causing this, would be nice to have somebody look into this and find the solution.
Pretty sure the issue comes along somewhere with the use of the timer block used frequently in the spawning scripts, there's definitely a better way to code that.
Please don't mind my messy code. If you couldn't tell, I'm a rookie.(thanks for the help!)
wait so does it look fine but it doesn't work or does it look fine and you verified that it works
also I changed something that was wrong I forgot to change earlier so you should probably refresh
and thanks for the help, I'll be relying on you for later bugs because you always seem to be active lol!
and if your online could you check out any of the bugs I mentioned? would be nice
Update: Everything appears to be working pretty good. I suggest though rounding the HP so it's not a messy decimal that can sometimes get really long.