Aller au contenu

Photo

Henchman should not die permanently


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Zeke

Zeke
  • Members
  • 48 messages

In the beginning of my module, the player has a story important henchman with him. At the same time, there are some battles in which the henchman can die.

If I make the henchman immortal, the battles become a piece of cake because the player can leave the enemies to him.

Making the henchman to not die but to become unconscious instead until the battle is over is not a good idea. The player can still run far away and disengage from battle, and what if he has transitioned to another area?

Showing game over window if the henchman dies seems very direct to me.

Could you please give me some ideas how can I solve this problem?



#2
Proleric

Proleric
  • Members
  • 2 354 messages
I use the "unconcious henchman" approach. If the player wants to revive them, they have to rest in the same area. Or you could have them wake up when hostiles are all dead in the area, like BG or Dragon Age. I don't think the player leaving the area is a big problem, but if you used my OnTransition pseudo event from Travel Biilder, or similar, you could stop it while the companion is out of action.

#3
Frush O'Suggill

Frush O'Suggill
  • Members
  • 41 messages

I currently use a system similar to the one Proleric described. I set a variable IS_DYING on the henchman, then use the KeepDead()/StopKeepingDead() functions to incapacitate them when they are down to 1  HP. The player can use a spell or potion to heal them, or rest, after which the henchman revives with the appropriate HPs. A heartbeat script also checks if there are enemies left in the area - if not, they reviive with 1 HP.  They player can also choose to wait if he himself is "killed," and any capable henchmen will attempt to use available potions or spells to revive him.


  • Grymlorde aime ceci

#4
Proleric

Proleric
  • Members
  • 2 354 messages

A nuance of my method is that the henchman is actually dead, but not selectable, so I don't have to ensure they're inactive while "unconcious".



#5
Zeke

Zeke
  • Members
  • 48 messages

Great ideas, thanks. How do you proceed when the current area is big and there are many hostiles all over the place? Do you check for range around the fallen henchman?



#6
Proleric

Proleric
  • Members
  • 2 354 messages
Currently, I use player rest, since the end-of-rest event almost never happens if enemies are around. I don't have no-rest areas, just wandering monsters. However, it would be just as easy to check for monsters in the vicinity of the companion, I guess.

#7
Frush O'Suggill

Frush O'Suggill
  • Members
  • 41 messages

Great ideas, thanks. How do you proceed when the current area is big and there are many hostiles all over the place? Do you check for range around the fallen henchman?

 

I've been experimenting with a few different methods to see which best suits the module I'm working on. Keep in mind it's single-player only, and story-driven versus hack and slash so I'm more concerned with enjoyable game flow than strict adherance to standard rules. Right now, I'm using NW_ASC_MODE_DYING to keep them in their unresponsive state, and in the heartbeat script, I check for LastHostileActor() so they don't recover if being actively attacked. This could easily be altered to check for the nearest enemy instead.

 

if (GetAssociateState(NW_ASC_MODE_DYING))
 {
  if (GetCurrentHitPoints()>1)
   {
    SetAssociateState(NW_ASC_MODE_DYING,FALSE);
    ClearAllActions();
    StopKeepingDead();
   }
  else if (!GetIsObjectValid(GetLastHostileActor()))
   {
    SetAssociateState(NW_ASC_MODE_DYING,FALSE);
    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_IMP_RESTORATION),OBJECT_SELF);
    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(OBJECT_SELF)),OBJECT_SELF);
    ClearAllActions();
    ghApplyDeathPenalty(OBJECT_SELF);
    StopKeepingDead();
   }
  else
   {
    KeepDead();
    return;
   }
 }

 

Parameters such as how much health should be recovered can be easily adjusted, as this is still a work in progress.

 

It should also be noted that I apply a curse effect through ghApplyDeathPenalty() that reduces all stats by one, cumulatively, each time the rez occurs, until removed by an NPC healer. This eventually renders the henchman basically useless, and hopefully discourages abuse of their auto-rez. This also discourages players from spamming respawn to get through encounters, since they get the curse as well.