I had a module that has a custom death script that sends the player to a waypoint on respawn which was working just fine until I separated the module into multiple modules across a campaign. Now the script has ceased to work.
Here's the script:
//::///////////////////////////////////////////////
//:: Mokah's Module Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a player dies.
BK: October 8 2002: Overriden for Expansion
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////
// BMA-OEI 7/20/06 -- Temp death screen
// BMA-OEI 11/08/06 -- Added engine death GUI: SCREEN_DEATH_DEFAULT (ingamegui.ini) is force closed upon resurrection
const string GUI_DEFAULT_DEATH_SCREEN = "SCREEN_DEATH_DEFAULT";
// Resurrect and remove negative effects from oPlayer
void Raise( object oPlayer );
// Display death pop-up to oPlayer
void ShowDefaultDeathScreen( object oPlayer );
void main()
{
object oPlayer = GetLastPlayerDied();
location lLoc = GetLocation(GetWaypointByTag("wp_jw_death"));
// * increment global tracking number of times that I died
int iQuest = GetLocalInt(oPlayer,"NW_JOURNAL_ENTRYjw_jr_011");
if (iQuest < 30)
{
DelayCommand( 2.5f, Raise(oPlayer));
DelayCommand( 2.6f, AssignCommand(oPlayer,JumpToLocation(lLoc)));
SetLocalInt(oPlayer,"NW_JOURNAL_ENTRYjw_jr_011",iQuest+10);
}
else
{
EndGame("");
}
}
void ClearAllFactionMembers(object oMember, object oPlayer)
{
// AssignCommand(oMember, SpeakString("here"));
AdjustReputation(oPlayer, oMember, 100);
SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
object oClear = GetFirstFactionMember(oMember, FALSE);
while (GetIsObjectValid(oClear) == TRUE)
{
ClearPersonalReputation(oPlayer, oClear);
oClear = GetNextFactionMember(oMember, FALSE);
}
}
// Resurrect and remove negative effects from oPlayer
void Raise(object oPlayer)
{
effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
effect eBad = GetFirstEffect(oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
//Search for negative effects
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
{
//Remove effect if it is negative.
RemoveEffect(oPlayer, eBad);
eBad = GetFirstEffect(oPlayer);
}
else
eBad = GetNextEffect(oPlayer);
}
//Fire cast spell at event for the specified target
SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}
// Display death pop-up to oPlayer
void ShowDefaultDeathScreen( object oPlayer )
{
DisplayGuiScreen( oPlayer, GUI_DEFAULT_DEATH_SCREEN, FALSE );
//DisplayMessageBox( oPlayer, 0, GetStringByStrRef(181408), "gui_death_respawn_self", "", FALSE, "", 6603, "", 0, "" );
}
Can someone show me how to make this work across campaign modules? The waypoint in question is in a specific module so the script is having issues with this.
Modifié par MokahTGS, 19 juillet 2010 - 10:12 .





Retour en haut







