Games Support Forums BioWare Info My Account Login Community Sign Up Store
Neverwinter Nights 2 Forums

NWN2: Builders - NWN2 Scripting

New Topic    Post Reply


    Add this To My Topics

   Go To Bottom

Author SoZ Death System scripts
Kaldor Silverwand
Game Owner
Profile: Kaldor SilverwandNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 20 Jun 2002
Posted: Saturday, 28 March 2009 12:39AM
Has anyone determined what is needed to have the SoZ Death System implemented in a campaign? I'm finishing up developing a campaign and I'd like to have the SoZ system used.

I don't need instructions on how to export and import a module, etc. If I have to spend a lot of time figuring it out I'll just stick with my already implemented modified OC-based death system. I don't want to significantly hold up completing the campaign just to get the better death system.

But if someone has already done the analysis, I'd like to take advantage of it. So, has anyone already figured it out?

Regards
  Profile: Kaldor Silverwand   Send Message To: Kaldor Silverwand
Korbu3
Game Owner
Profile: Korbu3NWN 2


Joined: 01 Sep 2008
Posted: Saturday, 28 March 2009 05:38AM
I may have something but I'm never sure about these scripts. Try opening an "X2" module from the nwn2/modules directory on your computer, and look at the module properties. Then open the scripts that are on the "OnRespawn, OnDeath, OnDying" and another script that is mentioned inside one of them.
I've been trying all night to figure out what to do with my script that is not working, and I actually managed without much effort to get the SoZ death system into my module, but that wasn't quite what I was looking for...
  Profile: Korbu3   Send Message To: Korbu3
Kaldor Silverwand
Game Owner
Profile: Kaldor SilverwandNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 20 Jun 2002
Posted: Thursday, 02 April 2009 02:36AM
Well, I got it to work. There is more to it than just the module scripts. I'm going to do a little more testing and then post my results so others do not have to figure it out.

Regards
  Profile: Kaldor Silverwand   Send Message To: Kaldor Silverwand
Kaldor Silverwand
Game Owner
Profile: Kaldor SilverwandNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 20 Jun 2002
Posted: Friday, 03 April 2009 10:53PM
So in setting up the SoZ death system in my own campaign 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 Death 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:
Code:

View Post/Code in separate window


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.

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 campaign though I wanted to do a little more. I decided that if the game is set to easy mode then I want the dead to pop back to life as in the OC, but on normal or harder the SoZ system should be used. I also wanted to apply an xp penalty to any character that died. To allow testing I added checks for a module variable that can be used to indicate which death system should be used in addition to checking the game difficulty. So, the scripts I have ended up with are slightly edited. I also removed the SoZ specific code from the scripts. This is what I have ended up with and so far they seem to be working as intended.

bb_deathpenalty is the script that applies the xp penalty.
NWScript:

View Post/Code in separate window



My modified versions of k_mod_load, k_mod_player_death, and k_mod_player_dying are renamed k_bb_mod_load, k_bb_mod_player_death, and k_bb_mod_player_dying, respectively and are here:

k_bb_mod_load
NWScript:

View Post/Code in separate window



k_bb_mod_player_death:
NWScript:

View Post/Code in separate window



k_bb_mod_player_dying:
NWScript:

View Post/Code in separate window




Regards
  Profile: Kaldor Silverwand   Send Message To: Kaldor Silverwand
Wyrin_D'njargo
Game Owner
Profile: Wyrin_D'njargoNWN 2
NWN 2: SoZ
Mass Effect PC


Joined: 16 Nov 2006
From: Cambridge, UK
Posted: Saturday, 04 April 2009 06:33AM
excellent - thanks for going through this
_________________
My blog

The Dark Avenger series
  Profile: Wyrin_D'njargo   Send Message To: Wyrin_D'njargo
Kaldor Silverwand
Game Owner
Profile: Kaldor SilverwandNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 20 Jun 2002
Posted: Saturday, 04 April 2009 04:17PM
Just correcting a typo in my post:

k_mod_player_dying (to be used as the module On Player Dying script)

Regards
  Profile: Kaldor Silverwand   Send Message To: Kaldor Silverwand
Segal
Game Owner
Profile: SegalNWN
NWN: SoU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 17 Oct 2001
From: Houston Texas
Posted: Thursday, 09 April 2009 04:01PM
This is super work Kaldor; add to my favorites.

Other than having to use the stupid campaign settings for a single module, this is exactly what I need.
_________________
Segal
Shroud World - A Quest Driven World
SW Player Guide - A Player Resource
  Profile: Segal   Send Message To: Segal
Kaldor Silverwand
Game Owner
Profile: Kaldor SilverwandNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 20 Jun 2002
Posted: Tuesday, 05 May 2009 04:27PM
Something else of significance in k_mod_load has been found.

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:
Code:

View Post/Code in separate window



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.

The code in the spawn script I am using looks like this:
NWScript:

View Post/Code in separate window



which should allow me to override the setting if need be for a specific NPC.

Unfortunately I do have some creatures that use non-standard spawn in scripts so I will need to fix them. Also you should make sure that your conversations will work regardless of who in the party is doing the talking. One nice thing about this is that the skill points for conversing that party members have should be relevant if they are doing the talking.

One additional thing I've noticed is that when a party member is between 0 and -9 hp and the party rests the party member recuperates. I guess that makes some sense as long as you do not allow resting everywhere in your campaign.

Regards

Edited By Kaldor Silverwand on 05/05/09 16:29

  Profile: Kaldor Silverwand   Send Message To: Kaldor Silverwand
ladydesire
Game Owner
Profile: ladydesireNWN 2
NWN 2: MotB
NWN 2: SoZ
Mass Effect PC


Joined: 05 Sep 2007
Posted: Tuesday, 05 May 2009 10:57PM
Thanks for this; I thought I had everything for the SoZ death system, but you pointed out one thing I had missed.
_________________
Dreams of Blue Fire blog, Class pack
  Profile: ladydesire   Send Message To: ladydesire
Kaldor Silverwand
Game Owner
Profile: Kaldor SilverwandNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 20 Jun 2002
Posted: Wednesday, 06 May 2009 12:55PM
Also noted that gb_comp_spawn, the standard spawn script for cohort/companions does not execute the creature spawn in script. This makes sense since originally the creature spawn in script was used to place treasure on creatures.

However, this means that if you want the cohorts/companions to be able to talk to an alternate party leader when your first PC is dead then you need to set their player can talk to non-player owned in their blueprint.

Regards

Edited By Kaldor Silverwand on 05/06/09 12:56

  Profile: Kaldor Silverwand   Send Message To: Kaldor Silverwand
Kaldor Silverwand
Game Owner
Profile: Kaldor SilverwandNWN
NWN: SoU
NWN: HotU
NWN 2
NWN 2: MotB
NWN 2: SoZ


Joined: 20 Jun 2002
Posted: Friday, 08 May 2009 03:57AM
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.

Regards
  Profile: Kaldor Silverwand   Send Message To: Kaldor Silverwand

New Topic    Post Reply

What do these icons mean?
Where can I learn how to use the forums?

Jump To:

Search Forums | Forums FAQ | Forum Archives

 

 

  Visit the Official Site | Technical Support
Neverwinter Nights 2 Official Support
Hide/Show

English
Deutsch
Français
Español
Italiano

Hide/Show

6,251,296 Users
178 Online
13 Logged In

9,046,484 posts in forums

Newest Forum Topics:
1. These forums are now closed (NWN 1: Scripting)

2. These forums are now closed (NWN2: Guilds and Registry)

3. These forums are now closed (BioWare News Discussion)

4. Can you level items? (NWN 1: Scripting)

5. Thank you! (NWN 1: Scripting)


Current time is: (set time)
Fri, 03 September 2010 12:54AM