Aller au contenu

Photo

Custom Dev Crit save crashing mod on pc death


  • Veuillez vous connecter pour répondre
23 réponses à ce sujet

#1
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
Naturally as the title says, the custom script i snagged off the nwvault and placed into my mod crashes it on a pc death, not even necessarily by dev crit. Any player caused death causes the server to lock up. I was hoping any of you fine gents would be able to help me solve this issue. In case it was a scripting conflict of sorts i loaded this into a blank mod and it still crashed, so I assume the problem is with the code itself. Id like to allow dev crit just lower its potential DC so its not so OP if not ill just disallow it again *shrugs*. Thanks in advanced guys, but if it helps any I run CEP2.4 with no other haks or ondeath functions (that i can recall atm)

Its called on via a code in the mod onplayerdeath via this:
if (DevCritSaveFix()) return;

Heres the code:
Link

Modifié par NightbladeCH, 15 août 2012 - 08:02 .


#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Did you mark the creature as raisable?

#3
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
it works fine vs creatures, its vs players that it causes the crash....so...yea?
Not sure if i have to set players as rezable, i dont believe so....
*Edit*
It only crashes JUST at the moment of the PC's death, we dont see the player die server merely locks up

Modifié par NightbladeCH, 15 août 2012 - 11:56 .


#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
Ok, I missed the point that it was on PC script.

Go back and look at the script, Keeping in mind that onplayerdeath is a module Event. So every place in that script where you have OBJECT_SELF, You are trying to DO/Get/Set that on the module, not the PC. You will see that most of it makes no since when being done to the module.

#5
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
I got it from the vault, so in the code the OBJECT_SELF bit is pointing to the module because its a module based code? So i should do somethin like GetLastKilled code for the modified save? Do you want to see my Death Script as well? Not much in it really

#6
ffbj

ffbj
  • Members
  • 593 messages
This script was originally designed to be part of the ondeath of creatures not on the pc's module on death event. For instance top you have:

int iCurrentHP = GetCurrentHitPoints(OBJECT_SELF);
object oPC = GetLastKiller();
objectself refers to the creature/npc who has this script in their ondeath slot.
oPC of course refers to the PC with devasting critical as they have just killed objectself.
So I would suggest to just do an executable on the ondeath of your creatures your standard ondeath default 7 I think. and just call they script from there by checking if get lastkiller has the said feat. And just use the default module ondeath or scrub any reference to this script. Once you get that working you should consider if you want players to be able to use Dev Crit on each other and rework the script at that point. My feeling is that this was originally designed for single player.
I did a script called karmic retribution which involves PKing which may be of help, at least in determing how to approach the problem. All in all I would say it's probably a fairly easy fix.

#7
ffbj

ffbj
  • Members
  • 593 messages
No it won't work as written be cause even if you could get that a PC has devastating critical and kills another PC, just executing that script on the killer would not work.  Since the script refers to the object that died but also to the killer.  So you are trying to fit two distinct things into one box both the killer and killed in the PC on death event.

So if you had this:

 object oPCDead = GetLastPlayerDied();
    object oPC = GetLastKiller();
     if (GetIsPC(oPCDead) && GetIsPC(oPC))
     {
       SetLocalInt(oPC, "PCKiller", 1);
     ExecuteScript("nameofscript",oPC);
     }

So you would have to run script on the killer oPC since he needs to be checked for dev crit. feat, but once you run the script you have the problem of what objectself refers too.  That's why it crashes. So you could alter the dev crit
script itself with a top line:

 object oPCDead = GetLastPlayerDied();
if (GetLocalInt(oPC, "PCKiller") == 1)
 oPCDead = OBJECT_SELF
//so maybe that would work, changing the dead PC to fill in when references to object self come up but only if killed by another PC.

Modifié par ffbj, 16 août 2012 - 02:58 .


#8
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
ah ok, for some reason i had assumed it was for pc's which is what im tryin to use it for clearly. So leavin the script alone, addin in that bit there should work eh? Ill give it a shot tyvm

#9
ffbj

ffbj
  • Members
  • 593 messages
Yes, well that would be my suppostition. Sometimes when things get moved around they lose their original explanatory elements. Btw always incoporate new scripts into a test module first for best practices. And thereby hangs a tale. But no worries.  You may want to delete the local PCKiller off of the PC at some point.
DeleteLocalInt(oPC, "PCKiller");

Modifié par ffbj, 16 août 2012 - 03:06 .


#10
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
heh ya i always create a backup before any major script additions, just in case ^^

#11
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
Your bit of code worked perfectly on my test server, gonna load the real deal, woot thanks a ton this should work *crosses fingers*

#12
ffbj

ffbj
  • Members
  • 593 messages
Cool!

#13
ffbj

ffbj
  • Members
  • 593 messages
The original vault entry for the aforesaid script:
http://nwvault.ign.c....Detail&id=2861

#14
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
Indeed, thats what i got. Now when i tested it the script didnt crash the server, however when i had pvped someone today, it used the normal dc not the custom one, any thoughts?

*edit*
Looking back i may have missed that 2nd little blerb of code pertaining to the include...oops...will have to add that haha...my bad

Modifié par NightbladeCH, 17 août 2012 - 07:49 .


#15
ffbj

ffbj
  • Members
  • 593 messages
Yes. You will need that too. I never tested it so that's why I said it may work, maybe I should have said it should work. Well at least the server is no longer crashing when in PvP someone gets dev crited.
One other thing is you can continue to use the modified script that checks for dev crit where it is currently on creatures and working. Since they are not PC's those additional lines will have no effect when creatures are dev crited.  Of course you probably already knew that.

Modifié par ffbj, 17 août 2012 - 06:40 .


#16
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
hehe indeed, it doesnt crash, however it doesnt effect pc's the way id like it too *sadface* any thoughts?

#17
ffbj

ffbj
  • Members
  • 593 messages
I gave it my best shot. So what is happening and did you remeber to delete the PCKiller int maybe on a delay command, although I don't see how that would affect it. So it's not working as you want.
So you are executing that script from your module on death. On the PC killer, and then what happens?
So I suppose you noticed I left out a semicolon here:

object oPCDead = GetLastPlayerDied();
if (GetLocalInt(oPC, "PCKiller") == 1)
 oPCDead = OBJECT_SELF;

Anyway post both your module ondeath and the critical hit one too. 

Modifié par ffbj, 20 août 2012 - 03:11 .


#18
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
For some reason it wont let me, keeps bringing up my other post when i go to add a new one

The Dev crit change is here: Startin at line 245
int DevCritSaveFix()
{
int iCurrentHP = GetCurrentHitPoints(OBJECT_SELF);
object oPC = GetLastKiller();
int bMadeSave;
string sResult; // *success* or *failure*
object oPCDead = GetLastPlayerDied();
if (GetLocalInt(oPC, "PCKiller") == 1)
oPCDead = OBJECT_SELF;

if(!GetIsDM(oPC))
{
if(iCurrentHP - GetTotalDamageDealt() > 0) //check for damage/hp discrepancy
{

and I added just that line to my mod on death, do you still need it?

#19
ffbj

ffbj
  • Members
  • 593 messages
I think it should look more like this:

int DevCritSaveFix()
{
object oPC = GetLastKiller();
object oPCDead = GetLastPlayerDied();
if (GetLocalInt(oPC, "PCKiller") == 1)
oPCDead = OBJECT_SELF;

int iCurrentHP = GetCurrentHitPoints(OBJECT_SELF);
int bMadeSave;
string sResult; // *success* or *failure*

if(!GetIsDM(oPC))
{
if(iCurrentHP - GetTotalDamageDealt() > 0) //check for damage/hp discrepancy
{
//etc...

#20
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
Ok so devcrit bit is here
http://pastebin.com/JaUwtpZa
and my mod on death
http://pastebin.com/3DJsdH5j

The default DC is still in effect currently, again thanks for all your help with this

#21
ffbj

ffbj
  • Members
  • 593 messages
I think may be a procedural one. For instance look at the preamble to the script, and you see this:
22.//! USE - inlude this file in your OnDeath event script and add
23.//!
24.//! if (DevCritSaveFix()) return; // exit if we arn't really dead.
25.//!
26.//! to your OnDeath event script - see included file nw_c2_default7

So what I really need to see is your altered nw_c2_default7, since that is what should be running this scipt. So the procedure for normal creatures, would be just run the default7 with the devcrit included. For the pc vs pc death the procedure would be to execute default7 from the module ondeath. According to the writers the dev-crit part is supposed to be used as an include in your normal nw_c2_default7, though the last line is rather confusing since they say see the included file referring to default 7. I think what they mean by that is default 7 is added to the script package not as an include file, a poor choice of wording from the author. Since if you look at the top of DevCrit the script it does not use nw_c2_default7 as an include, it's the other way around. If you catch my meaning.

#22
ffbj

ffbj
  • Members
  • 593 messages
Ok that was some information, but I think the problem is you have the wrong script. What you have is a respawn script calling deve critical. Take a look.

1.//::///////////////////////////////////////////////
2.//:: Respawn System OnDeath
3.//:: res_ondeath.nss
4.//:://////////////////////////////////////////////
5./*
6. This script Clears Factions and Pops up the
7. Death GUI
8.*/
9.//:://////////////////////////////////////////////
10.//:: Created By: Brent Knowles
11.//:: Created On: November 6, 2001
12.//:://////////////////////////////////////////////
13.// #include "DevCritFix"
14.
15.void main()
16.{
17.
18. object oPCDead = GetLastPlayerDied();
19. object oPC = GetLastKiller();
20. if (GetIsPC(oPCDead) && GetIsPC(oPC))
21. {
22. SetLocalInt(oPC, "PCKiller", 1);
23. ExecuteScript("DevCritFix",oPC);
24. }
25.
26. object oPlayer = GetLastPlayerDied();
27.
28. // * make friendly to Each of the 3 common factions
29. AssignCommand(oPlayer, ClearAllActions());
30. // * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
31. if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
32. { SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
33. SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
34. }
35. if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
36. { SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
37. SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
38. }
39. if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
40. { SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
41. SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
42. }
43.
44.// DelayCommand(2.5, PopUpGUIPanel(oPlayer, GUI_PANEL_PLAYER_DEATH));
45. DelayCommand(2.5, PopUpDeathGUIPanel(oPlayer, TRUE, TRUE, 66487));
46.}

So that is the module on respawn script. What you need to do is look at your module on death, go to edit, module properties, and module on death, it should look a lot like the standard one with the few lines added about PC on PC death. I think you should be able to execute the devcrit script from there, and eventually return the respawn script to default, since that will have no effect as it only fires when the pc respawns.
So standard module on death:

//::///////////////////////////////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright © 2008 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a player dies.
//the module ondeath script for a pc
/::///////////////////////////////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright © 2008 Bioware Corp.
//:://////////////////////////////////////////////
/*
This script handles the default behavior
that occurs when a player dies.

BK: October 8 2002: Overriden for Expansion

Deva Winblood: April 21th, 2008: Modified to
handle dismounts when PC dies while mounted.

*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////

#include "x3_inc_horse"

/*
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);
}
} */
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 = 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);
}


///////////////////////////////////////////////////////////////[ MAIN ]/////////
void main()
{
object oPlayer = GetLastPlayerDied();
object oHorse;
object oInventory;
string sID;
int nC;
string sT;
string sR;
int nCH;
int nST;
object oItem;
effect eEffect;
string sDB="X3SADDLEBAG"+GetTag(GetModule());
if (GetStringLength(GetLocalString(GetModule(),"X3_SADDLEBAG_DATABASE"))>0) sDB=GetLocalString(GetModule(),"X3_SADDLEBAG_DATABASE");
if (HorseGetIsMounted(oPlayer))
{ // Dismount and then die
//SetCommandable(FALSE,oPlayer);
//ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
DelayCommand(0.3,HORSE_SupportResetUnmountedAppearance(oPlayer));
DelayCommand(3.0,HORSE_SupportCleanVariables(oPlayer));
DelayCommand(1.0,HORSE_SupportRemoveACBonus(oPlayer));
DelayCommand(1.0,HORSE_SupportRemoveHPBonus(oPlayer));
DelayCommand(1.1,HORSE_SupportRemoveMountedSkillDecreases(oPlayer));
DelayCommand(1.1,HORSE_SupportAdjustMountedArcheryPenalty(oPlayer));
DelayCommand(1.2,HORSE_SupportOriginalSpeed(oPlayer));
if (!GetLocalInt(GetModule(),"X3_HORSE_NO_CORPSES"))
{ // okay to create lootable horse corpses
sR=GetSkinString(oPlayer,"sX3_HorseResRef");
sT=GetSkinString(oPlayer,"sX3_HorseMountTag");
nCH=GetSkinInt(oPlayer,"nX3_HorseAppearance");
nST=GetSkinInt(oPlayer,"nX3_HorseTail");
nC=GetLocalInt(oPlayer,"nX3_HorsePortrait");
if (GetStringLength(sR)>0&&GetStringLeft(sR,GetStringLength(HORSE_PALADIN_PREFIX))!=HORSE_PALADIN_PREFIX)
{ // create horse
oHorse=HorseCreateHorse(sR,GetLocation(oPlayer),oPlayer,sT,nCH,nST);
SetLootable(oHorse,TRUE);
SetPortraitId(oHorse,nC);
SetLocalInt(oHorse,"bDie",TRUE);
AssignCommand(oHorse,SetIsDestroyable(FALSE,TRUE,TRUE));
} // create horse
} // okay to create lootable horse corpses
oInventory=GetLocalObject(oPlayer,"oX3_Saddlebags");
sID=GetLocalString(oPlayer,"sDB_Inv");
if (GetIsObjectValid(oInventory))
{ // drop horse saddlebags
if (!GetIsObjectValid(oHorse))
{ // no horse created
HORSE_SupportTransferInventory(oInventory,OBJECT_INVALID,GetLocation(oPlayer),TRUE);
} // no horse created
else
{ // transfer to horse
HORSE_SupportTransferInventory(oInventory,oHorse,GetLocation(oHorse),TRUE);
//DelayCommand(2.0,PurgeSkinObject(oHorse));
//DelayCommand(3.0,KillTheHorse(oHorse));
//DelayCommand(1.8,PurgeSkinObject(oHorse));
} // transfer to horse
} // drop horse saddlebags
else if (GetStringLength(sID)>0)
{ // database based inventory
nC=GetCampaignInt(sDB,"nCO_"+sID);
while(nC>0)
{ // restore inventory
sR=GetCampaignString(sDB,"sR"+sID+IntToString(nC));
sT=GetCampaignString(sDB,"sT"+sID+IntToString(nC));
nST=GetCampaignInt(sDB,"nS"+sID+IntToString(nC));
nCH=GetCampaignInt(sDB,"nC"+sID+IntToString(nC));
DeleteCampaignVariable(sDB,"sR"+sID+IntToString(nC));
DeleteCampaignVariable(sDB,"sT"+sID+IntToString(nC));
DeleteCampaignVariable(sDB,"nS"+sID+IntToString(nC));
DeleteCampaignVariable(sDB,"nC"+sID+IntToString(nC));
if (!GetIsObjectValid(oHorse))
{ // no lootable corpse
oItem=CreateObject(OBJECT_TYPE_ITEM,sR,GetLocation(oPlayer),FALSE,sT);
} // no lootable corpse
else
{ // lootable corpse
oItem=CreateItemOnObject(sR,oHorse,nST,sT);
} // lootable corpse
if (GetItemStackSize(oItem)!=nST) SetItemStackSize(oItem,nST);
if (nCH>0) SetItemCharges(oItem,nCH);
nC--;
} // restore inventory
DeleteCampaignVariable(sDB,"nCO_"+sID);
//DelayCommand(2.0,PurgeSkinObject(oHorse));
if (GetIsObjectValid(oHorse)&&GetLocalInt(oHorse,"bDie")) DelayCommand(3.0,KillTheHorse(oHorse));
//DelayCommand(2.5,PurgeSkinObject(oHorse));
} // database based inventory
else if (GetIsObjectValid(oHorse))
{ // no inventory
//DelayCommand(1.0,PurgeSkinObject(oHorse));
DelayCommand(2.0,KillTheHorse(oHorse));
//DelayCommand(1.8,PurgeSkinObject(oHorse));
} // no inventory
//eEffect=EffectDeath();
//DelayCommand(1.6,ApplyEffectToObject(DURATION_TYPE_INSTANT,eEffect,oPlayer));
//DelayCommand(1.7,SetCommandable(TRUE,oPlayer));
//return;
} // Dismount and then die

// * increment global tracking number of times that I died
SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1);

//BEGIN ADDED IN CODE ffbj
object oPCDead = GetLastPlayerDied();
object oPC = GetLastKiller();
if (GetIsPC(oPCDead) && GetIsPC(oPC))
{
SetLocalInt(oPC, "PCKiller", 1);
ExecuteScript("nw_c2_default7",oPC);
//or whatever the name of the standard ondeath script for monsters you have.
//now the code should run correctly on the pc
}
//END ADDED IN CODE



// * BK: Automation Control. Autopcs ignore death
if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10)
{
Raise(oPlayer);
DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF));
return; // Raise and return
}


// * Handle Spirit of the Wood Death
string sArea = GetTag(GetArea(oPlayer));
/*
if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oPlayer)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
{
int bValid;

Raise(oPlayer);
string sDestTag = "WP_M2Q2GtoM2Q2F";
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)));
return;

}
*/
// * in last level of the Sourcestone, move the player to the beginning of the area
// * May 16 2002: or the main area of the Snowglobe (to prevent plot logic problems).
// * May 21 2002: or Castle Never
if (sArea == "M4Q1D2" || sArea == "M3Q3C" || sArea == "MAP_M1Q6A")
{

//Raise(oPlayer);
//string sDestTag = "M4QD07_ENTER";
//object oSpawnPoint = GetObjectByTag(sDestTag);
// AssignCommand(oPlayer, DelayCommand(1.0, JumpToLocation(GetLocation(oSpawnPoint))));
// * MAY 2002: Just popup the YOU ARE DEAD panel at this point
DelayCommand(2.5, PopUpDeathGUIPanel(oPlayer,FALSE, TRUE, 66487));
return;
}

// * make friendly to Each of the 3 common factions
AssignCommand(oPlayer, ClearAllActions());
// * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
}
if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
{ SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
}

DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));

}
///////////////////////////////////////////////////////////////[ MAIN ]/////////
Maybe it would be best if you pm me so you can get my e-mail and then zip your module and send it to me. So I can see what's going on, if this does not help. I added in the few lines of code to this standard module ondeath to show the procedure.

Modifié par ffbj, 23 août 2012 - 06:01 .


#23
NightbladeCH

NightbladeCH
  • Members
  • 39 messages
Hey. ok i can do that. However double checking the script i sent you WAS my mod ondeath script. The way I looked at it was I had to add the script to the playeronDeath and the default 7, because the default 7 controls the npcs, where as the other is just for pc's. Unless i misunderstand it

#24
ffbj

ffbj
  • Members
  • 593 messages
The default 7 is what contains the devcrit script. You are just using that script to fire the devcrit check. The module ondeath you sent looks like a respawn script.
Here is what it says at the very top:
1.//::///////////////////////////////////////////////
2.//:: Respawn System OnDeath
3.//:: res_ondeath.nss
4.//:://////////////////////////////////////////////
5./*
Anyway executing the script default 7 may work. There is no script DevCrit, it's an include so the part that is exectuting a nonexistent script is pointless.  That's where you could change it to executing default 7, which
has the DevCrit check included
..void main()
16.{
17.
18. object oPCDead = GetLastPlayerDied();
19. object oPC = GetLastKiller();
20. if (GetIsPC(oPCDead) && GetIsPC(oPC))
21. {
22. SetLocalInt(oPC, "PCKiller", 1);
23. ExecuteScript("nw_c2_default7",oPC);//so you could try changing this to.
24. }
And see if that works.  So that may work and death script is fine as it is, just make those changes.

Modifié par ffbj, 24 août 2012 - 05:20 .