How to Make a Top Down Shooter in GameMaker Studio 2! (Part 10: Enemy Spawners and Enemy Limits)
HTML-код
- Опубликовано: 9 ноя 2022
- Support me and these videos on Patreon! / peytonburnham
Wishlist Starcross Starcade! (get used to hearing that!) store.steampowered.com/app/17...
My tweets: / peydinburnham
Rose of Starcross Demo: peytonburnham.itch.io/rose-of...
Discord: / discord
My twitch: / peydinburnham Игры
Fantastic! Can't wait until the next one!
I love how you tend to mention that we could have figured something out on our own like when you mess something up real quick... but in fact, I my self would not have figured it out. 😅
Bold of you to assume I know what I'm doing.
Also, how would I have each room have their own enemy amount variables, I just changed the creation code for the room and changed the global amounts for each room, the problem I have is when I go back into another room, it basically takes the last room's enemy max count for that room.
New video🎊🎊🎊
Hey man! I really hope you read this comment soon because I’m going crazy. I’ve been following your videos really closely, and I have a question. I get this weird error whenever I try to shoot an enemy with a shotgun round (in your case, the red bullet.) and it says there’s something wrong with the OBJ_Enemy_Parent. And as far as I know I have it set exactly like yours, do you have any idea what might be wrong?
I fixed it, I just ended up taking the shotgun completely out
Hey bro, i'm right there with you following along!! Can you elaborate on your issue a bit more? And did this issue just come up in this video?
Hey man.
following your videos and I came across a weird issue. Even though I have the global.totalEnemiesSpawned set in the oHud object, when I try to play the game, the game errors out saying that global.totalEnemiesSpawned is not set, so inside the OEnemyParent object, the global.totalEnemiesSpawned++; wont work.
As a test, if I place global.totalEnemiesSpawned = 0; in the oEnemyParent and then the game launches no problem, but enemies spawn past the max enemy allowed per room.
What am I doing wrong?
Here is the actual error.
ERROR in
action number 1
of Create Event
for object oEnemyParent:
Variable .totalEnemiesSpawned(100060, -2147483648) not set before reading it.
at gml_Object_oEnemyParent_Create_0 (line 5) - global.totalEnemiesSpawned++;
############################################################################################
gml_Object_oEnemyParent_Create_0 (line 5)
Yea. I followed it now 3 times, and at 31.17 in the video I get that error.
What I find interesting is that under enemyParent step event, where the object dies, global.enemyKillCount++; works just fine even though that is set inside the hud.
but the global.totalEnemiesSpawned from the hud doesn't want to be read within the enemyParent.
ok fixed it. It happened that I had an enemy in the room, and after removing the object, and fixing room instance order it got fixed.
Thank you
24:53