Need help with armor factions

Post » Fri Jul 23, 2010 1:15 pm

Through my own incompetence I've managed to screw up the various "armor" factions and am at a loss as to how to fix it, so I've come here looking for help. :)

What happened was I had a script that destroyed armor. Unfortunately the piece of code that should have reset the various factional stuff wasn't working, so now the player is wandering around added to multiple armor factions. Using "player.RemoveFromFaction x" works right up to a point. However, when I remove them from "ArmorNCRFactionEnemy" things become screwed up (legion becomes friendly etc). So I figure I'm missing something.

Here's the bulk the of script:
Spoiler
; From the OnAdd block
if DisguiseFactionPulseQuest.bFactionArmorEquipped == 0

;Set variable to track wearing faction armor
set DisguiseFactionPulseQuest.bFactionArmorEquipped to 1

;Player was not wearing faction armor - so we store their reputation values, we don't need to clear it here, it'll get cleared below
;Store Reputations
set DisguiseFactionPulseQuest.fNCRNegReputation to GetReputation RepNVNCR 0
set DisguiseFactionPulseQuest.fNCRPosReputation to GetReputation RepNVNCR 1

set DisguiseFactionPulseQuest.fLegionNegReputation to GetReputation RepNVCaesarsLegion 0
set DisguiseFactionPulseQuest.fLegionPosReputation to GetReputation RepNVCaesarsLegion 1

set DisguiseFactionPulseQuest.fBoSNegReputation to GetReputation RepNVBrotherhood 0
set DisguiseFactionPulseQuest.fBoSPosReputation to GetReputation RepNVBrotherhood 1

set DisguiseFactionPulseQuest.fKhanNegReputation to GetReputation RepNVGreatKhans 0
set DisguiseFactionPulseQuest.fKhanPosReputation to GetReputation RepNVGreatKhans 1

set DisguiseFactionPulseQuest.fPowderNegReputation to GetReputation RepNVPowderGanger 0
set DisguiseFactionPulseQuest.fPowderPosReputation to GetReputation RepNVPowderGanger 1

endif

StartQuest DisguiseFactionPulseQuest ;Kicks the pulse placing quest
; setally ArmorVCaesarsLegionFaction PlayerFaction 1 1
; player.addtofaction ArmorVCaesarsLegionFactionEnemy 0

; setally PlayerFaction ArmorNCRFactionNV 1 1
; player.addtofaction ARMORNCRFactionNVEnemy 0

;Clear Reputations
SetReputation RepNVNCR 0 0.0
SetReputation RepNVNCR 1 0.0

SetReputation RepNVCaesarsLegion 0 0.0
SetReputation RepNVCaesarsLegion 1 0.0

SetReputation RepNVBrotherhood 0 0.0
SetReputation RepNVBrotherhood 1 0.0

SetReputation RepNVGreatKhans 0 0.0
SetReputation RepNVGreatKhans 1 0.0

SetReputation RepNVPowderGanger 0 0.0
SetReputation RepNVPowderGanger 1 0.0

; =====================
; From the unequip block

; Bos
SetEnemy ArmorBrotherhoodSteelFaction PlayerFaction 1 1
player.RemoveFromFaction ArmorBrotherhoodSteelFactionEnemy

; GK
SetEnemy ArmorGreatKhansFactionNV PlayerFaction 1 1
player.RemoveFromFaction ArmorGreatKhansFactionNVEnemy

; NCR
SetEnemy PlayerFaction ArmorNCRFactionNV 1 1
player.RemoveFromFaction ARMORNCRFactionNVEnemy

; PG
SetEnemy ArmorPowderGangerFactionNV PlayerFaction 1 1
player.RemoveFromFaction ArmorPowderGangerFactionNVEnemy

; CL
SetEnemy ArmorVCaesarsLegionFaction PlayerFaction 1 1
player.RemoveFromFaction ArmorVCaesarsLegionFactionEnemy

;Restore Factions
;Get Current Values and add stored values
set fUpdatedNegNCR to GetReputation RepNVNCR 0 + DisguiseFactionPulseQuest.fNCRNegReputation
set fUpdatedPosNCR to GetReputation RepNVNCR 1+ DisguiseFactionPulseQuest.fNCRPosReputation

set fUpdatedNegCL to GetReputation RepNVCaesarsLegion 0 + DisguiseFactionPulseQuest.fLegionNegReputation
set fUpdatedPosCL to GetReputation RepNVCaesarsLegion 1 + DisguiseFactionPulseQuest.fLegionPosReputation

set fUpdatedNegBoS to GetReputation RepNVBrotherhood 0 + DisguiseFactionPulseQuest.fBoSNegReputation
set fUpdatedPosBoS to GetReputation RepNVBrotherhood 1 + DisguiseFactionPulseQuest.fBoSPosReputation

set fUpdatedNegGK to GetReputation RepNVGreatKhans 0 + DisguiseFactionPulseQuest.fKhanNegReputation
set fUpdatedPosGK to GetReputation RepNVGreatKhans 1 + DisguiseFactionPulseQuest.fKhanPosReputation

set fUpdatedNegPG to GetReputation RepNVPowderGanger 0 + DisguiseFactionPulseQuest.fPowderNegReputation
set fUpdatedPosPG to GetReputation RepNVPowderGanger 1 + DisguiseFactionPulseQuest.fPowderPosReputation

;If the player is not wearing ANY faction armor, clear this variable.
if (Player.GetEquipped FactionGearNVNCR == 0) && (Player.GetEquipped FactionGearNVCaesar == 0) && (Player.GetEquipped FactionGearNVBrotherhood == 0) && (Player.GetEquipped FactionGearNVGreatKhans == 0) && (Player.GetEquipped FactionGearNVPowder == 0) && (player.GetEquipped VMS18WhiteGloveMask == 0 || (Player.GetEquipped OutfitFormalWear == 0 && player.GetEquipped ArmorWhiteGloveSociety == 0))
;Clear Wearing Faction Armor Variable
set DisguiseFactionPulseQuest.bFactionArmorEquipped to 0

;Set Reputation Values to Updated
SetReputation RepNVNCR 0 fUpdatedNegNCR
SetReputation RepNVNCR 1 fUpdatedPosNCR

SetReputation RepNVCaesarsLegion 0 fUpdatedNegCL
SetReputation RepNVCaesarsLegion 1 fUpdatedPosCL

SetReputation RepNVBrotherhood 0 fUpdatedNegBoS
SetReputation RepNVBrotherhood 1 fUpdatedPosBoS

SetReputation RepNVGreatKhans 0 fUpdatedNegGK
SetReputation RepNVGreatKhans 1 fUpdatedPosGK

SetReputation RepNVPowderGanger 0 fUpdatedNegPG
SetReputation RepNVPowderGanger 1 fUpdatedPosPG
endif


The crux seems to be here:
; Bos			SetEnemy ArmorBrotherhoodSteelFaction PlayerFaction 1 1			player.RemoveFromFaction ArmorBrotherhoodSteelFactionEnemy			; GK			SetEnemy ArmorGreatKhansFactionNV PlayerFaction 1 1			player.RemoveFromFaction ArmorGreatKhansFactionNVEnemy			; NCR			SetEnemy PlayerFaction ArmorNCRFactionNV 1 1			player.RemoveFromFaction ARMORNCRFactionNVEnemy			; PG			SetEnemy ArmorPowderGangerFactionNV PlayerFaction 1 1			player.RemoveFromFaction ArmorPowderGangerFactionNVEnemy			; CL						SetEnemy ArmorVCaesarsLegionFaction PlayerFaction 1 1			player.RemoveFromFaction ArmorVCaesarsLegionFactionEnemy


Any help would be GREATLY appreciated.
Cheers,
Watto
User avatar
Nicholas C
 
Posts: 3489
Joined: Tue Aug 07, 2007 8:20 am

Return to Fallout: New Vegas