Spwaning problems

For questions about using Classic.

Post » Thu Jan 06, 2011 5:11 pm

Hi,


I don't know if it is a bug or if i just missed something. When i try to to spawn a object(a sprite) in multiple places at the same time, it does not work properly. I try to spawn an enemy sprite several times.

Several issues can happen:

1) i can't spawn a object more than one time if i use the same spawn point which is copy and pasted or cloned. If i do so, only one of this spawn points will spawn the object.

2) if i use completely different spawn points i can spawn the object several times but only one of this sprites will act correctly. Only one of the enemy sprites will chase the player and act like it is set in the event sheets. The others will just do randomly nothing or only a part of the event script.

3) if i assign a light source to the enemy sprite, it will be only set to the first spawned sprite, never to the others. I tried containers, but if use containers construct crashes when i start the application.

My Cap:
http://www.mediafire.com/?ba7336kz4ekogl5

Is this a bug? I think crashing to the desktop is no good sign^^ Or are my events messed up?
B
2
G
2
Posts: 15
Reputation: 680

Post » Thu Jan 06, 2011 6:06 pm

If you haven't checked it, I suggest parts 8 and 9 of the Platform School Tutorial on the wiki page. They deal with enemies and enemy AI, and if you didn't look at that, that can be a great help. It offers essentially a foolproof way of setting up enemies and enemy spawn points.


Just looking at things briefly, a major problem is that your events for your spawn points are set up that only ONE spawn point will actually do anything.

What you need is the condition "For Each Spwan" [sic]

Because the way you have it now, only ONE spawn point will activate and destroy itself, leaving the rest to just kinda sit there.

Also, nowhere on your layout does the enemy actually, you know, exist. What you want to do, is put instances of your enemy outside the layout, with the Group attribute "Destroy on Startup"

Then you can probably put the enemy and the light object in the same container. Because your enemies just... aren't there.

Really, like I said, check out the tutorial. You may not be making a platformer, but I would highly recommend seeing how the tutorial does it, and learning from that. A lot of what is causing crashes for you is in fact just simple errors.
Check out my VGM on my soundcloud page!
Video-Game Music: E.C.2151
B
7
S
2
G
2
Posts: 193
Reputation: 1,561

Post » Fri Jan 07, 2011 2:00 am

Thanks emporer!

Oh, i did the tutorials but i skipped the ai section of the platform tutorial :lol:
B
2
G
2
Posts: 15
Reputation: 680


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests