Jump to content

Quick Outfit .... but for Followers


ouibonjour

Recommended Posts

For my personal use, I would like to use the mod Quick Outfit ( https://forums.nexusmods.com/index.php?app=members&module=messaging&section=view&do=inbox ) but use it on my companions, and maybe, on any followers or even NPC.

The mod does a few thing :

 

1. It registers your current outfit.
2. You press an Hotkey and it offers different options, the most important : Save Outfit As Slot 1 (Slot 2, Slot 3, etc)
3. When you press the hotkey for a specific outfit, it removes everything you're wearing and it equips every item that was saved on step 2.

I checked into the mod in Creation Kit, and there is not much : Only 3 MessagesMenu for the menu, and a Quest "Active On-Startup".

Everything is in the Papyrus. I opened the BA2 and am looking at the Papyrus, and I'm wondering if I could duplicate that Script but replace every "Player" by something else that would represent the companion I want to switch outfits. I'm pretty sure it would be more complicated than that, but I know that everything is in that script.

I would not want to modify the current mod, as its creator does not seem to be active, and also because I like using it for my own character.

What I would like would be to duplicate the mod, but with the values and property changed to apply to Cait, for example, with different hotkeys than those I use for my PC.

And then I would duplicate another one for another follower, then for another one, etc.

 

I'm sure we could combine everything in the same mod, but I believe it could quickly get out of my reach.

Do you think you guys could help me out on what parts to change, and what to replace with what, and so on, if I copy the script below ?

Lets say I would like to replace everything linked to the player by Cait (RefID: 79249)

 

 

 

Scriptname QuickOutfit extends Quest Conditional

; Properties

Message Property QuickOutfit_MainMenu Auto Const
Message Property QuickOutfit_SaveAsMenu Auto Const
Message Property QuickOutfit_DeleteFromMenu Auto Const

FollowersScript Property Followers Auto Const
Faction Property DisallowedCompanionFaction Auto Const
ActorValue Property CarryWeight Auto Const

ReferenceAlias Property Alias_Workshop Auto Const

; Variables

bool Property Outfitset0Saved  Auto Conditional
bool Property Outfitset1Saved  Auto Conditional
bool Property Outfitset2Saved  Auto Conditional
bool Property Outfitset3Saved  Auto Conditional
bool Property Outfitset4Saved  Auto Conditional
bool Property Outfitset5Saved  Auto Conditional
bool Property Outfitset6Saved  Auto Conditional
bool Property Outfitset7Saved  Auto Conditional
bool Property Outfitset8Saved  Auto Conditional
bool Property Outfitset9Saved  Auto Conditional
bool Property ShowSavedInMenu  Auto Conditional

; Which outfit set is currently equipped (from 0 to 9)
int  CurrentOutfitset

; The last item in the queue or NONE
Form waitForEquipedItem

; Array of wearing items for each biped slot (each element has an item or NONE)
Form[] OutfitsetFormList0
Form[] OutfitsetFormList1
Form[] OutfitsetFormList2
Form[] OutfitsetFormList3
Form[] OutfitsetFormList4
Form[] OutfitsetFormList5
Form[] OutfitsetFormList6
Form[] OutfitsetFormList7
Form[] OutfitsetFormList8
Form[] OutfitsetFormList9

; Variables from MCM menu
bool IsModEnabled
bool ShowNotification

; Variables from MCM menu (for each set from 0 to 9)
bool[] UnequipAllIsEnabled
bool[] ExcludeFromRotation
bool[] ShareFollowerInventory
bool[] BipedSlotIsEnabled

Event OnQuestInit()
	; Register for events
	RegisterForRemoteEvent(Game.GetPlayer(), "OnPlayerLoadGame")
	
	RegisterForRemoteEvent(Game.GetPlayer(), "OnItemEquipped")
	
	RegisterForRemoteEvent(Alias_Workshop.GetRef(), "OnWorkshopMode")
	
	; Fill outfitset with current actor items (for each biped slot from 0 to 43)
	OutfitsetFormList0 = new Form[44]
	OutfitsetFormList1 = new Form[44]
	OutfitsetFormList2 = new Form[44] 
	OutfitsetFormList3 = new Form[44]
	OutfitsetFormList4 = new Form[44]
	OutfitsetFormList5 = new Form[44]
	OutfitsetFormList6 = new Form[44]
	OutfitsetFormList7 = new Form[44]
	OutfitsetFormList8 = new Form[44]
	OutfitsetFormList9 = new Form[44]
	
	; When changing outfit set, unequip all items, not included in the current set
	UnequipAllIsEnabled = new bool[10]
	
	; Exclude current sets from next/prev rotation
	ExcludeFromRotation = new bool[10]

	; Store the current set in the inventory of companions
	ShareFollowerInventory= new bool[10]
	
	; To use or ignore current biped slot (for each biped slot from 0 to 43)
	BipedSlotIsEnabled = new bool[44]
	
	; No one outfit is currently equipped
	CurrentOutfitset = 0
	
	ReadMCMConfig()
EndEvent

Event Actor.OnPlayerLoadGame(actor aSender)
	; Register for events
	RegisterForRemoteEvent(Game.GetPlayer(), "OnItemEquipped")
	
	RegisterForRemoteEvent(Alias_Workshop.GetRef(), "OnWorkshopMode")

	; When changing outfit set, unequip all items, not included in the current set
	UnequipAllIsEnabled = new bool[10]
	
	; Exclude current sets from next/prev rotation
	ExcludeFromRotation = new bool[10]
	
	; Store the current set in the inventory of companions
	ShareFollowerInventory= new bool[10]

	; To use or ignore current biped slot (for each biped slot from 0 to 43)
	BipedSlotIsEnabled = new bool[44]

	ReadMCMConfig()
EndEvent

Event Actor.OnItemEquipped(Actor akSender, Form akBaseObject, ObjectReference akReference)
	if waitForEquipedItem != None
		if akBaseObject == waitForEquipedItem || akReference == waitForEquipedItem
			waitForEquipedItem = None
			IsModEnabled = MCM.GetModSettingBool("QuickOutfit", "bModEnabled:Main")
		endIf
	endIf
EndEvent

Event ObjectReference.OnWorkshopMode(ObjectReference akSender, bool aStart)
	if aStart == true
		IsModEnabled = false
	else
		IsModEnabled = MCM.GetModSettingBool("QuickOutfit", "bModEnabled:Main")
	endIf
EndEvent

; 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Save as | Delete from | Cancel
Function MainMenu()
	if IsModEnabled
		if !IsInPowerArmor()
			int idx = QuickOutfit_MainMenu.Show()
			
			if (idx >= 0 && idx <= 9)
				EquipOutfitset(idx)
			elseif (idx == 10)
				SaveAsMenu()
			elseif (idx == 11)
				DeleteFromMenu()
			endIf
		endIf
	endIf
EndFunction

; 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Back
Function SaveAsMenu()
	int idx = QuickOutfit_SaveAsMenu.Show()
	
	if (idx >= 0 && idx <= 9)
		SaveCurrentOutfitAs(idx)
	endIf
	
	; Return to main menu
	MainMenu()
EndFunction

Function SaveCurrentOutfitAs(int aiIndex)
	Debug.Notification("$QUICKOUTFIT_SAVE_MESG")

	if aiIndex == 0
		Outfitset0Saved = true
	elseIf aiIndex == 1
		Outfitset1Saved = true
	elseif aiIndex == 2
		Outfitset2Saved = true
	elseif aiIndex == 3
		Outfitset3Saved = true
	elseif aiIndex == 4
		Outfitset4Saved = true
	elseif aiIndex == 5
		Outfitset5Saved = true
	elseif aiIndex == 6
		Outfitset6Saved = true
	elseif aiIndex == 7
		Outfitset7Saved = true
	elseif aiIndex == 8
		Outfitset8Saved = true
	elseif aiIndex == 9
		Outfitset9Saved = true
	endIf

	Actor playerRef = Game.GetPlayer()

	int idx = 0
	while (idx < 44)
		Actor:WornItem wornItem = playerRef.GetWornItem(idx)
		if wornItem.Item && playerRef.GetItemCount(wornItem.Item) > 0
			SetOutfitsetFormList(aiIndex, idx, wornItem.Item)
		else
			SetOutfitsetFormList(aiIndex, idx, NONE)
		endIf
		idx += 1
	endWhile
EndFunction

; 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Back
Function DeleteFromMenu()
	int idx = QuickOutfit_DeleteFromMenu.Show()
	
	if (idx == 0)
		Outfitset0Saved = false
	elseif (idx == 1)
		Outfitset1Saved = false
	elseif (idx == 2)
		Outfitset2Saved = false
	elseif (idx == 3)
		Outfitset3Saved = false
	elseif (idx == 4)
		Outfitset4Saved = false
	elseif (idx == 5)
		Outfitset5Saved = false
	elseif (idx == 6)
		Outfitset6Saved = false
	elseif (idx == 7)
		Outfitset7Saved = false
	elseif (idx == 8)
		Outfitset8Saved = false
	elseif (idx == 9)
		Outfitset9Saved = false
	endIf

	; Return to main menu
	MainMenu()
EndFunction

Function EquipOutfitset(int aiIndex)
	if IsModEnabled
		if !IsInPowerArmor()
			Actor playerRef = Game.GetPlayer()
			
			bool[] outfitsetSaved = new bool[10]
			outfitsetSaved[0] = Outfitset0Saved
			outfitsetSaved[1] = Outfitset1Saved
			outfitsetSaved[2] = Outfitset2Saved
			outfitsetSaved[3] = Outfitset3Saved
			outfitsetSaved[4] = Outfitset4Saved
			outfitsetSaved[5] = Outfitset5Saved
			outfitsetSaved[6] = Outfitset6Saved
			outfitsetSaved[7] = Outfitset7Saved
			outfitsetSaved[8] = Outfitset8Saved
			outfitsetSaved[9] = Outfitset9Saved
			
			if outfitsetSaved[aiIndex] == true
				IsModEnabled = false
			
				int idx = 43
				while (idx >= 0)
					if BipedSlotIsEnabled[idx]
						Form item = GetOutfitsetFormList(aiIndex, idx)
						if item != NONE
							if (playerRef.GetItemCount(item) > 0 && playerRef.IsEquipped(item) == false)			
								waitForEquipedItem = item
								idx = -1
							endIf
						endIf
					endIf
					idx -= 1
				endwhile
			
				idx = 0
				while (idx < 44)
					if BipedSlotIsEnabled[idx]
						Form item = GetOutfitsetFormList(aiIndex, idx)
						if item != NONE
							if (playerRef.GetItemCount(item) > 0 && playerRef.IsEquipped(item) == false)
								playerRef.EquipItem(item, false, true)
							elseIf  (playerRef.GetItemCount(item) == 0 && ShareFollowerInventory[aiIndex] == true)
								item = GiveMeThatThing(item)
								if item != NONE
									playerRef.EquipItem(item, false, true)
								endIf
							endIf
						endIf
					endIf
					idx += 1
				endWhile
				
				if UnequipAllIsEnabled[aiIndex]  == true
					idx = 0
					while (idx < 44)
						if BipedSlotIsEnabled[idx]
							Form item = GetOutfitsetFormList(aiIndex, idx)
							if item == NONE
								playerRef.UnequipItemSlot(idx)
							endIf
						endIf
						idx += 1
					endWhile
				endIf
				
				if ShareFollowerInventory[aiIndex]  == true
					idx = 0
					while (idx < 44)
						if BipedSlotIsEnabled[idx]
							Form item = GetOutfitsetFormList(CurrentOutfitset, idx)
								if item != NONE
									if (playerRef.GetItemCount(item) > 0 && playerRef.IsEquipped(item) == false)
										TakeThisThing(item)
									endIf
								endIf
						endIf
						idx += 1
					endWhile
				endIf
				
				CurrentOutfitset = aiIndex
				
				if ShowNotification
					Debug.Notification("$QUICKOUTFIT_NAME_" + (CurrentOutfitset+1) as String)
				endIf
				
				if  waitForEquipedItem == None
					IsModEnabled = MCM.GetModSettingBool("QuickOutfit", "bModEnabled:Main")
				endif
			endIf
		endIf
	endIf
EndFunction

Function EquipNextOutfitset()
	if IsModEnabled
		if !IsInPowerArmor()
			bool[] outfitsetSaved = new bool[10]
			outfitsetSaved[0] = Outfitset0Saved
			outfitsetSaved[1] = Outfitset1Saved
			outfitsetSaved[2] = Outfitset2Saved
			outfitsetSaved[3] = Outfitset3Saved
			outfitsetSaved[4] = Outfitset4Saved
			outfitsetSaved[5] = Outfitset5Saved
			outfitsetSaved[6] = Outfitset6Saved
			outfitsetSaved[7] = Outfitset7Saved
			outfitsetSaved[8] = Outfitset8Saved
			outfitsetSaved[9] = Outfitset9Saved

			int idx = GetNextIndex(CurrentOutfitset)
			while ((outfitsetSaved[idx] == false || ExcludeFromRotation[idx] == true) && idx != CurrentOutfitset)
				idx = GetNextIndex(idx)
			endWhile	
			
			if (idx != CurrentOutfitset)
				EquipOutfitset(idx)
			endIf
		endIf
	endIf
EndFunction

int Function GetNextIndex(int aiCurrentOutfitset)
	int idx = aiCurrentOutfitset + 1
	if (idx > 9)
		idx = 0
	endIf
	return idx
EndFunction

Function EquipPrevOutfitset()
	if IsModEnabled
		if !IsInPowerArmor()
			bool[] outfitsetSaved = new bool[10]
			outfitsetSaved[0] = Outfitset0Saved
			outfitsetSaved[1] = Outfitset1Saved
			outfitsetSaved[2] = Outfitset2Saved
			outfitsetSaved[3] = Outfitset3Saved
			outfitsetSaved[4] = Outfitset4Saved
			outfitsetSaved[5] = Outfitset5Saved
			outfitsetSaved[6] = Outfitset6Saved
			outfitsetSaved[7] = Outfitset7Saved
			outfitsetSaved[8] = Outfitset8Saved
			outfitsetSaved[9] = Outfitset9Saved

			int idx = GetPrevIndex(CurrentOutfitset)
			while ((outfitsetSaved[idx] == false || ExcludeFromRotation[idx] == true)  && idx != CurrentOutfitset)
				idx = GetPrevIndex(idx)
			endWhile	
			
			if (idx != CurrentOutfitset)
				EquipOutfitset(idx)
			endIf
		endIf
	endIf
EndFunction

int Function GetPrevIndex(int aiCurrentOutfitset)
	int idx = aiCurrentOutfitset - 1
	if (idx < 0)
		idx = 9
	endIf
	return idx
EndFunction

Function ReadMCMConfig(string asMCMsection = "")
	; Main
	if (asMCMsection == "Main"  || asMCMsection == "")
		IsModEnabled = MCM.GetModSettingBool("QuickOutfit", "bModEnabled:Main")
		ShowNotification = MCM.GetModSettingBool("QuickOutfit", "bShowNotification:Main")
		ShowSavedInMenu = MCM.GetModSettingBool("QuickOutfit", "bShowSavedInMenu:Main")
	endIf

	; Settings
	if (asMCMsection == "Settings"  || asMCMsection == "")
		UnequipAllIsEnabled[0] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll1:Settings")
		UnequipAllIsEnabled[1] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll2:Settings")
		UnequipAllIsEnabled[2] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll3:Settings")
		UnequipAllIsEnabled[3] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll4:Settings")
		UnequipAllIsEnabled[4] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll5:Settings")
		UnequipAllIsEnabled[5] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll6:Settings")
		UnequipAllIsEnabled[6] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll7:Settings")
		UnequipAllIsEnabled[7] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll8:Settings")
		UnequipAllIsEnabled[8] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll9:Settings")
		UnequipAllIsEnabled[9] = MCM.GetModSettingBool("QuickOutfit", "bUnequipAll10:Settings")
		
		ExcludeFromRotation[0] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation1:Settings")
		ExcludeFromRotation[1] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation2:Settings")
		ExcludeFromRotation[2] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation3:Settings")
		ExcludeFromRotation[3] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation4:Settings")
		ExcludeFromRotation[4] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation5:Settings")
		ExcludeFromRotation[5] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation6:Settings")
		ExcludeFromRotation[6] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation7:Settings")
		ExcludeFromRotation[7] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation8:Settings")
		ExcludeFromRotation[8] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation9:Settings")
		ExcludeFromRotation[9] =  MCM.GetModSettingBool("QuickOutfit", "bExcludeFromRotation10:Settings")
		
		ShareFollowerInventory[0] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory1:Settings")
		ShareFollowerInventory[1] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory2:Settings")
		ShareFollowerInventory[2] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory3:Settings")
		ShareFollowerInventory[3] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory4:Settings")
		ShareFollowerInventory[4] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory5:Settings")
		ShareFollowerInventory[5] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory6:Settings")
		ShareFollowerInventory[6] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory7:Settings")
		ShareFollowerInventory[7] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory8:Settings")
		ShareFollowerInventory[8] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory9:Settings")
		ShareFollowerInventory[9] = MCM.GetModSettingBool("QuickOutfit", "bShareFollowerInventory10:Settings")
	endIf

	; Biped slots
	if (asMCMsection == "BipedSlots"  || asMCMsection == "")
		BipedSlotIsEnabled[0] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot30:BipedSlots")				; Hair Top
		BipedSlotIsEnabled[1] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot31:BipedSlots")				; Hair Long
		BipedSlotIsEnabled[2] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot32:BipedSlots")				; FaceGen Head
		BipedSlotIsEnabled[3] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot33:BipedSlots")				; BODY
		BipedSlotIsEnabled[4] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot34:BipedSlots")				; L Hand
		BipedSlotIsEnabled[5] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot35:BipedSlots")				; R Hand
		BipedSlotIsEnabled[6] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot36:BipedSlots")				; [U] Torso
		BipedSlotIsEnabled[7] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot37:BipedSlots")				; [U] L Arm
		BipedSlotIsEnabled[8] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot38:BipedSlots")				; [U] R Arm
		BipedSlotIsEnabled[9] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot39:BipedSlots")				; [U] L Leg
		BipedSlotIsEnabled[10] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot40:BipedSlots")			; [U] R Leg
		BipedSlotIsEnabled[11] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot41:BipedSlots")			; [A] Torso
		BipedSlotIsEnabled[12] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot42:BipedSlots")			; [A] L Arm
		BipedSlotIsEnabled[13] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot43:BipedSlots")			; [A] R Arm
		BipedSlotIsEnabled[14] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot44:BipedSlots")			; [A] L Leg
		BipedSlotIsEnabled[15] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot45:BipedSlots")			; [A] R Leg
		BipedSlotIsEnabled[16] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot46:BipedSlots")			; Headband
		BipedSlotIsEnabled[17] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot47:BipedSlots")			; Eyes
		BipedSlotIsEnabled[18] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot48:BipedSlots")			; Beard
		BipedSlotIsEnabled[19] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot49:BipedSlots")			; Mouth
		BipedSlotIsEnabled[20] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot50:BipedSlots")			; Neck
		BipedSlotIsEnabled[21] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot51:BipedSlots")			; Ring
		BipedSlotIsEnabled[22] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot52:BipedSlots")			; Scalp
		BipedSlotIsEnabled[23] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot53:BipedSlots")			; Decapitation
		BipedSlotIsEnabled[24] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot54:BipedSlots")			; Unnamed
		BipedSlotIsEnabled[25] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot55:BipedSlots")			; Unnamed
		BipedSlotIsEnabled[26] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot56:BipedSlots")			; Unnamed
		BipedSlotIsEnabled[27] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot57:BipedSlots")			; Unnamed
		BipedSlotIsEnabled[28] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot58:BipedSlots")			; Unnamed
		BipedSlotIsEnabled[29] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot59:BipedSlots")			; Shield
		BipedSlotIsEnabled[30] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot60:BipedSlots")			; Pipboy
		BipedSlotIsEnabled[31] = MCM.GetModSettingBool("QuickOutfit", "bBipedSlot61:BipedSlots")			; FX
		
		bool bIgnoreWeapons = (MCM.GetModSettingBool("QuickOutfit", "bIgnoreWeapons:BipedSlots") == false)
		
		BipedSlotIsEnabled[32] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[33] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[34] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[35] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[36] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[37] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[38] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[39] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[40] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[41] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[42] = bIgnoreWeapons		; Possibly Weapons
		BipedSlotIsEnabled[43] = bIgnoreWeapons		; Possibly Weapons
	endIf
EndFunction

; Returns true if the actor is in Power Armor
bool Function IsInPowerArmor()
	Actor playerRef = Game.GetPlayer()
	if playerRef.IsInPowerArmor()
		Debug.Notification(Game.GetGameSettingString("sPADisallowed"))
		return true
	else
		return false
	endIf
endFunction

Function SetOutfitsetFormList(int aiOFIndex, int aiBSIndex, Form item)
	if aiOFIndex == 0
		OutfitsetFormList0[aiBSIndex] = item
	elseIf  aiOFIndex == 1
		OutfitsetFormList1[aiBSIndex] = item
	elseIf  aiOFIndex == 2
		OutfitsetFormList2[aiBSIndex] = item		
	elseIf  aiOFIndex == 3
		OutfitsetFormList3[aiBSIndex] = item
	elseIf  aiOFIndex == 4
		OutfitsetFormList4[aiBSIndex] = item
	elseIf  aiOFIndex == 5
		OutfitsetFormList5[aiBSIndex] = item
	elseIf  aiOFIndex == 6
		OutfitsetFormList6[aiBSIndex] = item
	elseIf  aiOFIndex == 7
		OutfitsetFormList7[aiBSIndex] = item
	elseIf  aiOFIndex == 8
		OutfitsetFormList8[aiBSIndex] = item
	elseIf  aiOFIndex == 9
		OutfitsetFormList9[aiBSIndex] = item
	endIf
EndFunction

Form Function GetOutfitsetFormList(int aiOFIndex, int aiBSIndex)
	if aiOFIndex == 0
		return OutfitsetFormList0[aiBSIndex]  as Form
	elseIf  aiOFIndex == 1
		return OutfitsetFormList1[aiBSIndex]  as Form
	elseIf  aiOFIndex == 2
		return OutfitsetFormList2[aiBSIndex]  as Form
	elseIf  aiOFIndex == 3
		return OutfitsetFormList3[aiBSIndex]  as Form
	elseIf  aiOFIndex == 4
		return OutfitsetFormList4[aiBSIndex]  as Form
	elseIf  aiOFIndex == 5
		return OutfitsetFormList5[aiBSIndex]  as Form
	elseIf  aiOFIndex == 6
		return OutfitsetFormList6[aiBSIndex]  as Form
	elseIf  aiOFIndex == 7
		return OutfitsetFormList7[aiBSIndex]  as Form
	elseIf  aiOFIndex == 8
		return OutfitsetFormList8[aiBSIndex]  as Form
	elseIf  aiOFIndex == 9
		return OutfitsetFormList9[aiBSIndex]  as Form
	endIf
EndFunction

Form Function GiveMeThatThing(Form akItem)
	Actor playerRef = Game.GetPlayer()

	; First of all search Dogmeat
	Actor dogmeatRef = Followers.DogmeatCompanion.GetActorReference() 
	if dogmeatRef && !dogmeatRef.IsInFaction(DisallowedCompanionFaction) &&	dogmeatRef.GetDistance(playerRef) <= 2500
		if dogmeatRef.GetItemCount(akItem) > 0
			dogmeatRef.RemoveItem(akItem, 1, true)
			playerRef.AddItem(akItem, 1, true)
			return akItem
		endIf
	endIf
	
	; Loop through active companions, seeing who is nearby and search their inventory
	int i = 0
	while (i < Followers.ActiveCompanions.GetCount())
		Actor companionRef = Followers.ActiveCompanions.GetAt(i) as Actor
		if companionRef && !companionRef.IsInFaction(DisallowedCompanionFaction) && companionRef.GetDistance(playerRef) <= 2500
			if companionRef.GetItemCount(akItem) > 0
				companionRef.RemoveItem(akItem, 1, true)
				playerRef.AddItem(akItem, 1, true)
				return akItem
			endIf
		endIf
		i += 1
	endWhile

	return NONE
EndFunction

Function TakeThisThing(Form akItem)
	Actor playerRef = Game.GetPlayer()
	
	if  playerRef.GetItemCount(akItem) == 0
		return
	endIf

	; First of all find Dogmeat
	Actor dogmeatRef = Followers.DogmeatCompanion.GetActorReference() 
	if dogmeatRef && !dogmeatRef.IsInFaction(DisallowedCompanionFaction) &&	dogmeatRef.GetDistance(playerRef) <= 2500
		if  (dogmeatRef.GetInventoryWeight() + akItem.GetWeight()) < dogmeatRef.GetValue(CarryWeight)
			if playerRef.GetItemCount(akItem) > 0
				playerRef.RemoveItem(akItem, 1, true)
				dogmeatRef.AddItem(akItem, 1, true)
				return
			endif
		endIf
	endIf
	
	; Loop through active companions, seeing who is nearby and give them the items
	int i = 0
	while (i < Followers.ActiveCompanions.GetCount())
		Actor companionRef = Followers.ActiveCompanions.GetAt(i) as Actor
		if companionRef && !companionRef.IsInFaction(DisallowedCompanionFaction) && companionRef.GetDistance(playerRef) <= 2500
			if  (companionRef.GetInventoryWeight() + akItem.GetWeight()) < companionRef.GetValue(CarryWeight)
				if playerRef.GetItemCount(akItem) > 0
					playerRef.RemoveItem(akItem, 1, true)
					companionRef.AddItem(akItem, 1, true)
					return
				endIf
			endIf
		endIf
		i += 1
	endWhile
EndFunction

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...