how to do limited spawn

Get help using Construct 2

Post » Fri Jul 10, 2015 6:22 pm

Ok i get that I need global variable of say 3 and each spawn decrease that amount by 1 until 0. I understand that perfectly.

Its this next part that I am having trouble I want each of the monster to spawn on its own Square tile that I place Such as Mplacementtile times 3 which should result in each monster place on the tile once three times. Problem is that when dealing with layers such as level one or level two with layer effect. I do not see or know how to tell the stupid Object to delete the invisible when the layer is invisible. As i understand Even If the object is on the layer has been turn invisible Is actually still visible According to the engine. So i cant get rid of the excess Mplacement tile.

In other word I Am trying to see a way to cutdown on both CPU from excess "visible" layer invisible object. So I am trying to get the spawn code to work so that I can just spawn the monster instead of placing Thousand of them with hundred of layer And not looping a destroy for every stupid layer. If there a way to do this with just spawn only three monster Id like to know

If you need me to do picture to explain it better

Update: I found that one of my code that was hidden away was destroying the sprite after it was created move along I feel really dumb
Last edited by Gearworkdragon on Mon Jul 13, 2015 6:28 pm, edited 1 time in total.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Fri Jul 10, 2015 7:03 pm

would adding a "layer is visible" condition help to only spawn on the visible layer?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Fri Jul 10, 2015 7:18 pm

How would i go about to doing that one ? Ok so i did a test run with your idea. I didnt work. It did indeed spawn but It should only spawn that layer not the other layer as well. This is hell trying to figure out to spawn it correctly

Btw I am having another problem the Mplacement tile is not correctly checking. Like it work fine for the first level but when I go to pick level 2 layer It won't Use the next set of three. It like the code is in love with the first three?
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Fri Jul 10, 2015 8:33 pm

So you're using layers to differentiate between different levels of your game instead of layouts? How are you using the word level when you say "level one or level two" in your first post? Like Mario Bros. where you go from level to level, or like a building where each floor or story would be a level? If you need to switch back and forth quickly between the different levels, I could see using layers, but otherwise I'd recommend using layouts.
B
11
S
2
G
1
Posts: 79
Reputation: 842

Post » Sat Jul 11, 2015 3:21 am

thing is the dungeon will be multi-story with a final layer to miniboss and id like to have the player to have access to prievious layer but id also like to have random level layout and have it seem alway different everytime they go in so that the player can’t use a guide to beat my game in 5 hrs or something and to provide alway something new to last for hours
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Sat Jul 11, 2015 3:22 am

thing is the dungeon will be multi-story with a final layer to miniboss and id like to have the player to have access to prievious layer but id also like to have random level layout and have it seem alway different everytime they go in so that the player can’t use a guide to beat my game in 5 hrs or something and to provide alway something new to last for hours
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Sat Jul 11, 2015 3:42 am

Hey, how about creating an array, with the co-ordinates of the spawn locations, and a section with the UID of the object it spawned. Then "on destroy" of one of these spawned objects, check its UID and clear the UID section of the array.

Every X seconds, check if there are any arrays with an empty UID section and spawn one, repeat.
B
37
S
11
G
6
Posts: 962
Reputation: 11,259

Post » Sun Jul 12, 2015 2:30 am

@Rory I think i know what you talking about. But I never did use array in that way. and you gave me an idea Is it possible then If i could grab the specific UID of the spawn location ? Another question is that IF i do end up doing a destroy function the location of the spawn Will it affect how the UID is counted ? And If I am reading this right How would i go about clearing UID and doing a hard reset.

Sorry @rory But i havent done that scale and I would like to see examples on If and how to implement it. I been following the basic tutorials. And i do not think there is one i can follow.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, volumetv and 18 guests