I am looking for a script or scripts that handle death and dying like SOZ does. That is, if a party member is brought to 0 hit points they tend to continue to lose hps until they die if not treated. The Dead stay dead until you use a raise dead or resurrection spell or use a "coin of life" or some such thing to bring the palyer back. I have looked over some scripts in NWN2 Vault but can't seem to recognize one that would accomplish the above, all though there is most likely a script for this and I just can't find it.
Any help would be greatly appreciated
Dead is Dead
Débuté par
JonnieR
, juil. 08 2011 07:58
#1
Posté 08 juillet 2011 - 07:58
#2
Posté 08 juillet 2011 - 08:04
Open SOZ in the toolset and take their work on the subject
#3
Posté 08 juillet 2011 - 08:07
^^ yup. No need to reinvent the wheel. In fact I isolated the code for use in Path of Evil so I could use both OC and SoZ death. It's in the module load scripts iirc.
#4
Posté 08 juillet 2011 - 08:28
Yes, I'll third this by saying you can just copy the On_Player_Dying scripts from the SoZ module properties, then compile this in the module you are working on.
I'm trying to recall, is this also a campaign level setting? I thought there was a field in the toolset's campaign editor plugin that had to be set to allow player death. I could be misremembering.
Harumph!
I'm trying to recall, is this also a campaign level setting? I thought there was a field in the toolset's campaign editor plugin that had to be set to allow player death. I could be misremembering.
Harumph!
#5
Posté 08 juillet 2011 - 10:08
Go into the campaign folder for SOZ and copy the k_mod_* scripts to your campaign folder and then open the toolset and assign the scripts to the module properties.
#6
Posté 08 juillet 2011 - 11:55
(Rewritten from my post in the legacy NWN2 forum)
There is more to it than just the module event scripts. When setting up the SoZ death system in my own campaigns this is what I have found:
First, this will only work in campaigns. Using the campaign editor plugin set PartyMemberDying to TRUE. If you do not do this then the player will not bleed from -1 to -10, and will instead jump right from 0 to -10.
The required scripts from SoZ are:
ginc_death
k_death_remove_gui
k_mod_load (to be used as the module On Load script)
k_mod_player_death (to be used as the module On Player Death script)
k_mod_player_dying (to be used as the module On Player Dying script)
k_mod_load contains some SoZ cohort specific code and some SoZ module specific trade code that can be commented out. The significant thing it is doing regarding the death system is this line:
SetGlobalInt( VAR_GLOBAL_NX2_TRANSITIONS, TRUE);
This line makes sure that dead party members are transitioned with the party when switching areas. Like the US Marines, no one is left behind.
If you allow characters to die and your first PC does, then when you try to have any other party member converse with an NPC the dead body of the first PC will switch with the conversing party member. To avoid this you can set all NPCs to be able to talk to non player-owned creatures. An easy way to do this if you do not want to alter all of the creature blueprints you have is to take advantage of a line in the k_mod_load script:
SetGlobalString("N2_SCRIPT_SPAWN_CREATURE", "kb_default_sp" );
This line sets a script name to be executed for any creature being spawned in with the standard spawn in script. This can be used to control treasure on creatures, but can also be used to set the talk to non player-owned creatures. Look at the bb_kingsfestival_sp script in my Kings Festival campaign if you want to do this.
A cautionary note about this: If you have NPCs set to speak to non player owned creatures then you may have a problem if you use the gb_surrender_hb script. This script causes a creature to surrender after being damaged and then start a conversation with the nearest party member. If the NPC is set to talk to non-player owned creatures then it may start a conversation with someone other than your currently selected PC, in which case the conversation will not work properly.
k_mod_player_death is pretty clean and doesn't contain any SoZ specific code that can be removed. It executes the k_death_remove_gui script.
k_mod_player_dying doesn't contain any SoZ specific code that can be removed.
As long as your companions use the standard gb_comp scripts they should be handled correctly.
So if all you want is to mimic the SoZ death system in your campaign the above should be enough.
In my campaigns I do quite a bit more though so that in easy mode the death system from the OC is used rather than the SoZ system. I also apply xp penalties for dying.
Regards
There is more to it than just the module event scripts. When setting up the SoZ death system in my own campaigns this is what I have found:
First, this will only work in campaigns. Using the campaign editor plugin set PartyMemberDying to TRUE. If you do not do this then the player will not bleed from -1 to -10, and will instead jump right from 0 to -10.
The required scripts from SoZ are:
ginc_death
k_death_remove_gui
k_mod_load (to be used as the module On Load script)
k_mod_player_death (to be used as the module On Player Death script)
k_mod_player_dying (to be used as the module On Player Dying script)
k_mod_load contains some SoZ cohort specific code and some SoZ module specific trade code that can be commented out. The significant thing it is doing regarding the death system is this line:
SetGlobalInt( VAR_GLOBAL_NX2_TRANSITIONS, TRUE);
This line makes sure that dead party members are transitioned with the party when switching areas. Like the US Marines, no one is left behind.
If you allow characters to die and your first PC does, then when you try to have any other party member converse with an NPC the dead body of the first PC will switch with the conversing party member. To avoid this you can set all NPCs to be able to talk to non player-owned creatures. An easy way to do this if you do not want to alter all of the creature blueprints you have is to take advantage of a line in the k_mod_load script:
SetGlobalString("N2_SCRIPT_SPAWN_CREATURE", "kb_default_sp" );
This line sets a script name to be executed for any creature being spawned in with the standard spawn in script. This can be used to control treasure on creatures, but can also be used to set the talk to non player-owned creatures. Look at the bb_kingsfestival_sp script in my Kings Festival campaign if you want to do this.
A cautionary note about this: If you have NPCs set to speak to non player owned creatures then you may have a problem if you use the gb_surrender_hb script. This script causes a creature to surrender after being damaged and then start a conversation with the nearest party member. If the NPC is set to talk to non-player owned creatures then it may start a conversation with someone other than your currently selected PC, in which case the conversation will not work properly.
k_mod_player_death is pretty clean and doesn't contain any SoZ specific code that can be removed. It executes the k_death_remove_gui script.
k_mod_player_dying doesn't contain any SoZ specific code that can be removed.
As long as your companions use the standard gb_comp scripts they should be handled correctly.
So if all you want is to mimic the SoZ death system in your campaign the above should be enough.
In my campaigns I do quite a bit more though so that in easy mode the death system from the OC is used rather than the SoZ system. I also apply xp penalties for dying.
Regards
#7
Posté 09 juillet 2011 - 06:26
The check to have compagnion stay really dead is on the compagnion hearbat it seems.
Those value in module script are just initialisation for the check on the heartbat
Those value in module script are just initialisation for the check on the heartbat





Retour en haut






