How do I last player to shoot a monster (Multiplayer)

Get help using Construct 2

Post » Tue Nov 04, 2014 4:59 am

Hi, I am trying to set monster kills per peer. To do this I think I need to set a variable on the monster object for the last player to hit the monster so when the monsters health hits 0 it takes the last hit variable (players name) and adds a kill to that players kills. I plan on doing this by the following is possible:

Player left click spawns a bullet, bullet is given a variable Shooter which will be the player that shot it, Bullet collision with monster then transfers the Shooter variable to the monster variable LastHit (Player Name), Monsters health = 0 then Add 1 to kills form LastHit (Player Name)

Is this or a variation of this possible?

Thanks
B
6
S
1
Posts: 10
Reputation: 429

Post » Tue Nov 04, 2014 6:13 am

Moochie wrote:Hi, I am trying to set monster kills per peer. To do this I think I need to set a variable on the monster object for the last player to hit the monster so when the monsters health hits 0 it takes the last hit variable (players name) and adds a kill to that players kills. I plan on doing this by the following is possible:

Player left click spawns a bullet, bullet is given a variable Shooter which will be the player that shot it, Bullet collision with monster then transfers the Shooter variable to the monster variable LastHit (Player Name), Monsters health = 0 then Add 1 to kills form LastHit (Player Name)

Is this or a variation of this possible?

Thanks

I think the official shooter MP example shows the exact way to this already. Line64 and line65.
B
28
S
8
G
4
Posts: 553
Reputation: 4,914

Post » Tue Nov 04, 2014 7:24 am

DuckfaceNinja wrote:
Moochie wrote:Hi, I am trying to set monster kills per peer. To do this I think I need to set a variable on the monster object for the last player to hit the monster so when the monsters health hits 0 it takes the last hit variable (players name) and adds a kill to that players kills. I plan on doing this by the following is possible:

Player left click spawns a bullet, bullet is given a variable Shooter which will be the player that shot it, Bullet collision with monster then transfers the Shooter variable to the monster variable LastHit (Player Name), Monsters health = 0 then Add 1 to kills form LastHit (Player Name)

Is this or a variation of this possible?

Thanks

I think the official shooter MP example shows the exact way to this already. Line64 and line65.


But in mine I create a bullet object that travels across the map and when it collides with a monster it does 1 damage. In the official shooter MP you click on a player to do damage, so would this still work?

Thanks
B
6
S
1
Posts: 10
Reputation: 429

Post » Tue Nov 04, 2014 7:58 am

Yes it would, it basically uses the same mechanic but different object. If you made a non-MP top down shooter with AI previously, this should be intuitive enough to figure out.
B
28
S
8
G
4
Posts: 553
Reputation: 4,914

Post » Wed Nov 05, 2014 2:42 am

DuckfaceNinja wrote:Yes it would, it basically uses the same mechanic but different object. If you made a non-MP top down shooter with AI previously, this should be intuitive enough to figure out.

I have but the kills were just added to 1 player and now I need to separate the kills per peer and I seem to be having trouble with that. I will see if I can get the original method to work for me tonight. Thanks
B
6
S
1
Posts: 10
Reputation: 429

Post » Wed Dec 10, 2014 8:38 am

I understand Moochie's problem here, as I have the same problem.. a problem that seems to be misunderstood. The original MP shooter game only relies on where the shooter's mouse is pointed. Moochie (and mine's ) game relies on when a bullet FROM the shooter HITS or OVERLAPS another character. So that's why we have to place information on the bullet about who it is from. I think that's what TS needs help with. Please correct me if I'm wrong. And please somebody help.
B
4
Posts: 2
Reputation: 204


Return to How do I....?

Who is online

Users browsing this forum: khelaghor, R0J0hound and 6 guests