Author Topic: Clueless  (Read 574 times)

Legacy_Psyammy

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Clueless
« on: July 20, 2010, 01:10:39 pm »


               hey guys, i have a question i am hoping someone can help me with, when i die the camera changes from top down to chase and i have to change it back in the options, it did not used to do that but i can not work out why it is doing that now, so the question is, how do i stop the camera from changeing?
Psyammy
               
               

               
            

Legacy_Genisys

  • Hero Member
  • *****
  • Posts: 961
  • Karma: +0/-0
Clueless
« Reply #1 on: July 20, 2010, 01:15:40 pm »


               there is a key above the "Enter" key, which has two symbols on it:  | & \\, this toggles your camera, maybe you are hitting this by accident before you die or after you die?



Unless your talking about scripting changes you made, that would be my guess, if it's script related though, you have to post the script for us to fix it for you.
               
               

               
            

Legacy_Psyammy

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Clueless
« Reply #2 on: July 20, 2010, 01:21:52 pm »


               i am guessing it would be the ondeath script, if so then here it is.



//mod_on_death

/*

   This is still the default NWN player death script.

   It does a lot of stuff you don't really need/want.

   It does not do stuff you really need/want.

   You need to rework this.

   The horse section should be fine.

   It was written with multi-player in mind.

   Qwildurn

*/

#include "x3_inc_horse"

void Raise(object oPlayer);

//void ClearAllFactionMembers(object oMember, object oPlayer);

/*

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);

}

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;

//start horse section

   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

//end horse section

   // * increment global tracking number of times that I died

   SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1);

   // * 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

   }



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

   }

   effect eVis = EffectVisualEffect(119);

   DelayCommand(1.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oPlayer));

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

}

thank you for your help.

Psyammy
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Clueless
« Reply #3 on: July 20, 2010, 10:03:06 pm »


               

Psyammy wrote...

hey guys, i have a question i am hoping someone can help me with, when i die the camera changes from top down to chase and i have to change it back in the options, it did not used to do that but i can not work out why it is doing that now, so the question is, how do i stop the camera from changeing?
Psyammy


I looked over the death script, I did not see anything there that woud cause it.
Here are a few questions that my help someone find you an answer.

Does this happen in more then one module? 

Is it every game or just one game it happens in? 

If you play the OC does it still happen?

Even if you fail to find out why this is happening you do not have to go into the options to change the camera mode.  By default the * on the number pad  toggles the camera mode.  If like me you play on a lap top without a number pad you can change the toggle key to any one you like in the game options under 'key controlls'
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Clueless
« Reply #4 on: July 20, 2010, 10:21:26 pm »


               probably its in the crawl script.



DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF));



can you post that one?
               
               

               
            

Legacy_Psyammy

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Clueless
« Reply #5 on: July 21, 2010, 09:40:48 am »


               i looked for the crawl script and could not find it (maybe i am looking for the wrong thing), i looked for a script called "crawl" in the script box then i clicked on all resorce cuz i dont have a script called crawl in my mod (that i put in) but i think i am looking for it the wrong way, i think that the crawl may be part of another script? any help with this would be appreciated.

Psyammy
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Clueless
« Reply #6 on: July 21, 2010, 01:51:52 pm »


               hit the open script button, then type crawl in the name. if it is not in your mod,, then hit the all resourses button to the left. It should come up if you have it.
               
               

               
            

Legacy_Psyammy

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Clueless
« Reply #7 on: July 21, 2010, 01:56:20 pm »


               hmm, i just tryed that and nothing came up. any idea what that script is sposed to do?

               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Clueless
« Reply #8 on: July 21, 2010, 03:19:44 pm »


               If I had to guess, it might be some type of animation for when the PC dies. Try removing the line in your script that calls for it to run, and test it.
               
               

               
            

Legacy_Psyammy

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Clueless
« Reply #9 on: July 21, 2010, 03:46:11 pm »


               i just tryed that and it did nothing at all (makes me wonder why it is even there)
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Clueless
« Reply #10 on: July 21, 2010, 03:52:22 pm »


               Question, are you running a on bleed system in your mod? Or is this happening in every mod/game you play.

               
               

               
            

Legacy_Psyammy

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Clueless
« Reply #11 on: July 21, 2010, 04:28:51 pm »


               i am running a bleed to death system but it all was fine till about a week ago, the bleed system has been in for a long time and i have had no probs with it.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Clueless
« Reply #12 on: July 21, 2010, 10:03:57 pm »


               You still have not answered if you are having this happen in just one module or all games you are playing in.  If it is happening in all modules that you play my guess is that it is something you have placed in your override folder.
               
               

               
            

Legacy_SHOVA

  • Hero Member
  • *****
  • Posts: 893
  • Karma: +0/-0
Clueless
« Reply #13 on: July 22, 2010, 01:57:59 am »


               Sorry bout not responding sooner, I had a comp problem this afternoon. First, I got to ask, what happened within the last week. Did you add a hak, Add overrides? or add erfs to your game? Logic says that if it just started in the last week, then something you did in that week is the cause.
               
               

               
            

Legacy_Psyammy

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-0
Clueless
« Reply #14 on: July 22, 2010, 02:15:05 am »


               sorry bout not answering all the questions, i have been fixing a few things in the mod, it is only happening in the one mod and i have not added anything in the over ride or hak folders, it only started happening after the ondeath script was cleaned up for me (the script above) but i can not see why it is changing the camera angle in that script.and i have only added 2 erfs but they were just a couple of monsters that a friend made for the mod.

thanks again for the help

Psyammy