PC not getting up after dying in a fight
#1
Posté 10 décembre 2013 - 07:45
If companions die during a fight, then once the fight is over, they correctly get up after the fight, with a couple HP.
But if the PC dies during the fight, he just stays dead.
What is happening here? What is the mechanism that causes them to raise back up after the fight? I can't seem to figure it out in the scripts.
#2
Posté 10 décembre 2013 - 08:21
the three primary functions are
- KnockOutCreature()
---> called from module onDeath 'k_mod_player_death' & companion onDeath 'gb_comp_death'
-> this starts:
- AttemptToWakeUpCreature()
---> loop that checks when/ if it's okay to resurrect
- WakeUpCreature() - do ressurection
There's a monkey wrech here, though. If the player is possessing a companion it won't run the companion scripts (necessarily). Instead, the Companion_Possessed scripts in nwn2_scriptsets.2da run. addenda:
- note that only onHB and onDeath events trigger for player-controlled characters (whether PC or other)
ps. there's also a little known script that runs when the player switches possession: 'gr_pc_spawn', which just turns the last-possessed object into a follower-type creature.
#3
Posté 10 décembre 2013 - 08:32
kevL wrote...
There's a monkey wrech here, though. If the player is possessing a companion it won't run the companion scripts (necessarily). Instead, the Companion_Possessed scripts in nwn2_scriptsets.2da run. addenda:
- note that only onHB and onDeath events trigger for player-controlled characters (whether PC or other)
.
So, given that information... I just tested it again. Didn't seem to make a difference whether I was possessing the PC or not. Once the PC died, he stayed dead. Companions ressurect, however.
This seems like a serious flaw to me. I don't remember having this trouble with the OC...
Is there a fix?
#4
Posté 10 décembre 2013 - 08:33
?
#5
Posté 10 décembre 2013 - 08:42
you may not have *changed* them but if they're not in place... ....
the pseudo-default module onDeath script is designed to exit if the character is not Owned by a player. Ie: the module onDeath is for PCs
the pseudo-default companion onDeath script is designed to exit if the character *is* Owned by a player. Ie: the companion onDeath is for companions
(but those are just defaults, and as suggested they might not even be currently in place on your module..)
#6
Posté 10 décembre 2013 - 09:06
You are correct: the module OnDeath is what happens for the PC. I needed to fix a couple lines.
In the k_mod_player_death script I had to change this line:
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oDead);
to this line
AssignCommand( oDead, KnockOutCreature( oDead ) );
I also had to change the last line to which executes the next script. It was calling k_death_remove_GUI, but it needed to be k_death_remove_gui. I am unsure if the casing was having an effect or not, but I changed it anyway.
In the k_death_remove_gui script I added this line at the top:
AttemptToWakeUpCreature(OBJECT_SELF);
And now it works just like the companions.
I was getting a bit nervous there.... Can't have the PC stay dead like that.
Modifié par ColorsFade, 10 décembre 2013 - 09:07 .
#7
Posté 10 décembre 2013 - 09:09
#8
Posté 10 décembre 2013 - 09:21
i doubt case matters for scriptnames, but like yourself, be consistentColorsFade wrote...
I also had to change the last line to which executes the next script. It was calling k_death_remove_GUI, but it needed to be k_death_remove_gui. I am unsure if the casing was having an effect or not, but I changed it anyway.
it's the only way to be sure...
#9
Posté 10 décembre 2013 - 09:27
andysks wrote...
Did you actually alter the k_mod_death or it caused the problem on its own Colors?
I don't think I had previously altered it at all. This just happened on its own accord.
#10
Posté 10 décembre 2013 - 09:34
... 'k_mod_player_death' rather
#11
Posté 10 décembre 2013 - 09:38
#12
Posté 10 décembre 2013 - 09:47
AssignCommand( oDead, KnockOutCreature( oDead ) );
I never touched this script. Never ever
I also don't have the last line you mentioned, but it's working fine.
#13
Posté 10 décembre 2013 - 10:15
OC and MotB use knockout
SoZ version doesn't
#14
Posté 10 décembre 2013 - 10:24
It makes sense now, since SoZ has the weird coin thing going on.





Retour en haut






