How do I receive reaction of NPC when i hit other NPC?

0 favourites
  • 5 posts
From the Asset Store
Plant a bomb and Destroy as Many Zombies as Possible
  • I have sprite 'Bullet', 'Player' and 'NPC'

    NPC have behavior Line of sight

    i put few this same NPC's on map

    now when i shoot thru one NPC and this NPC will be hurt (or killed)

    when OTHER NPC see this should have some reaction, for example turn color to RED

    how can i do this?

  • You can add NPC sprite to a family and move LineOfSight behavior to the family level. Then you will be able to pick family instances independently from NPC instances.

    Bullet on collision with NPC
    .. FamilyNPC has LOS to LPC : FamilyNPC set animation to "shoked"
    
  • You can add NPC sprite to a family and move LineOfSight behavior to the family level. Then you will be able to pick family instances independently from NPC instances.

    > Bullet on collision with NPC
    .. FamilyNPC has LOS to LPC : FamilyNPC set animation to "shoked"
    

    if i understand well, i make that code, i set 'destroy NPC' witness to be sure he have seen this action:

    i need to make event to NPC not to family because all instance variables already have 'NPC' Like AI behavior, and other statistics. So This new family dont have this stats

    i also try use function:

    but also dont work

  • i need to make event to NPC not to family because all instance variables already have 'NPC' Like AI behavior, and other statistics

    See this tutorial:

    construct.net/en/tutorials/upgrade-object-family-14

    You can do this without a family, but it's more difficult.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • > i need to make event to NPC not to family because all instance variables already have 'NPC' Like AI behavior, and other statistics

    See this tutorial:

    https://www.construct.net/en/tutorials/upgrade-object-family-14

    You can do this without a family, but it's more difficult.

    OK i check this out :)

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