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

0 favourites
  • 6 posts
From the Asset Store
Customize the animation of character when item changed
  • 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

  • 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.

  • > 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)