Instance Variables - Not Responding

Get help using Construct 2

Post » Sun Apr 05, 2015 11:20 pm

Hi

I successfully managed to add an instance variable to an enemy of 3 health and also managed to take 1 health with the collision of a bullet.
Problem started when I created a different enemy with the exact same instance variable (with a different name, of course) and the bullets aren't doing anything to him. I've tried absolute everything and it still has a different outcome, although the two enemies are technically identical.

I'll post a capx here...
Image

Is this problem familiar to anyone of you?

Thanks
3rdclover
B
6
S
1
Posts: 18
Reputation: 343

Post » Sun Apr 05, 2015 11:25 pm

Are bullets getting destroyed, or do they pass through? Could be that the origin point or the collision polygon of the hunter is not as it should be (= collision wouldn't happen at the place where the image is).
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Apr 06, 2015 6:48 am

Silly question; Did you set up the "on collision with" events for second enemy and events to subtract from the new enemy internal variable?

I assume you mean you made a new sprite and added an internal variable of the same name and not just created an instance of the original via ctl-drag or copy/paste..

If its not an instance it will act completely autonomous of others regardless of internal variable names, events, or action.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
66
S
17
G
8
Posts: 637
Reputation: 9,370

Post » Mon Apr 06, 2015 11:02 am

Are bullets getting destroyed, or do they pass through? Could be that the origin point or the collision polygon of the hunter is not as it should be (= collision wouldn't happen at the place where the image is).


here's a screenshot of the spire editor with the collision area...
Image

As for the instance variables(iv) question, I've created a new sprite and proceeded to go through the same process as the other enemy, step by step. The only difference is the name of the iv which went from "zombiehealth" to "hunterhealth" to mach the enemy's identity.

--
B
6
S
1
Posts: 18
Reputation: 343

Post » Mon Apr 06, 2015 11:40 am

Problem Solved ---

Noob mistake nº1:
Forget to add - hunter > hunterhealth = 0 > Destroy
Narf!

--
B
6
S
1
Posts: 18
Reputation: 343


Return to How do I....?

Who is online

Users browsing this forum: FacuLNF and 62 guests