Home Forum Index Neverwinter Nights 2 NWN2: Builders - NWN2 Scripting SoZ Death System scripts
NWN2: Builders - NWN2 Scripting
Kaldor Silverwand
Game OwnerNWN 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
Korbu3
Game OwnerNWN 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...
Kaldor Silverwand
Game OwnerNWN 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
Kaldor Silverwand
Game OwnerNWN 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: 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:
// bb_deathpenalty
// by Brendan Bellina
// May, 2007
// Can be used in the DeathScript variable of companions and also executed from
// the bb_mod_player_death script.
#include "ginc_companion"
#include "ginc_death"
#include "ginc_debug"
#include "nw_i0_plot"
// * Applies an XP penalty
void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
int nPenalty = 50 * GetHitDice(oDead);
int nHD = GetHitDice(oDead);
// * You cannot lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;
int nNewXP = nXP - nPenalty;
// Because NPC's may have been created with a smaller
// amount of xp then level warrants, check for that, otherwise
// we may mistakenly add to their xp when they die.
if (nXP >= nMin) // if greater than or equal to the level minimum xp
{
if (nNewXP < nMin) nNewXP = nMin;
}
if (nNewXP < 0) nNewXP = 0;
SetXP(oDead, nNewXP);
/* leave the gold alone, just take xp
int nGoldToTake = FloatToInt(0.10 * GetGold(oDead));
// * a cap of 10 000gp taken from you
if (nGoldToTake > 10000)
{
nGoldToTake = 10000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
*/
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));
}
void main()
{
if ( GetIsObjectInParty( OBJECT_SELF ) == TRUE )
ApplyPenalty( OBJECT_SELF );
}
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_loadNWScript:
// k_bb_mod_load
/*
Module Load event
based on SoZ k_mod_load
modified by Brendan Bellina for King's Festival campaign
if game mode is very easy or easy then do not turn on NX2 Transitions
*/
// 8/16/05 ChazM (OEI) - created, added SpawnCompanions()
// 10/20/05 ChazM (OEI) - modified item event related stuff
// 11/18/05 ChazM (OEI) - Add Companions To Roster instead of Spawning them
// 12/1/05 ChazM (OEI) - Now useing ginc_companions
// 1/13/06 ChazM (OEI) - Modified roster companion additions to only happen once
// 2/22/06 DBR - Setup Default Destinations for Overland map.
// 3/02/06 DBR - Put in the Gather Party variable. I'm Sorry.
// 8/17/06 BDF - Since we don't use personal reputation, we have to make the spell
// targeting system aware of this somehow (x0_i0_spells: spellsIsTarget());
// USES_PERSONAL_REPUTATION = FALSE
// 9/18/06 ChazM - added switch MODULE_SWITCH_ENABLE_MULTI_HENCH_AOE_DAMAGE + other comments; fixed global flags
// 10/08/06 BMA-OEI - Added CAMPAIGN_SWITCH_UNPLOT_ON_ROSTER_SPAWN flag for Patch 1
// 3/8/07 ChazM - set N2_SCRIPT_SPAWN_CREATURE (to kb_default_sp)
// ChazM 5/3/07 - Companion Initialization
// MDiekmann 6/6/07 - Added CAMPAIGN_SWITCH_ONLY_SHOW_TIME which sets in game clock popup to not show the specific date
// ChazM 6/11/07 - If campaign switch enabled, smith hammer can be used to rename any item.
// ChazM 6/11/07 - If campaign switch enabled, showing world map will attempt single player autosave.
// ChazM 6/14/07 - Added CAMPAIGN_VAR_WM_MIN_THRESHOLD
// ChazM 6/18/07 - Defualt Max Henchmen to 5
// ChazM 6/19/07 - Set max henchmen for each module
// MDiekmann 7/25/07 - Checks and set OOM's custom title token.
// ChazM 8/9/07 - NX1 uses CAMPAIGN_SWITCH_CRAFTING_USE_TOTAL_LEVEL for the caster level rules (promotes use of crafting)
// ChazM 8/13/07 - NX1 uses CAMPAIGN_SWITCH_REST_SYS_USE_FORCE_REST for the rest rules (removes unwanted rest progress bar)
// TDE 6/20/08 - Adapted script for NX2
// NLC 7/3/08 - Added in NX2 Transition Flag.
#include "x2_inc_switches"
#include "ginc_restsys"
//#include "kinc_cohort" - commented out by Brendan Bellina
#include "ginc_transition"
#include "ginc_debug"
//#include "kinc_trade"
//#include "kinc_trade_system" - commented out by Brendan Bellina
const string VAR_MODULE_SETUP_FLAG = "MODULE_SETUP_FLAG";
const string VAR_CAMPAIGN_SETUP_FLAG = "CAMPAIGN_SETUP_FLAG";
void main()
{
PrintString("Module load fired for module " + GetName(OBJECT_SELF));
if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
{
// * Setting the switch below will enable a seperate Use Magic Device Skillcheck for
// * rogues when playing on Hardcore+ difficulty. This only applies to scrolls
SetModuleSwitch (MODULE_SWITCH_ENABLE_UMD_SCROLLS, TRUE);
// ChazM: this doesn't appear to be used anywhere...
// * Activating the switch below will make AOE spells hurt neutral NPCS by default
// SetModuleSwitch (MODULE_SWITCH_AOE_HURT_NEUTRAL_NPCS, TRUE);
// ChazM: controls whether NPC can hurt each other with AOE's.
//SetModuleSwitch (MODULE_SWITCH_ENABLE_NPC_AOE_HURT_ALLIES, TRUE);
// ChazM: controls whether a PC party can hurt each other with AOE's.
//SetModuleSwitch (MODULE_SWITCH_ENABLE_MULTI_HENCH_AOE_DAMAGE, TRUE);
}
// * AI: Activating the switch below will make the creaures using the WalkWaypoint function
// * able to walk across areas
// SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE);
// * Spells: Activating the switch below will make the Glyph of Warding spell behave differently:
// * The visual glyph will disappear after 6 seconds, making them impossible to spot
// SetModuleSwitch (MODULE_SWITCH_ENABLE_INVISIBLE_GLYPH_OF_WARDING, TRUE);
// * Craft Feats: Want 50 charges on a newly created wand? We found this unbalancing,
// * but since it is described this way in the book, here is the switch to get it back...
// SetModuleSwitch (MODULE_SWITCH_ENABLE_CRAFT_WAND_50_CHARGES, TRUE);
// * Craft Feats: Use this to disable Item Creation Feats if you do not want
// * them in your module
// SetModuleSwitch (MODULE_SWITCH_DISABLE_ITEM_CREATION_FEATS, TRUE);
// * Palemaster: Deathless master touch in PnP only affects creatures up to a certain size.
// * We do not support this check for balancing reasons, but you can still activate it...
// SetModuleSwitch (MODULE_SWITCH_SPELL_CORERULES_DMASTERTOUCH, TRUE);
// * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
// * did not fit into NWNs spell system and was confusing, so we took it out...
// SetModuleSwitch (MODULE_SWITCH_EPIC_SPELLS_HURT_CASTER, TRUE);
// * Epic Spellcasting: Some Epic spells feed on the liveforce of the caster. However this
// * did not fit into NWNs spell system and was confusing, so we took it out...
// SetModuleSwitch (MODULE_SWITCH_RESTRICT_USE_POISON_TO_FEAT, TRUE);
// * Spellcasting: Some people don't like caster's abusing combat expertise to raise their AC
// * Uncommenting this line will drop expertise mode whenever a spell is cast by a player
// SetModuleSwitch (MODULE_VAR_AI_STOP_EXPERTISE_ABUSE, TRUE);
// * Item Event Scripts: The game's default event scripts allow routing of all item related events
// * into a single file, based on the tag of that item. If an item's tag is "test", it will fire a
// * script called "test" when an item based event (equip, unequip, acquire, unacquire, activate,...)
// * is triggered. Check "x2_it_example.nss" for an example.
// * This feature is disabled by default.
SetModuleSwitch (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS, TRUE);
// Enabling this causes tagbased scripting to use 7 different scripts for item events instead of
// having them packaged all in one.
// The scripts are postfixed with "_aq", "_ua", "_eq", "_ue", "_ac", "_ci", and "hc"
SetModuleSwitch (MODULE_SWITCH_ENABLE_SEPERATE_ITEM_SCRIPTS, TRUE);
if (GetModuleSwitchValue (MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)
{
// * If Tagbased scripts are enabled, and you are running a Local Vault Server
// * you should use the line below to add a layer of security to your server, preventing
// * people to execute script you don't want them to. If you use the feature below,
// * all called item scrips will be the prefix + the Tag of the item you want to execute, up to a
// * maximum of 16 chars, instead of the pure tag of the object.
// * i.e. without the line below a user activating an item with the tag "test",
// * will result in the execution of a script called "test". If you uncomment the line below
// * the script called will be "1_test.nss"
SetUserDefinedItemEventPrefix("i_");
}
// * This initializes the wandering monster system.
// * If you want to use it, make sure you use an appropriate script such as "gmod_def_rest" as your module's OnRest Script
// SetModuleSwitch (MODULE_SWITCH_USE_XP2_RESTSYSTEM, TRUE);
// Line below commented out by Brendan Bellina
// SetModuleSwitch (MODULE_SWITCH_USE_NX1_SINGLE_PARTY_RESTSYSTEM, TRUE);
if ((GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE) ||
(GetModuleSwitchValue(MODULE_SWITCH_USE_NX1_SINGLE_PARTY_RESTSYSTEM) == TRUE))
{
// * This allows you to specify a different 2da for the wandering monster system.
WMSet2DAFileName(WM_DEFAULT_2DA_FILE); // "restsys_wm_table"
WMBuild2DACache();
}
// This check was moved outside of single campaign check so that difficulty can be changed mid game
if (!(GetGameDifficulty() == GAME_DIFFICULTY_VERY_EASY || GetGameDifficulty() == GAME_DIFFICULTY_EASY
|| GetLocalInt(OBJECT_SELF, "BB_GAMEDIFF") == 1 || GetLocalInt(OBJECT_SELF, "BB_GAMEDIFF") == 2))
{
// This variable enables the NX2 Transition system. This modifies transitions such that you are allowed to
// transition with dead party members, those party members aren't ressed, and it only requires you to gather
// player controlled creatures.
SetGlobalInt( VAR_GLOBAL_NX2_TRANSITIONS, TRUE);
}
// Only setup once for entire campaign
if ( GetGlobalInt(VAR_CAMPAIGN_SETUP_FLAG) == FALSE )
{
SetGlobalInt(VAR_CAMPAIGN_SETUP_FLAG, TRUE );
// Add all campaign companions to roster for easy access
// 2 lines below commented out by Brendan Bellina
// PrettyDebug("k_mod_load: About to Initialize NX2 Cohorts");
// InitializeNX2Cohorts();
//SetupDefaultDestinations();
//This variable makes all transitions a "gather your party" transition.
SetGlobalInt( VAR_GLOBAL_GATHER_PARTY, TRUE );
// Defaults weapons visible during conversations - checked on Creature SpawnIn
// May be unnecessary in future build.
//SetGlobalInt( CAMPAIGN_CUTSCENE_WEAPONS_VISIBLE, TRUE );
// Force kills dominated group members if no valid members remain - checked on HeartBeat ( nw_g0_dominate )
SetGlobalInt( CAMPAIGN_SWITCH_FORCE_KILL_DOMINATED_GROUP, TRUE );
// Removes effect and prevents transition if object is dominated - checked in ginc_transition / nw_g0_transition
SetGlobalInt( CAMPAIGN_SWITCH_REMOVE_DOMINATED_ON_TRANSITION, TRUE );
// A flag that reflects the engine setting for whether or not we use personal reputation; this is a consideration in spell targeting
// Line below commented out by Brendan Bellina
// SetGlobalInt( CAMPAIGN_SWITCH_USE_PERSONAL_REPUTATION, FALSE );
// standard script for spawn modifications for this campaign
// Line below commented out by Brendan Bellina
// SetGlobalString("N2_SCRIPT_SPAWN_CREATURE", "kb_default_sp" );
// Allow date to be shown for this campaign
SetGlobalInt( CAMPAIGN_SWITCH_ONLY_SHOW_TIME, FALSE );
// can the smith hammer be used to rename any item?
SetGlobalInt( CAMPAIGN_SWITCH_SMITH_HAMMER_RENAME_ITEM, TRUE );
// Enables single player auto save on world map transition
SetGlobalInt( CAMPAIGN_SWITCH_WORLD_MAP_AUTO_SAVE, TRUE );
// Set minimum value for wandering monsters check. Default is 0 (all rolls allowed)
SetGlobalInt( CAMPAIGN_VAR_WM_MIN_THRESHOLD, 15);
// Set use of total level for determining caster level for magical crafting.
SetGlobalInt( CAMPAIGN_SWITCH_CRAFTING_USE_TOTAL_LEVEL, TRUE);
// This will cause the NX1 single party rest system to use ForceRest instead of ActionRest (thus no resting bar)
SetGlobalInt( CAMPAIGN_SWITCH_REST_SYS_USE_FORCE_REST, TRUE );
}
// stuff to do just once per module
if ( GetLocalInt(OBJECT_SELF, VAR_MODULE_SETUP_FLAG) == FALSE )
{
SetLocalInt(OBJECT_SELF, VAR_MODULE_SETUP_FLAG, TRUE);
// Set up how many cohorts we can have in the party
// if ( GetGlobalInt("00_nMaxCohorts") == 0)
// SetGlobalInt("00_nMaxCohorts", 1);
// SetMaxHenchmen(4 + GetGlobalInt("00_nMaxCohorts"));
/* Commented out by Brendan Bellina
// Entering the Sword Coast for the first time, set the hangout waypoints
// of all recruited Samarach cohorts to Merchant HQ in Crossroad Keep.
if ( GetTag(OBJECT_SELF) == "F_X2" )
{
SetHangoutIfSelectable("co_umoja", "m_hangout_co_umoja");
SetHangoutIfSelectable("co_inshula", "m_hangout_co_inshula");
SetHangoutIfSelectable("co_lastri", "m_hangout_co_lastri");
SetHangoutIfSelectable("co_chir", "m_hangout_co_chir");
}
*/
}
/* Commented out by Brendan Bellina
//Handle TradeGood/Rareresource conversion.
if ( GetTag(OBJECT_SELF) == "F_X2" )
{
int nOre = GetPartyStock(RES_ORE, FALSE);
int nLumber = GetPartyStock(RES_LUMBER, FALSE);
int nSkins = GetPartyStock(RES_SKINS, FALSE);
if(nOre)
{
SetPartyStock(GOOD_ORE, nOre);
SetPartyStock(RES_ORE, 0, FALSE);
}
if(nLumber)
{
SetPartyStock(GOOD_TIMBER, nLumber);
SetPartyStock(RES_LUMBER, 0, FALSE);
}
if(nSkins)
{
SetPartyStock(GOOD_SKINS, nSkins);
SetPartyStock(RES_SKINS, 0, FALSE);
}
}
else if ( GetTag(OBJECT_SELF) == "G_X2" )
{
int nOre = GetPartyStock(GOOD_ORE, TRUE);
int nLumber = GetPartyStock(GOOD_TIMBER, TRUE);
int nSkins = GetPartyStock(GOOD_SKINS, TRUE);
if(nOre)
{
SetPartyStock(RES_ORE, nOre, FALSE);
SetPartyStock(GOOD_ORE, 0);
}
if(nLumber)
{
SetPartyStock(RES_LUMBER, nLumber, FALSE);
SetPartyStock(GOOD_TIMBER, 0);
}
if(nSkins)
{
SetPartyStock(RES_SKINS, nSkins, FALSE);
SetPartyStock(GOOD_SKINS, 0);
}
}
// need to call after AddCompanionsToRoster so it will work in the first module.
SpawnNX2CohortRosterMembersAtHangout();
// 10/08/06 BMA-OEI: Out of CAMPAIGN_SETUP_FLAG block for Patch 1
// Set companion's Plot Flag FALSE on UserDefined EVENT_ROSTER_SPAWN_IN (2051)
SetGlobalInt( CAMPAIGN_SWITCH_UNPLOT_ON_ROSTER_SPAWN, TRUE );
// set up custom ipspeaker script
SetGlobalString(CAMPAIGN_STRING_CUSTOM_IPSPEAKER , "ka_get_party_leader");
*/
}
View Post/Code in separate window k_bb_mod_player_death:NWScript:
// k_bb_mod_player_death
/*
Module OnDeath handler to queue KnockOut script for owned PCs
*/
// BMA-OEI 12/19/05
// BMA-OEI 2/28/06 -- DeathScript support
// BMA-OEI 8/10/10 -- Exit if not owned by player (e.g. possessed companions)
// MDiekmann 7/10/07 - Modified to cause game ending condition if caused by spirit eater death
// TDE 6/20/08 - Adapted script for NX2
// Brendan Bellina - Added call to bb_deathpenalty script (except when very easy difficulty setting)
// - Added knockout script if very easy or easy difficulty or not NX2 Transitions
// - Added ginc_transition
#include "ginc_death"
#include "ginc_debug"
#include "ginc_transition" // Added by Brendan Bellina
void main()
{
object oDead = GetLastPlayerDied();
PrintString( "k_mod_player_death: " + GetName(oDead) + " executing OnPlayerDeath event" );
// Abort if dying character is not an owned PC
if ( GetIsOwnedByPlayer( oDead ) == FALSE )
{
PrintString( "** k_mod_player_death: " + GetName(oDead) + " not owned by a player. ABORT!" );
return;
}
// BB modification to allow bounce back to life if very easy or easy difficulty (or module variable set to very easy or easy)
if (!GetGlobalInt( VAR_GLOBAL_NX2_TRANSITIONS)
|| (!(GetGameDifficulty() == GAME_DIFFICULTY_VERY_EASY || GetGameDifficulty() == GAME_DIFFICULTY_EASY
|| GetLocalInt(GetModule(), "BB_GAMEDIFF") == 1 || GetLocalInt(GetModule(), "BB_GAMEDIFF") == 2)))
{
// Making sure, here.
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDeath(), oDead);
}
// BB modification to apply xp penalty unless game difficulty is very easy (or module variable set to very easy)
if (!(GetGameDifficulty() == GAME_DIFFICULTY_VERY_EASY || GetLocalInt(GetModule(), "BB_GAMEDIFF") == 1))
ExecuteScript( "bb_deathpenalty", oDead); // Apply the penalty for death if not very easy setting
// Check for additional death script
string sDeathScript = GetLocalString( oDead, "DeathScript" );
if ( sDeathScript != "" ) ExecuteScript( sDeathScript, oDead );
// BB modification to allow bounce back to life if very easy or easy difficulty (or module variable set to very easy or easy)
if (!GetGlobalInt( VAR_GLOBAL_NX2_TRANSITIONS)
|| (GetGameDifficulty() == GAME_DIFFICULTY_VERY_EASY || GetGameDifficulty() == GAME_DIFFICULTY_EASY
|| GetLocalInt(GetModule(), "BB_GAMEDIFF") == 1 || GetLocalInt(GetModule(), "BB_GAMEDIFF") == 2))
{
// Queue knockout script
AssignCommand( oDead, KnockOutCreature( oDead ) );
return; // move on, nothing more to see here
}
// Check if there are any members left for PC to possess
if ( GetIsOwnedByPlayer(oDead) == TRUE || GetIsRosterMember(oDead) == TRUE )
{
if ( GetIsDeathPopUpDisplayed(oDead) == FALSE )
{
if ( GetIsPartyPossessible(oDead) == FALSE )
{
PrettyDebug( "*** NO ONE LEFT! ***", 30.0 );
ShowProperDeathScreen( oDead );
}
}
}
ExecuteScript("k_death_remove_GUI", oDead);
}
View Post/Code in separate window k_bb_mod_player_dying:NWScript:
// k_bb_mod_player_dying
// *** Force module player death event
// BMA-OEI 12/19/05
// Brendan Bellina - Added normal death if very easy or easy or not NX2 Transitions
// - Added ginc_transition
#include "ginc_debug"
#include "ginc_death"
#include "ginc_transition" // Added by Brendan Bellina
void main()
{
object oPC = GetLastPlayerDying();
// BB modification to allow bounce back to life if very easy or easy difficulty (or module variable set to very easy or easy)
if (!GetGlobalInt( VAR_GLOBAL_NX2_TRANSITIONS)
|| (GetGameDifficulty() == GAME_DIFFICULTY_VERY_EASY || GetGameDifficulty() == GAME_DIFFICULTY_EASY
|| GetLocalInt(GetModule(), "BB_GAMEDIFF") == 1 || GetLocalInt(GetModule(), "BB_GAMEDIFF") == 2))
{
effect eDeath = EffectDeath(FALSE, FALSE);
// *** Force Module OnPlayerDeath
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oPC);
return;
}
effect eHPLoss = EffectHitPointChangeWhenDying(-1.0f);
// effect eIcon = EffectEffectIcon(19);
// effect eLink = EffectLinkEffects(eIcon,eHPLoss);
// JWR-OEI 09/24/2008
// Loop through effects and remove all from "Frenzy".
// If we end up needing to remove more than just "Frenzy"
// we need to make a "RemoveEffectsWhileDying()" function and
// place it in ginc_death
effect e1 = GetFirstEffect(oPC);
while (GetIsEffectValid(e1))
{
// if spell came from frenzy, remove it.
if (GetEffectSpellId(e1) == SPELLABILITY_FRENZY )
{
RemoveEffect(oPC, e1);
}
e1 = GetNextEffect(oPC);
}
// END Frenzy removal code. JWR-OEI
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHPLoss, oPC);
if ( GetIsOwnedByPlayer(oPC) == TRUE || GetIsRosterMember(oPC) == TRUE )
{
if ( GetIsDeathPopUpDisplayed(oPC) == FALSE )
{
if ( GetIsPartyPossessible(oPC) == FALSE )
{
PrettyDebug( "*** NO ONE LEFT! ***", 30.0 );
ShowProperDeathScreen( oPC );
}
}
}
}
View Post/Code in separate window Regards
Wyrin_D'njargo
Game OwnerNWN 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
Kaldor Silverwand
Game OwnerNWN 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
Segal
Game OwnerNWN 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. _________________ SegalShroud World - A Quest Driven WorldSW Player Guide - A Player Resource
Kaldor Silverwand
Game OwnerNWN 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: 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:
// bb_kingsfestival_sp
/*
This is the campaign level creature spawn modifications script for the King's Festival campaign.
This is defined in the module load script (k_bb_mod_load) and is executed in the beginning of the standard
on spawn script for creatures (nw_c2_default9).
*/
// B Bellina 5/09
void main()
{
// Unless BB_USEMYTALKVAL is 1 allow creature to talk to any party member
if (GetLocalInt(OBJECT_SELF, "BB_USEMYTALKVAL") != 1)
SetCanTalkToNonPlayerOwnedCreatures(OBJECT_SELF, TRUE);
} 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. RegardsEdited By Kaldor Silverwand on 05/05/09 16:29
ladydesire
Game OwnerNWN 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
Kaldor Silverwand
Game OwnerNWN 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. RegardsEdited By Kaldor Silverwand on 05/06/09 12:56
Kaldor Silverwand
Game OwnerNWN 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
What do these icons mean?
Where can I learn how to use the forums?
Jump To:
Select A Forum
BioWare General
-- BioWare Online Store Support
-- Web Site Help
-- BioWare News Discussion
Premium Neverwinter Nights Modules
-- Premium Neverwinter Nights 1 Modules Dis...
-- Premium Neverwinter Nights 1 Modules Tec...
Neverwinter Nights
-- NWN 1: General Discussion (No Spoilers ...
-- NWN 1: Players - Official Campaign (Spo...
-- NWN 1: Players - SoU Official Campaign (...
-- NWN 1: Players - HotU Official Campaign ...
-- NWN 1: Modules Discussion
-- NWN 1: Community Expansion Pack (CEP)
-- NWN 1: Guilds and Registry - Ye Olde Tav...
-- NWN 1: Dungeon Master's Realm
-- NWN 1: Toolset
-- NWN 1: Scripting
-- NWN 1: Custom Content
-- NWN 1: For Developers
-- NWN 1/SoU/HotU Technical Support (Self-H...
-- NWN 1: Server Admin
-- NWN 1: Linux Version - General Discussio...
-- NWN 1: Macintosh Version - General Discu...
Old Dragon Age Forums
-- Dragon Age (Old)
-- Dragon Age: Origins General Discussion
Sonic Chronicles: The Dark Brotherhood
-- Sonic Chronicles Storyline and Strategy ...
-- Sonic Chronicles: The Dark Brotherhood G...
Baldur's Gate II Series
-- Baldur's Gate II: SoA and ToB General Di...
-- Baldur's Gate II Gameplay (Spoilers!)
-- Baldur's Gate II: SoA and ToB Technical ...
Baldur's Gate Series
-- Baldur's Gate and Tales of the Sword Coa...
-- Baldur's Gate Gameplay (Spoilers!)
-- Baldur's Gate and TotSC Technical Suppor...
MDK2
-- MDK2 Gameplay (Spoilers!)
-- MDK2 General Discussion
-- MDK2 Technical Support
Shattered Steel
-- Shattered Steel General Discussion
Star Wars: Knights of the Old Republic
-- Official Announcements - Star Wars: Knig...
-- Storyline Discussion (Spoilers Warning) ...
-- Xbox Version (Spoilers Will Be Moved) - ...
-- PC/Mac Version (Spoilers Will Be Moved) ...
-- Technical Support (Self-Help) - Star War...
Jade Empire Forums
-- Jade Empire PC General Discussion (Spoil...
-- Jade Empire Xbox General Discussion (Spo...
-- Jade Empire Storyline and Strategy Discu...
-- Jade Empire Technical Support (Self-Help...
Neverwinter Nights 2
-- NWN2: General discussion forums for NWN2...
-- NWN2: Players - NWN2 Official Campaign (...
-- NWN2: Players - Mask of The Betrayer Cam...
-- NWN2: Players - Storm of Zehir (Spoilers...
-- NwN2: Mysteries of Westgate Adventure Pa...
-- NWN2: Modules
-- NWN2: Guilds and Registry
-- NWN2: Builders - NWN2 Toolset
-- NWN2: Builders - NWN2 Scripting
-- NWN2: Custom Content
-- NWN2: Dungeon Masters Realm
-- NWN2: Persistent Worlds & Multiplayer
-- NWN2: For the Mac
-- NWN2: Tools and Plugin Developers
-- NWN2: Technical Support (Self-Help)
Mass Effect Forums
-- Mass Effect 2 General Discussion (No ME1...
-- Mass Effect 1 General Discussion (No spo...
-- Mass Effect PC Version General Discussio...
-- Mass Effect Storyline and Strategy Discu...
-- Mass Effect for PC Technical Support (Se...
-- Mass Effect for Xbox 360 Technical Suppo...
Archives: Neverwinter Nights
-- Archives: For Everyone - NWN General Di...
-- Archives: NWN HotU General Discussion
-- Archives: NWN SoU General Discussion
-- Archives: Players - NWN Official Campaig...
-- Archives: Witch's Wake Discussion
-- Archives - Players - NWN Modules
-- Archives: Players - Ye Olde Tavern
-- Archives: DMs - Dungeon Master's Realm
-- Archives: Builders - NWN Toolset
-- Archives: Builders - NWN Scripting
-- Archives: Builders - NWN Custom Content
-- Archives: NWN Technical Support (Self-He...
Pre-Release NWN Archives
-- Archives - NWN Official Announcements
-- Archives - General Discussion
-- Archives - Ye Olde Tavern
-- Archives - Dungeon Master's Realm
-- Archives - Models and Model Viewer
-- Archives - Beta Toolset General
-- Archives - Beta Toolset Technical Issues
-- Archives - Beta Toolset Bug Reporting
Forums Archives
-- Archives - Baldur's Gate II Gameplay (Sp...
-- Archives - Off Topic
-- Archives: Baldur's Gate II: SoA and ToB ...
Archives: Star Wars: Knights of the Old Republic
-- Archives: Xbox Version (Spoilers Will Be...
-- Archives: PC/Mac Version (Spoilers Will ...
-- Archives: Storyline Discussion (Spoilers...
Jade Empire Archives
-- Archives - Jade Empire General Discussio...
NwN2 - Pre-Release Archives
-- NWN 2 Art and Graphics Engine
-- NWN 2 Gameplay and Rules
-- NWN 2 Toolset and Custom Content
-- NWN 2 Single Player Campaign
-- NWN 2 General Discussion
Search Forums |
Forums FAQ |
Forum Archives
NeverWinter Nights 2, Forgotten Realms and the Forgotten Realms logo, Dungeons & Dragons, D&D, and the Dungeons & Dragons logo, and Wizards of the Coast and its logo are trademarks of Wizards of the Coast, Inc., in the U.S.A. and other countries, and are used with permission. © 2004 Wizards. Software © 2004 Atari Interactive, Inc. All rights reserved. HASBRO and its logo are trademarks of Hasbro and are used with permission. Windows is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries. Manufactured and marketed by Atari, Inc., New York, NY. All other trademarks are the property of their respective owners.
Powered by BioBoards Version 3.00.0 10.1.12.31
Web Site Help
Jobs | Website Terms of Use Agreement | Privacy Policy
Rules of Conduct | Copyright and Trademark Information