Help with Modding Faction Armor

Post » Sat Feb 19, 2011 1:01 pm

Allright, gonna need some help here.

I'm trying to create a mod that modifies how faction armor works. It seems that most all of the faction armor mods out there do one of two things: remove the script entirely or disable the script, both of which cause faction armor to act like normal armor.

I don't want to do that. What I want to do is modify how the armor treats positive faction; specifically, I want it to track faction with the associated armor, and not overwrite the faction setting if it's positive. In other words, If I'm wearing NCR armor, I want to retain positive faction with the NCR while wearing the armor, but if NCR faction is negative, it will be set to "neutral" as normal so long as I wear the armor.

Simply removing the specific part of the code for the armor won't do- it'll keep it from overwriting the positive faction, but it won't reset negative faction.

Unfortuantly, I can't tell how the script tracks faction- I know where it sets it up, but I'm not sure how to change it. So i've placed the NCR version of the script up here so we all know what we're looking at without needing to boot up the GECK. If I can get the NCR version to work, I'll be able to modify the remaining armor scripts to work the way I want them to.

Spoiler
scn NCRFactionOutfitWarningScriptfloat fUpdatedNegNCRfloat fUpdatedPosNCRfloat fUpdatedNegCLfloat fUpdatedPosCLfloat fUpdatedNegBoSfloat fUpdatedPosBoSfloat fUpdatedNegGKfloat fUpdatedPosGKfloat fUpdatedNegPGfloat fUpdatedPosPGBegin OnEquip Player	;Check to see if player was wearing faction armor. 	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	else		;Get Current Faction Values and add stored values		set DisguiseFactionPulseQuest.fNCRNegReputation to GetReputation RepNVNCR 0 + DisguiseFactionPulseQuest.fNCRNegReputation		set DisguiseFactionPulseQuest.fNCRPosReputation to GetReputation RepNVNCR 1+ DisguiseFactionPulseQuest.fNCRPosReputation		set DisguiseFactionPulseQuest.fLegionNegReputation to GetReputation RepNVCaesarsLegion 0 + DisguiseFactionPulseQuest.fLegionNegReputation		set DisguiseFactionPulseQuest.fLegionPosReputation to GetReputation RepNVCaesarsLegion 1 + DisguiseFactionPulseQuest.fLegionPosReputation		set DisguiseFactionPulseQuest.fBoSNegReputation to GetReputation RepNVBrotherhood 0 + DisguiseFactionPulseQuest.fBoSNegReputation		set DisguiseFactionPulseQuest.fBoSPosReputation to GetReputation RepNVBrotherhood 1 + DisguiseFactionPulseQuest.fBoSPosReputation		set DisguiseFactionPulseQuest.fKhanNegReputation to GetReputation RepNVGreatKhans 0 + DisguiseFactionPulseQuest.fKhanNegReputation		set DisguiseFactionPulseQuest.fKhanPosReputation to GetReputation RepNVGreatKhans 1 + DisguiseFactionPulseQuest.fKhanPosReputation		set DisguiseFactionPulseQuest.fPowderNegReputation to GetReputation RepNVPowderGanger 0 + DisguiseFactionPulseQuest.fPowderNegReputation		set DisguiseFactionPulseQuest.fPowderPosReputation to GetReputation RepNVPowderGanger 1 + DisguiseFactionPulseQuest.fPowderPosReputation	endif	if VFactionArmorTutorial == 0		ShowMessage VFactionOutfitTutorial		set VFactionArmorTutorial to 1	endif	;Set NCR Alliance	ShowMessage NCRFactionOutfitWarning	;SetEnemy VCaesarsLegionFaction PlayerFaction	StartQuest DisguiseFactionPulseQuest ;Kicks the pulse placing quest	setally PlayerFaction ArmorNCRFactionNV 1 1	player.addtofaction ARMORNCRFactionNVEnemy 0	;Set BoS Alliance if they have joined the NCR	if VStoryEventBoS == 1		setally ArmorBrotherhoodSteelFactionEnemy NCRFactionNV 1 1		setally ArmorBrotherhoodSteelFaction PlayerFaction 1 1		player.addtofaction ArmorBrotherhoodSteelFactionEnemy 0	endif	;Set GreatKhan Alliance if they have joined the NCR	if VStoryEventKhans == 1		setally ArmorGreatKhansFactionNVEnemy NCRFactionNV 1 1		setally ArmorGreatKhansFactionNV PlayerFaction 1 1		player.addtofaction ArmorGreatKhansFactionNVEnemy 0	endif	;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.0endBegin OnUnequip Player	;SetEnemy VCaesarsLegionFaction PlayerFaction 1 1	;SetEnemy PlayerFaction ArmorNCRFactionNV 1 1	if player.GetEquipped FactionGearNVNCR == 0		;Unset NCR Alliance		StopQuest DisguiseFactionPulseQuest ;Stops the pulse placing quest		SetEnemy PlayerFaction ArmorNCRFactionNV 1 1		player.RemoveFromFaction ARMORNCRFactionNVEnemy		ShowMessage NCRFactionOutfitWarningOff		;UnSet BoS Alliance if they have joined the NCR		if VStoryEventBoS == 1			SetEnemy ArmorBrotherhoodSteelFaction PlayerFaction 1 1			player.RemoveFromFaction ArmorBrotherhoodSteelFactionEnemy 		endif		;UnSet Khan Alliance if they have joined the NCR		if VStoryEventKhans == 1			SetEnemy ArmorGreatKhansFactionNV PlayerFaction 1 1			player.RemoveFromFaction ArmorGreatKhansFactionNVEnemy		endif		;Get Current Faction 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	endif	;If the player is not wearing ANY faction armor, do the following	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		;Update to Proper Reputation Values		;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	endifend;Restriction on Companions;Begin OnAdd CraigBooneREF;	ShowMessage CompanionFactionArmorMsg;	DropMe;EndBegin OnAdd RoseofSharonCassidyREF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd VeronicaREF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd LilyREF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd RaulREF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd ArcadeREF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd EDE1REF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd EDE2REF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd EDE3REF	ShowMessage CompanionFactionArmorMsg	DropMeEndBegin OnAdd RexREF	ShowMessage CompanionFactionArmorMsg	DropMeEnd


I think that if I can add in an if/else statement at the start of the code where it resets NCR faction so it only resets when NCR faction is negative, that should get the script to work the way I want it.

Any ideas?
User avatar
Lisha Boo
 
Posts: 3378
Joined: Fri Aug 18, 2006 2:56 pm

Return to Fallout: New Vegas