Here's a copy-paste of the draw GUI code used for debugging at 21:30 if (triggered) { var str = "remaining: "; for (var i = 0; i < array_length_1d(remaining); i++) { str += string(remaining[i]) + "|"; } draw_text(25,25, str +" waves total: " +string(total_waves) +" wave now: " +string(current_wave) ) }
Also, @Shaun Spalding, your videos are amazing! I love them and look forward for every video. You've helped me out so much with game maker and video game design. I'm actually working on my very own game and integrating what you've taught me into ways to improve and create my game.
For everyone having trouble with the Approach script, all you need to do is create a new script and (very important) NAME IT Approach, then it will not be taken as a variable. You can find the script code in Shaun's video about useful scripts.
This is great, but for some strange reason it is saying " unassigned variable spawn and waves referenced" and I followed everything in the video. If I put a spawn and wave variable in the create event it doesn't show it, but this isn't the case because he doesn't have wave or spawn variables in the create event.
Hey man just discovered your channel and I like how detailed you are with explaining tutorials. Do you think it's possible to create a loop for enemy spawns for a certain amount of time? I'm trying to make a simple game where you play as a Pikachu during the apocalypse shooting waves of spawning Agumons.
Definitely! I can't really give you the code for it as it's a while since I made this, but I think from what I remember if you understand the concepts here thoroughly you'll have no problem making this kind of adjustment.
Something Saturday same is happening with me i can't make this work.. Any help and if anyone have source code can u tell use what we need to do in order to correct this..
I was able to correct my mistake, see below to understand if (triggered) { //olha a lista de inimigos que estão prontos para spawnar e se estão na onda/tempo for (var i = 0; i < ds_list_size(waves); ++i) { var next = ds_list_find_value(waves,i) if (next[spawners.wave] == current_wave) && (next[spawners.timing] == timer) { var spawnpoint = next[spawners.spawner]; // local que vai criar os inimigos spawn[local, x ou y] instance_create_layer(spawn[spawnpoint,0],spawn[spawnpoint,1],"Player",next[spawners.type]) } } timer++; // tempo começa a rodar } ------>>>> THIS WAS MY MISTAKE, YOU NEED TO PUT THIS BRACKET DOWN BELOW... // proxima wave ou end spawner quando todos os inimigos forem mortos if remaining[current_wave]
Hello. Can someone tell me how can I set the position of spawn points? No way throught ds_list_add(waves, [0, obj_enemigo_02, 0, 50]); or var spawnpoint = next[_SPAWN]; instance_create_layer (spawn[spawnpoint, 0], spawn [spawnpoint, 1], "Instances_Enemigos", next[_TYPE]); } @Shaun Spalding says x coordinate is the 0 next to spawnpoint, and 1 for y coordinate . But as far as I know, x and y coordinates can get numbers much bigger according to your room size and if I change those values spawner dont work (error).
This means you are trying to index a variable which is not an array. It is occurring in your oSpawner's step event. The actual error probably gave you a line number too. Which will help you work out which array is the problem. Either way, make sure that waves actually contains a ds list that actually contains arrays. Make sure "remaining" is also an array. As you can see in the video, if you do these things correctly, it will work.
Amazing tutorial! Just one issue, everytime I try to run the game, it says that the variable “remaining” was not set before reading it. Do you know why it’s doing that? I haven’t been following this series so that might be the reason.
Can anybody show me how to do something like this but with game maker studio 1? My pc is only 32bit I can't find any tutorial that shows something like this (an area wave spawner editable in creation code) anywhere, if anybody know, please tell me
The only issue I'm having is that after my first wave, the second wave isn't coming. In the creation code I did as follows having my first wave set to "0" and my second string of enemies in wave two set to "1." In my debugging interface, it doesn't switch to the next wave when the last enemy is killed. Does anyone know how to fix this? Thanks!
Push :: Execution Error - Variable Index [0,1] out of range [5,0] - -1.spawn(100039,1) at gml_Object_oSpawner_Step_0 (line 12) - instance_create_layer(spawn[spawnpoint,0],spawn[spawnpoint,1],"Enemy",next[_TYPE]); AHHH HELP
I downloaded the spawner source code and I have been studying it since it came out, and although coding is difficult I'm starting to understand it. One problem I have run into, though, is finding out where exactly "remaining" is defined. I've always had trouble with variables, and it can become a real spider web with so many things meaning other things. Could anyone point out where it is located? Thanks again Shaun for another great video! Always looking forward to the next.
thats nice, a handy wave spawner although, if anybody is looking for a spawner that constantly spawns enemies, i've got one that works great for top down games. nice tutorial ;)
Hello, first of all I love your work! I think it’s great! Secondly I’m making a space shooting game well in the process of making the first level of it, I’m having troubles of making my druids spawn out of the battle ships, now the druids will spawn out of them and I set the spawner to the x and y of the battle ship but only 1 battle ship at a time spawns the druids, however I want them all to spawn druids, also the battle ship has a spawner too, so I thought it’s because I set the animation for the battle ship for the battle ship spawner but it wasn’t the problem.
@@loctopod3786 I completely forgot 😭 I’m really sorry mate. I haven’t used gamemaker since highschool since I needed to learn R and Python for my degree
Think i'll have to watch this video a few times it's very confusing to follow along with as your not doing things in order, your writing all of one code before doing things needed for it. Makes it very difficult for me to follow along.
I believe Shaun said he made those in a video about 'Scripts' but I am not sure at all. You can try look after it in on his channel. However, if you are a patreon supporter you can download the source code and simply copy it over to your own and it will work. I ran into the same problem and just did that.
Here's a copy-paste of the draw GUI code used for debugging at 21:30
if (triggered)
{
var str = "remaining: ";
for (var i = 0; i < array_length_1d(remaining); i++)
{
str += string(remaining[i]) + "|";
}
draw_text(25,25,
str
+"
waves total: " +string(total_waves)
+"
wave now: " +string(current_wave)
)
}
Also, @Shaun Spalding, your videos are amazing! I love them and look forward for every video. You've helped me out so much with game maker and video game design. I'm actually working on my very own game and integrating what you've taught me into ways to improve and create my game.
For everyone having trouble with the Approach script, all you need to do is create a new script and (very important) NAME IT Approach, then it will not be taken as a variable. You can find the script code in Shaun's video about useful scripts.
Oh ty!!
This is great, but for some strange reason it is saying " unassigned variable spawn and waves referenced" and I followed everything in the video. If I put a spawn and wave variable in the create event it doesn't show it, but this isn't the case because he doesn't have wave or spawn variables in the create event.
Love your vids thanks for helping me out with coding stay awesome
hey, whats the approach script? i've done all of the code in the video but i think i've managed to miss it :/
its a custom script, NOT built into gamemaker
hey i really like your videos, i wanted to know how to make the spawner spawn random enemies from the ones i made can you help?
add your enemies object to the ds list...
make it so when it spawns the enemies, the time has a "choose" function before it. then put in parenthesis how many different times you want
I appreciate the clicky-ness of your mouse.
hey there Shaun, after I finished adding Spawner into my new room. I couldn't start the game any help?
I have been watching your videos all the way back in game maker 8.1 😁
what about the approach script ?
It's a fairly common script in these tutorials. I've seen in it Shaun's Platformer series and a cpl others.
what do we do if we want to make more than 2 spawn points?
How would I add variables to the enemies spawned?
For example change their max hp and such?
Help! How do you make doors solid? My hero and enemies pass through them
Make sure it has your regular walls as a parent
assign "Odoor" as a children of "Owall"
hey can u make something about dropped guns? just to change gun or show it in inventory.. just something like that
Hey man just discovered your channel and I like how detailed you are with explaining tutorials. Do you think it's possible to create a loop for enemy spawns for a certain amount of time? I'm trying to make a simple game where you play as a Pikachu during the apocalypse shooting waves of spawning Agumons.
Definitely! I can't really give you the code for it as it's a while since I made this, but I think from what I remember if you understand the concepts here thoroughly you'll have no problem making this kind of adjustment.
@@SaraSpalding Alright cool thnx man
pikachu
array_length_1d is DEPRECATED. I tried to use array_lenght but the "remaining" variable still isnt correct. Does anyone have the same issue?
hey please show us how you did the approach script please
What about remaining, where did you set that variable
trying to index a variable which is not an array
at gml_Object_obj_spawner_Step_0 (line 23) - if (remaining[current_wave]
same is happening with me - did you figure it out?
Something Saturday same is happening with me i can't make this work.. Any help and if anyone have source code can u tell use what we need to do in order to correct this..
I was able to correct my mistake, see below to understand
if (triggered)
{
//olha a lista de inimigos que estão prontos para spawnar e se estão na onda/tempo
for (var i = 0; i < ds_list_size(waves); ++i)
{
var next = ds_list_find_value(waves,i)
if (next[spawners.wave] == current_wave) && (next[spawners.timing] == timer)
{
var spawnpoint = next[spawners.spawner]; // local que vai criar os inimigos spawn[local, x ou y]
instance_create_layer(spawn[spawnpoint,0],spawn[spawnpoint,1],"Player",next[spawners.type])
}
}
timer++; // tempo começa a rodar
} ------>>>> THIS WAS MY MISTAKE, YOU NEED TO PUT THIS BRACKET DOWN BELOW...
// proxima wave ou end spawner quando todos os inimigos forem mortos
if remaining[current_wave]
Hello. Can someone tell me how can I set the position of spawn points? No way throught ds_list_add(waves, [0, obj_enemigo_02, 0, 50]); or var spawnpoint = next[_SPAWN];
instance_create_layer (spawn[spawnpoint, 0], spawn [spawnpoint, 1], "Instances_Enemigos", next[_TYPE]);
}
@Shaun Spalding says x coordinate is the 0 next to spawnpoint, and 1 for y coordinate . But as far as I know, x and y coordinates can get numbers much bigger according to your room size and if I change those values spawner dont work (error).
Yet another problem with Shaun's tutorials.
trying to index a variable which is not an array
at gml_Object_oSpawner_Step_0
This means you are trying to index a variable which is not an array. It is occurring in your oSpawner's step event. The actual error probably gave you a line number too. Which will help you work out which array is the problem. Either way, make sure that waves actually contains a ds list that actually contains arrays. Make sure "remaining" is also an array.
As you can see in the video, if you do these things correctly, it will work.
Figured it out, thanks for the help
@@KadeyHQ How?
Dude, you saved my life so many times in the past two weeks that you can't even imagine. Thank you very much
Amazing tutorial! Just one issue, everytime I try to run the game, it says that the variable “remaining” was not set before reading it. Do you know why it’s doing that? I haven’t been following this series so that might be the reason.
What if you want them to spawn at random places within the trigger area but only on a floor
How do we use the door my if closed door is not working. Is there code in the door object?
Can anybody show me how to do something like this but with game maker studio 1? My pc is only 32bit
I can't find any tutorial that shows something like this (an area wave spawner editable in creation code) anywhere, if anybody know, please tell me
Hi, good video!) Thanks!)) Can you show how to add the water and fisic of it. Thank you. Because I have some trouble with this.
What can i do if i want more spawnpoint
add them to the spawn point array
The only issue I'm having is that after my first wave, the second wave isn't coming. In the creation code I did as follows having my first wave set to "0" and my second string of enemies in wave two set to "1." In my debugging interface, it doesn't switch to the next wave when the last enemy is killed. Does anyone know how to fix this? Thanks!
just kidding I'm an idiot and forgot to do the instance destroy line under the step event.
@@theresamisu267 Still doesn't work for me I'm afraid
Push :: Execution Error - Variable Index [0,1] out of range [5,0] - -1.spawn(100039,1)
at gml_Object_oSpawner_Step_0 (line 12) - instance_create_layer(spawn[spawnpoint,0],spawn[spawnpoint,1],"Enemy",next[_TYPE]);
AHHH HELP
very helpful would like to know how i can add a score system that subtract points for killing enemy's
its in his platformer vids
i dont know why, but the way that it happened, everytime i enter into the spawner, it spawns them, but it makes me immovable.
yesss i can see my name in the credits! CampGamer!
I love coding with you!!
Hey will u do one on death and if not what’s the script
Thanks bro helped me a lot
I downloaded the spawner source code and I have been studying it since it came out, and although coding is difficult I'm starting to understand it.
One problem I have run into, though, is finding out where exactly "remaining" is defined. I've always had trouble with variables, and it can become a real spider web with so many things meaning other things. Could anyone point out where it is located?
Thanks again Shaun for another great video! Always looking forward to the next.
thats nice, a handy wave spawner
although, if anybody is looking for a spawner that constantly spawns enemies, i've got one that works great for top down games.
nice tutorial ;)
hit me up
can't see the video
Quem é brasileiro e veio aqui pela falta de conteúdo de Game Maker no Brasil, curte ai!
my game just became a black screen after adding whole wave code lol pls help
it could be a texture problem
I hate getting confused on these (){}[] they make things so confusing when you don't understand when to use them.
you can swap {} for begin and end if that helps you keep track of that one.
Please add this to the GameMaker Studio 2 - Complete Platformer play list.
Very helpful! Just wanted to know how to make doors :D
wait what if i have multiple enemies
Hello, first of all I love your work! I think it’s great! Secondly I’m making a space shooting game well in the process of making the first level of it, I’m having troubles of making my druids spawn out of the battle ships, now the druids will spawn out of them and I set the spawner to the x and y of the battle ship but only 1 battle ship at a time spawns the druids, however I want them all to spawn druids, also the battle ship has a spawner too, so I thought it’s because I set the animation for the battle ship for the battle ship spawner but it wasn’t the problem.
Hey man your vids are awesome and really helpful, could you please make a tutorial on adding multi-touch controls to your game? Please and thanks!
how to make followers enemy????????
hi, pls list it on youtube :(
Thank you, really helpful
collapsing enums.
Error : gml_Object_Ospawner_Step_0(4) : malformed statement
Final Compile...finished.
EDIT on Previous Comment: I fixed the error but only one wave spawns. After the first wave no more enemies spawn
HOW (sorry ik u did this 4 yrs ago)
@@loctopod3786 I completely forgot 😭 I’m really sorry mate. I haven’t used gamemaker since highschool since I needed to learn R and Python for my degree
Thank you!
What if you want a random obstacle/enemy spawner for a running game
Approach script is in his script video..
Где?
if anyone has issues with the remaining variable, just type "remaining[0] = 0;" in the create step. seems to work for me.
That did not fix it for me :(
Think i'll have to watch this video a few times it's very confusing to follow along with as your not doing things in order, your writing all of one code before doing things needed for it. Makes it very difficult for me to follow along.
does anyone know how to make the "Approach" to work?
I believe Shaun said he made those in a video about 'Scripts' but I am not sure at all. You can try look after it in on his channel. However, if you are a patreon supporter you can download the source code and simply copy it over to your own and it will work. I ran into the same problem and just did that.
4
pls speak portugueseeeeeeeee