*bump* Give damage to individual enemy

Get help using Construct 2

Post » Thu Mar 15, 2012 11:39 pm

Hello! Have been trying all day to make this work but still cant fix it.
On the layout I have the player and three enemys (orcs) that I want to recieve damage individually. Experimented with families and UID after recieving an example capx from someone here at forum. Ill post my capx so you can see what I have so far:

the game

use arrow keys to move press C to cast spells (and X just plays a attack with staff animation), hold sh*t while moving to walk.
       edit:       LOL spelled "shift" wrong

I plan to add more kinds of enemies if this can be solved.

Thx!


(march 17)
Edit:
Still havent been able to solve this one. Tried to do the samr thing in GM8.1 with some GML and was done in 5 minutes since every instance of an object get its own creation code, but I DONT want to use GM8.1 because C2 is so much better in so many ways!! There has to be a sollution to this! :)

So if theres anyone here can take a look at the posted capx (you need to have licensed C2) and help me out I would be extremely grateful!MonDieu2012-03-17 13:33:51
B
21
S
7
G
4
Posts: 221
Reputation: 5,070

Post » Fri Mar 16, 2012 12:18 am

have you tried adding instance variables to your enemies ad then decreasing that value?
B
4
Posts: 46
Reputation: 617

Post » Fri Mar 16, 2012 12:26 am

They all have variables for HP direction and other variables already if thats what you mean. Problem is when I put multiple copies of for example orcs they all do everything at the same time, not individually
B
21
S
7
G
4
Posts: 221
Reputation: 5,070

Post » Fri Mar 16, 2012 12:33 am

I think you might have to test for every orc then.

For each orc
Orc is overlapping bullet
B
4
Posts: 46
Reputation: 617

Post » Fri Mar 16, 2012 12:43 am

its not that simple since every enemy uses three parts:
enemy_mask - stores variables and handles collisions with solids.
enemy_animation - movement, attack and other animations i 8 directions
enemy_collision - Handles colissions from player spells and attacks.
B
21
S
7
G
4
Posts: 221
Reputation: 5,070

Post » Fri Mar 16, 2012 1:35 am

too much events for the free version :(

in one of my projects, i just do a collision check and have a substract from the hp variable from the enemy and only that does the trick.

like here, don't mind the other events, its one of my first try-outs in construct :)
http://dl.dropbox.com/u/65731657/topdown.capxWishy2012-03-16 01:45:07
B
22
S
11
G
9
Posts: 133
Reputation: 6,572


Return to How do I....?

Who is online

Users browsing this forum: Matthew de, semaso, Skebab, Virpoja and 24 guests