but doing like this wouldn’t mean that i can only choose one following wave?
Thats why I suggested the List so you could have serveral waves that follow it
and also, the following wave in the same enemy config is already established with the list, the problem is that they wait for the coroutine to finish so if they are in the same enemy config, they will never start together
yeah but i don’t wanna them to follow, i want them to start together
As in they all spawn at once?
yes , i want at the same time a wave coming from left and one from right, with the code i have now before the right wave starts ALL the enemies of the current wave have to be spawned, like i said before its like a SERIAL path and i want it to be parallelized
and in addition to this i want to chose when this parallel spawning happens, so like at once with the wave 3 or 5 or 7 of an other enemy spawner
because with what i have now i can achieve a behavior similiar to this, but i have no control of WHEN each wave gets spawned, they just spawn
I’m not 100% exactly sure the behavior you’re after…
Look i made a video, the first half is the behavior in waht i called the “serial” way, where i use only one Enemy spawner and each next wave has to wait that all the enemies of the current wave have spawned before kickin in, the second half is what i want (parallel enemy spawns) and i achieved it by using 2 same script “enemyspawner” on the same object, it works , but it only works in the order the list is, what if i wanted that LUIGI enemy wave coming together the fourth wave of the first enemy spawner? and not at the beginning? this is the best TLDR i can do ahahha
Okay how about instead of two enemy spawner scripts you just make two lists in the Enemy spawner? then you can trigger both spawns at the top of each list at the same time.
yeah but how could i control when each spawn is executed and after what in a dinamic way?
let’s say i have the enemyspawner list 1 with wave 1-2-3-5 and enemyspawner list 2 with wave 3-1- (the numbers arre just the “type” o wave, with differnt enemies etc it’s not the order) how could i say like that i want the wave 3 (of the second list) to be executed after the wave 2 of the first list, and the wave 1 (of the second list) after like the wave 5 of the first list?
is there a way to control “when” a certain script is executed or born ? idk it comes to my mind only the coroutines to wait and delay things and the conditions to trigger stuff at a certain point
There’s a number of ways to add a delay, if Coroutines is what you got in your toolbox then use that, as for determining which waves spawn together just rearrange each list, so if the first two waves are 1 and 3 then the first list should have wave 1 at the top and second list should have wave 3
but how i have to do to say to each wave to wait for a specific other wave to spawn simultaneously?
coroutine?
and how i can do that dinamic , i have to serialize a list of fields that refer to each wave i have in the spawner with the specific wave i want to wait for?
but still doing it in the same script, like 2 lists like you said, instantly kills the parallelism that i want to achieve, even if i did two “for cycles” they would be executed one after an other, and i don’t think unity implements some sort of multithreading stuff, the only thing i can do is :
-a different gameobject with a different game script with the waves i want to happen simultaneously, like a “parallel enemy spawner”
-or to simply put the new script inside this same object (or even the previous script but with changes)
but to put two list in the same script would exclude the chance of doing and executing them at the same time
The way the spawner script is coded currently I dont see any simple way of coordinating between 2 separate instances of the spawner without a good bit of rewrite. But it looks like you might be able to use the delay option already present in the wave object to do what you are trying to do.
- if i want to spawn let’s say the Element 0 of the second enemy spawner when the element 4 kicks in of the first enemy spawner?
instead of 2 separate waves just add both these in the same waveconfig and set the time between spawns to 0 on the first one. This will make the next wave start right after the first one spawns.
- it would be cool if i managed to find also a way to get a delay between the spawns, but i think i almost did this, arghh i’m trying to solve this, if anyone could lend a hand it would be much appreciated
You could set the time between spawns on the second item to whatever delay you want and this would delay the start of the following wave .
So basically what I am suggesting is to use a singe wave config and then adding the waves in it in the sequence that forms “groups” . The items that you want to launch in one “group” will all have 0 delay set in the wave items except the last one and the last item in the “group” to be set with a delay so the next “group” starts spawning after that delay etc.
Hi, thank you for your reply mate in these hours i managed to get a solution by myself , tomorrow i’ll share it with you guys and i’ll see also what you suggested , now i just want to go to bed ahahahah