How do I add enemy without spawner

Get help using Construct 2

Post » Fri May 08, 2015 12:40 am

Hello everybody I'm just wondering is it possible to create enemies with out a spawner? Because when I kill one of the enemy all of them die (instantly). Is there any way to add ID or something like that so they are not attached (not duplicating the other enemy sprite?

Thank you!
B
8
S
3
Posts: 120
Reputation: 989

Post » Fri May 08, 2015 2:09 am

"Enemy" and "Spawner" are technically just sprites, you can create them using the system's action "create object".

Now about "killing one of them", I think you may have to pick the object beforehand. If you simply call the destroy action on an Enemy, it is natural that they are all destroyed afterwards, because all your Enemy instances are picked.

Use the event "pick by unique ID" of your Enemy object, or any "pick ..." event in the System object to pick a single instance, or a group of instances, upon which you wich to apply the "destroy" action.
ImageImage
B
44
S
14
G
10
Posts: 166
Reputation: 7,779

Post » Fri May 08, 2015 7:44 am

Message: Frap1K is not yet permitted to post plain text URLS (300 rep required). 1 URLS removed. Why?
So there is no other way without spawner? Because I really wanted to just place the zombies on the map but they keep repeating what the real enemy does, so if I kill one of the zombie all of them play the death animation and die... I'm not very good at understanding where and what to press in construct 2 guys sorry ( Still Learning) Thanks for future help!
B
8
S
3
Posts: 120
Reputation: 989

Post » Fri May 08, 2015 7:55 am

Well we could go and guess what you are doing, or you could show us..

I'm not sure what you mean by a spawner, as far as I know there is no spawner object in C2.

you probably mean either the sprite spawn action or the system create action..
Both of these create objects at a location you specify, but neither has anything to do with the fact your enemies all act the same..

If you want a specific enemy to do a specific thing while other enemies do other things, you should make it clear in your events which enemy you want.
My guess is you are using the system compare action, which doesn't pick any instances..
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 May 08, 2015 7:57 am

you can do this - add a health variable to your sprite. add some hp.

then do this

condition - something (bullet, bomb or whatever you use to destroy objects) on collision with enemy - remove x from hp
subevent - condition - if health <= 0 - enemy destroy (this will destroy the collided enemy)

that way you can duplicate your sprite infinite times and have only 1 destroyed at a time. of course there's tons of other ways of doing this, but it all depends on the gameplay you want to achieve.
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Fri May 08, 2015 8:43 am

I thought I cant post links .. sorry! But here it is...
Image
Last edited by Frap1K on Fri May 08, 2015 10:56 am, edited 3 times in total.
B
8
S
3
Posts: 120
Reputation: 989

Post » Fri May 08, 2015 8:48 am

Try posting the URL without the "https://www" part.
I think that should work.. :)
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 May 08, 2015 8:49 am

ok here it is - upload.ee/image/4712865/Untitled-1.png
B
8
S
3
Posts: 120
Reputation: 989

Post » Fri May 08, 2015 8:53 am

Thanks for the picture.. :)
I'm not quite sure in what way this picture should help with answering your questions, but it's nice..
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 May 08, 2015 8:55 am

I mean like I have the 2nd zombie as a clone so if I kill the real zombie the clone dies with him together :( .
Im trying @saiyadjin answer right now, might work.

But I have hit boxes so if zombie hit in the circle >> play animation 1. If zombie hit in square zombie play animation 2 Will this still work @saiyadjin?
B
8
S
3
Posts: 120
Reputation: 989

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests