Mannequin Script

Post » Mon Nov 19, 2012 8:58 am

MannequinActivatorSCRIPT.psc was updated with Dawnguard and has several differences in the source code. However, the compiled script file was not included. Can someone check the updated one and see if the changes are good or not?

I don't really know why Dawnguard touched it to begin with but it would be nice to know if they were tinkering with a fix we just didn't know about.
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Mon Nov 19, 2012 1:26 am

Here are the scripts as I have them:
Vanilla:
Spoiler
Scriptname MannequinActivatorSCRIPT extends Actor  import debugimport utilityidle Property Pose01 Autoidle Property Pose02 Autoidle Property Pose03 AutoForm Property ArmorSlot01 auto hiddenForm Property ArmorSlot02 auto hiddenForm Property ArmorSlot03 auto hiddenForm Property ArmorSlot04 auto hiddenForm Property ArmorSlot05 auto hiddenForm Property ArmorSlot06 auto hiddenForm Property ArmorSlot07 auto hiddenForm Property ArmorSlot08 auto hiddenForm Property ArmorSlot09 auto hiddenForm Property ArmorSlot10 auto hiddenForm Property EmptySlot auto hiddenMessage Property MannequinActivateMESSAGE Auto{Message that appears upon activating the mannequin}Message Property MannequinArmorWeaponsMESSAGE Auto{Message that appears when you attempt to place a non-armor item}int Property CurrentPose =1 Auto{The pose the Mannequin starts in, and is currently in. DEFAULT = 1}EVENT OnCellLoad()		;Trace("DARYL - " + self + " Waiting a bit because it's the only way to get code to run in OnCellLoad it seems")	wait(0.25)		;Trace("DARYL - " + self + " Cell is loaded so running OnCellLoad()")		;Trace("DARYL - " + self + " Enabling my AI so I can play an idle");	self.EnableAI(TRUE)		; While(Is3DLoaded() == FALSE)	; ;Trace("DARYL - " + self + " Waiting for my 3d to load")		; wait(0.25)	; EndWhile	;Trace("DARYL - " + self + " Calling EquipCurrentArmor() Function")	EquipCurrentArmor()		;Trace("DARYL - " + self + " Blocking actors activation")	self.BlockActivation()		;Trace("DARYL - " + self + " Moving to my linked ref")	self.EnableAI(TRUE)	MoveTo(GetLinkedRef())		;Trace("DARYL - " + self + " Checking what pose I should be in and playing the idle");	PlayCurrentPose()		;Trace("DARYL - " + self + " Waiting for a bit to give myself time to animate to the pose");	wait(0.5)		;Trace("DARYL - " + self + " Disabling my AI so I'll freeze in place")	self.EnableAI(FALSE)EndEVENTEVENT OnEnable()	;Trace("DARYL - " + self + " Running OnEnable() EVENT")	EquipCurrentArmor()endEVENTEVENT OnActivate(ObjectReference TriggerRef)	;Trace("DARYL - " + self + " Showing the acivate menu")	;int buttonpressed = MannequinActivateMESSAGE.Show()	;	if buttonpressed == 0			;Trace("DARYL - " + self + " Player chose to Place Armor")			; Player selected to open the Mannequin's Inventory	PlayCurrentPose()			self.OpenInventory(TRUE)			;Trace("DARYL - " + self + " Enabling AI since we are adding an item to the mannequin")	;		self.EnableAI(TRUE)	;	elseif buttonpressed == 1			;Trace("DARYL - " + self + " Player chose to Pose the Mannequin")			; Player selected to change the pose			;Trace("DARYL - " + self + " Enabling AI since we are about to play an idle")	;		self.EnableAI(TRUE)			;Trace("DARYL - " + self + " Checking which pose i'm in and playing the next idle/pose")	;		if CurrentPose == 1	;			PlayIdle(Pose02)	;			CurrentPose = 2	;		elseif CurrentPose == 2	;			PlayIdle(Pose03)	;			CurrentPose = 3	;		elseif CurrentPose == 3	;			PlayIdle(Pose01)	;			CurrentPose = 1	;		endif	;	elseif buttonpressed == 2		;Trace("DARYL - " + self + " Player chose to do nothing")			;do nothing	;	endif		;Trace("DARYL - " + self + " Moving to my linked ref")	MoveTo(GetLinkedRef())		;Trace("DARYL - " + self + " Waiting a second to give me some time to animate to my pose")	wait(0.1)		;Trace("DARYL - " + self + " Disabling my AI so i'll freeze in place")	self.EnableAI(FALSE)EndEVENT	Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)	;Trace("DARYL - " + self + " Adding " + akBaseItem + " to the Mannequin")		if (akBaseItem as Armor) 		;Trace("DARYL - " + self + " Form " + akBaseItem + " is armor!")		AddToArmorSlot(akBaseItem)		self.EquipItem(akBaseItem)	else		;Trace("DARYL - " + self + " Form " + akBaseItem + " is NOT armor!")		;MessageBox("You can only place armor on the Mannequin.")		MannequinArmorWeaponsMESSAGE.Show()		;WaitMenuMode(0.1)		self.RemoveItem(akBaseItem, aiItemCount, true, Game.GetPlayer())		;Game.GetPlayer().AddItem(akBaseItem, aiItemCount, TRUE)	endif		endEventEvent OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)	;Trace("DARYL - " + self + akBaseObject + " was unequipped by the Mannequin")		if (akBaseObject as Armor)		;Trace("DARYL - " + self + " Form " + akBaseObject + " is armor!")		RemoveFromArmorSlot(akBaseObject)	else		;Trace("DARYL - " + self + " Form " + akBaseObject + " is NOT armor!")	endifendEventFunction PlayCurrentPose()	if CurrentPose == 1		PlayIdle(Pose01)	elseif CurrentPose == 2		PlayIdle(Pose02)	elseif CurrentPose == 3		PlayIdle(Pose03)	endifendFunctionFunction EquipCurrentArmor()	;Trace("DARYL - " + self + " Attempting to equip current armor")	if (ArmorSlot01 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 01")		self.EquipItem(ArmorSlot01)	endif	if (ArmorSlot02 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 02")		self.EquipItem(ArmorSlot02)	endif	if (ArmorSlot03 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 03")		self.EquipItem(ArmorSlot03)	endif	if (ArmorSlot04 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 04")		self.EquipItem(ArmorSlot04)	endif	if (ArmorSlot05 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 05")		self.EquipItem(ArmorSlot05)	endif	if (ArmorSlot06 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 06")		self.EquipItem(ArmorSlot06)	endif	if (ArmorSlot07 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 07")		self.EquipItem(ArmorSlot07)	endif	if (ArmorSlot08 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 08")		self.EquipItem(ArmorSlot08)	endif	if (ArmorSlot09 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 09")		self.EquipItem(ArmorSlot09)	endif	if (ArmorSlot10 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 10")		self.EquipItem(ArmorSlot10)	endifendFunctionFunction AddToArmorSlot(Form akBaseItem)	;Trace("DARYL - " + self + " Running the AddToArmorSlot Function")		bool FoundEmptySlot = FALSE		if (ArmorSlot01 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 01")		ArmorSlot01 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot02 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 02")		ArmorSlot02 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot03 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 03")		ArmorSlot03 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot04 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 04")		ArmorSlot04 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot05 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 05")		ArmorSlot05 = akBaseItem		FoundEmptySlot = TRUE	endif	if (ArmorSlot06 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 06")		ArmorSlot06 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot07 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 07")		ArmorSlot07 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot08 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 08")		ArmorSlot08 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot09 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 09")		ArmorSlot09 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot10 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 10")		ArmorSlot10 = akBaseItem		FoundEmptySlot = TRUE	endif	FoundEmptySlot = FALSEendFunctionFunction RemoveFromArmorSlot(Form akBaseItem)	;Trace("DARYL - " + self + " Running the RemoveFromArmorSlot Function")		bool FoundMatchingSlot = FALSE		if (ArmorSlot01 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 01")		ArmorSlot01 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot02 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 02")		ArmorSlot02 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot03 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 03")		ArmorSlot03 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot04 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 04")		ArmorSlot04 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot05 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 05")		ArmorSlot05 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot06 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 06")		ArmorSlot06 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot07 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 07")		ArmorSlot07 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot08 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 08")		ArmorSlot08 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot09 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 09")		ArmorSlot09 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot10 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 10")		ArmorSlot10 = EmptySlot		FoundMatchingSlot = TRUE	endif	endFunction
Dawnguard:
Spoiler
Scriptname MannequinActivatorSCRIPT extends Actor  import debugimport utilityidle Property Pose01 Autoidle Property Pose02 Autoidle Property Pose03 AutoForm Property ArmorSlot01 auto hiddenForm Property ArmorSlot02 auto hiddenForm Property ArmorSlot03 auto hiddenForm Property ArmorSlot04 auto hiddenForm Property ArmorSlot05 auto hiddenForm Property ArmorSlot06 auto hiddenForm Property ArmorSlot07 auto hiddenForm Property ArmorSlot08 auto hiddenForm Property ArmorSlot09 auto hiddenForm Property ArmorSlot10 auto hiddenForm Property EmptySlot auto hiddenMessage Property MannequinActivateMESSAGE Auto{Message that appears upon activating the mannequin}Message Property MannequinArmorWeaponsMESSAGE Auto{Message that appears when you attempt to place a non-armor item}int Property CurrentPose =1 Auto{The pose the Mannequin starts in, and is currently in. DEFAULT = 1}bool Property bResetOnLoad = FALSE	Auto{ this should be set to TRUE for mannequins that start disabled and are enabled while the cell is loaded   DEFAULT = FALSE }EVENT OnCellLoad();	debug.trace(self + " OnCellLoad ")	if IsEnabled() && !bResetOnLoad 		ResetPosition()	endifEndEVENTEVENT OnLoad();	debug.trace(self + " OnLoad")	if bResetOnLoad		; only do this once - for cases where mannequin is enabled in a loaded cell		bResetOnLoad = false		ResetPosition()	endifendEVENTEVENT OnActivate(ObjectReference TriggerRef)	;Trace("DARYL - " + self + " Showing the acivate menu")	;int buttonpressed = MannequinActivateMESSAGE.Show()	;	if buttonpressed == 0			;Trace("DARYL - " + self + " Player chose to Place Armor")			; Player selected to open the Mannequin's Inventory	PlayCurrentPose()			self.OpenInventory(TRUE)			;Trace("DARYL - " + self + " Enabling AI since we are adding an item to the mannequin")	;		self.EnableAI(TRUE)	;	elseif buttonpressed == 1			;Trace("DARYL - " + self + " Player chose to Pose the Mannequin")			; Player selected to change the pose			;Trace("DARYL - " + self + " Enabling AI since we are about to play an idle")	;		self.EnableAI(TRUE)			;Trace("DARYL - " + self + " Checking which pose i'm in and playing the next idle/pose")	;		if CurrentPose == 1	;			PlayIdle(Pose02)	;			CurrentPose = 2	;		elseif CurrentPose == 2	;			PlayIdle(Pose03)	;			CurrentPose = 3	;		elseif CurrentPose == 3	;			PlayIdle(Pose01)	;			CurrentPose = 1	;		endif	;	elseif buttonpressed == 2		;Trace("DARYL - " + self + " Player chose to do nothing")			;do nothing	;	endif		;Trace("DARYL - " + self + " Moving to my linked ref")	MoveTo(GetLinkedRef())		;Trace("DARYL - " + self + " Waiting a second to give me some time to animate to my pose")	wait(0.1)		;Trace("DARYL - " + self + " Disabling my AI so i'll freeze in place")	self.EnableAI(FALSE)EndEVENT	Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)	;Trace("DARYL - " + self + " Adding " + akBaseItem + " to the Mannequin")		if (akBaseItem as Armor) 		;Trace("DARYL - " + self + " Form " + akBaseItem + " is armor!")		AddToArmorSlot(akBaseItem)		self.EquipItem(akBaseItem)	else		;Trace("DARYL - " + self + " Form " + akBaseItem + " is NOT armor!")		;MessageBox("You can only place armor on the Mannequin.")		MannequinArmorWeaponsMESSAGE.Show()		;WaitMenuMode(0.1)		self.RemoveItem(akBaseItem, aiItemCount, true, Game.GetPlayer())		;Game.GetPlayer().AddItem(akBaseItem, aiItemCount, TRUE)	endif		endEventEvent OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)	;Trace("DARYL - " + self + akBaseObject + " was unequipped by the Mannequin")		if (akBaseObject as Armor)		;Trace("DARYL - " + self + " Form " + akBaseObject + " is armor!")		RemoveFromArmorSlot(akBaseObject)	else		;Trace("DARYL - " + self + " Form " + akBaseObject + " is NOT armor!")	endifendEventFunction ResetPosition()	debug.trace(self + " ResetPosition")	;Trace("DARYL - " + self + " Waiting a bit because it's the only way to get code to run in OnCellLoad it seems");	wait(0.25)		;Trace("DARYL - " + self + " Cell is loaded so running OnCellLoad()")		;Trace("DARYL - " + self + " Enabling my AI so I can play an idle");	self.EnableAI(TRUE)		; While(Is3DLoaded() == FALSE)	; ;Trace("DARYL - " + self + " Waiting for my 3d to load")		; wait(0.25)	; EndWhile		;Trace("DARYL - " + self + " Blocking actors activation")	self.BlockActivation()		;Trace("DARYL - " + self + " Moving to my linked ref")	self.EnableAI(TRUE)	; try this instead to force back into correct position	disable()	if !IsDisabled()		; we must have an enable parent if disable didn't work, so use the alternative method		MoveTo(GetLinkedRef())	endif	enable()	;Trace("DARYL - " + self + " Calling EquipCurrentArmor() Function")	EquipCurrentArmor()		;Trace("DARYL - " + self + " Checking what pose I should be in and playing the idle");	PlayCurrentPose()		;Trace("DARYL - " + self + " Waiting for a bit to give myself time to animate to the pose");	wait(0.5)		;Trace("DARYL - " + self + " Disabling my AI so I'll freeze in place")	self.EnableAI(FALSE)endFunctionFunction PlayCurrentPose()	if CurrentPose == 1		PlayIdle(Pose01)	elseif CurrentPose == 2		PlayIdle(Pose02)	elseif CurrentPose == 3		PlayIdle(Pose03)	endifendFunctionFunction EquipCurrentArmor()	;Trace("DARYL - " + self + " Attempting to equip current armor")	if (ArmorSlot01 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 01")		self.EquipItem(ArmorSlot01)	endif	if (ArmorSlot02 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 02")		self.EquipItem(ArmorSlot02)	endif	if (ArmorSlot03 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 03")		self.EquipItem(ArmorSlot03)	endif	if (ArmorSlot04 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 04")		self.EquipItem(ArmorSlot04)	endif	if (ArmorSlot05 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 05")		self.EquipItem(ArmorSlot05)	endif	if (ArmorSlot06 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 06")		self.EquipItem(ArmorSlot06)	endif	if (ArmorSlot07 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 07")		self.EquipItem(ArmorSlot07)	endif	if (ArmorSlot08 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 08")		self.EquipItem(ArmorSlot08)	endif	if (ArmorSlot09 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 09")		self.EquipItem(ArmorSlot09)	endif	if (ArmorSlot10 != EmptySlot)		;Trace("DARYL - " + self + " Equipping " + ArmorSlot01 + " from Slot 10")		self.EquipItem(ArmorSlot10)	endifendFunctionFunction AddToArmorSlot(Form akBaseItem)	;Trace("DARYL - " + self + " Running the AddToArmorSlot Function")		bool FoundEmptySlot = FALSE		if (ArmorSlot01 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 01")		ArmorSlot01 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot02 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 02")		ArmorSlot02 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot03 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 03")		ArmorSlot03 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot04 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 04")		ArmorSlot04 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot05 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 05")		ArmorSlot05 = akBaseItem		FoundEmptySlot = TRUE	endif	if (ArmorSlot06 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 06")		ArmorSlot06 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot07 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 07")		ArmorSlot07 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot08 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 08")		ArmorSlot08 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot09 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 09")		ArmorSlot09 = akBaseItem		FoundEmptySlot = TRUE	endif		if (ArmorSlot10 == EmptySlot) && (FoundEmptySlot == FALSE)		;Trace("DARYL - " + self + " Placing " + akBaseItem + " in armor slot 10")		ArmorSlot10 = akBaseItem		FoundEmptySlot = TRUE	endif	FoundEmptySlot = FALSEendFunctionFunction RemoveFromArmorSlot(Form akBaseItem)	;Trace("DARYL - " + self + " Running the RemoveFromArmorSlot Function")		bool FoundMatchingSlot = FALSE		if (ArmorSlot01 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 01")		ArmorSlot01 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot02 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 02")		ArmorSlot02 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot03 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 03")		ArmorSlot03 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot04 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 04")		ArmorSlot04 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot05 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 05")		ArmorSlot05 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot06 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 06")		ArmorSlot06 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot07 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 07")		ArmorSlot07 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot08 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 08")		ArmorSlot08 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot09 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 09")		ArmorSlot09 = EmptySlot		FoundMatchingSlot = TRUE	endif		if (ArmorSlot10 == akBaseItem) && (FoundMatchingSlot == FALSE)		;Trace("DARYL - " + self + " Match Found, Removing " + akBaseItem + " from armor slot 10")		ArmorSlot10 = EmptySlot		FoundMatchingSlot = TRUE	endif	endFunction
Interestingly, the vanilla script is the only script to try to use an "OnEnable" event/function, but this never appears to be called. It's been removed in the Dawnguard version.

The Dawnguard version has created a "ResetPosition" function and a "bResetOnLoad" property that is false by default. Depending on the value of this property, the ResetPosition function will be called either OnCellLoad if it's false (as default) or OnLoad if it's true.

The vanilla script had an OnCellLoad event that ran a few commands, but this has been entirely replaced. Here it is without all of the commented out code:
EVENT OnCellLoad()	wait(0.25)	EquipCurrentArmor()	self.BlockActivation()	self.EnableAI(TRUE)	MoveTo(GetLinkedRef())	self.EnableAI(FALSE)EndEVENT

The "ResetPosition" function, which was added in the Dawnguard version, is very similar to that event in the vanilla version. Here it is without all of the commented out code:
Function ResetPosition()	debug.trace(self + " ResetPosition")	self.BlockActivation()	self.EnableAI(TRUE)	disable()	if !IsDisabled()		; we must have an enable parent if disable didn't work, so use the alternative method		MoveTo(GetLinkedRef())	endif	enable()	EquipCurrentArmor()	self.EnableAI(FALSE)endFunction

So, the first change is that this code is, or at least can be, called at slightly different times. Aside from that, there have been some slight changes mainly in the order in which this code runs.

I haven't messed around with mannequins myself but I have heard that they can be tricky, so I don't really want to speculate as to what the implications of these changes might be, but hopefully this post will be helpful to someone more experienced with them.

Cipscis
User avatar
Alexis Acevedo
 
Posts: 3330
Joined: Sat Oct 27, 2007 8:58 pm

Post » Mon Nov 19, 2012 4:09 am

This is interesting. Good catch Arthmoor. So they put a bug fix in the DLC? What about the people who never get the DLC? If that is what it is, it apparently didn't work very well. Plenty of people are still complaining about the mannequins moving on entry and not getting dressed and I know some of those are using Dawnguard. I wonder if they are still using the custom mannequin scripts that would override the "improved" Dawnguard script?
User avatar
joannARRGH
 
Posts: 3431
Joined: Mon Mar 05, 2007 6:09 am

Post » Mon Nov 19, 2012 11:22 am

The compiled version of that isn't included, which is why I was asking. It can't interfere with other mods without that.

As for why it showed up in a DLC, who knows. Maybe it was on the stack of things they touched and they didn't remember why. Perhaps someone jumped the gun on something intended for Patch 1.8 and didn't catch it.
User avatar
Danii Brown
 
Posts: 3337
Joined: Tue Aug 22, 2006 7:13 am

Post » Mon Nov 19, 2012 8:50 am

I missed that. For some reason, I read your comment to say the source wasn't included. I wish I could say it is because I am young and impetuous, but now it's just old and stupid. :)

So it is something they worked on and never implemented for some reason. I don't have DG, or I would try to test it. That script could use some improving.
User avatar
Suzie Dalziel
 
Posts: 3443
Joined: Thu Jun 15, 2006 8:19 pm

Post » Mon Nov 19, 2012 10:01 am

I missed that. For some reason, I read your comment to say the source wasn't included. I wish I could say it is because I am young and impetuous, but now it's just old and stupid. :smile:

So it is something they worked on and never implemented for some reason. I don't have DG, or I would try to test it. That script could use some improving.

http://skyrim.nexusmods.com/mods/10652

Something Arthmoor might want to look into incorporating into the USKP, probably.
User avatar
Marion Geneste
 
Posts: 3566
Joined: Fri Mar 30, 2007 9:21 pm

Post » Mon Nov 19, 2012 1:49 am

The script doesn't rely on anything Dawnguard related, at least as far as I could tell. I suppose I should just compile it and go see what happens. I've got plenty of mannequins with stuff on them that should be immediately obvious if there's a problem.

@Thomas: Given who made that, I'm not inclined to consider using it, and I think we should leave it at that.
User avatar
Lavender Brown
 
Posts: 3448
Joined: Tue Jul 25, 2006 9:37 am

Post » Mon Nov 19, 2012 7:03 am

I do use that script Thomas and my statement is still accurate. It could still use some improving. Not saying its Dave's fault or anything. His version is certainly better than vanilla and better than anything I could do, but the mannies are still unruly in bunches. I would love to see Bethesda come up with a real solution to the problem.
User avatar
D LOpez
 
Posts: 3434
Joined: Sat Aug 25, 2007 12:30 pm

Post » Mon Nov 19, 2012 10:32 am

It sounds like someone experimented with a possible fix using the Dawnguard DLC. I see nothing has changed on this front.
.
Mannequins can be unpredictable when there is a high demand from the cell - either from too many mannequins, too big a cell, too complex a NavMesh environment, or Windows Media Player kicking in behind your back and hogging OS resources - take your pick. As far as I've seen, Bethesda won't put more than four mannequins in the same cell. I think there is a reason for this and I've tried a lot of techniques to mitigate that reason. So far, no success for me. Part of the problem is that while the texture stays put, the mesh tends to drift. In some circumstances, positional corrections do very little because, the mesh remains in motion while the texture remains in the correct place.
.
This doesn't happen with objects or other actors and I wonder if it might have something to do with a fault in the model itself...
.
It's a pity, really. Typically, a cell of any reasonable complexity will have dozens of interconnected intersections and, where there is an important doorway to mark, a pair of mannequins would do the trick quite traditionally. However, coming back to the scope of cells with a higher degree of complexity, dozens of interconnected intersections would present several or even a dozen important doorways - which tends to multiply the demand on mannequins in some contexts. So, for now, I plan to avoid using mannequins, in any great numbers, until I hear this problem has been fixed.
User avatar
Latino HeaT
 
Posts: 3402
Joined: Thu Nov 08, 2007 6:21 pm

Post » Mon Nov 19, 2012 7:12 am

RealmEleven - I think mannequins may be affected while other actors aren't because of AI-related issues. When working with my http://skyrim.nexusmods.com/downloads/file.php?id=5432, I experimental extensively with real-time movement; of statics, activators, actors, havok-enabled objects, and probably some other stuff. I found that trying to do certain movement functions on certain types of objects will cause what you describe - meshes moving while textures remain in place. Sometimes the collision moves, sometimes it doesn't - again, depending on the object type.

Regarding actors in this case, if an actor is translatedTo while enableAI(false), strange things happen. So it could be a matter of timing, which would be thrown off in highly-cluttered/populated areas. In the onCellAttach, the mannequins are forced back to a linked ref; but the AI has to be enabled first, then it's moved, then disabled again. Theoretically, if the enableAI function doesn't happen fast enough before the move function is called, drama ensues.

Since v1.6 Skyrim, I noticed that certain functions have become 'slower' in that they need a wait() after them (or some kind of check) in order to actually work properly. V1.6 also introduced is3DLoaded issues where certain functions prev1.6 could be performed on disabled or non-loaded objects, but CTD or other errors now occur. This could be the case with v1.7 as well.

I haven't updated to v1.7 Skyrim yet (I've been extremely busy with real-life work lately, but have finished that project and now have a little time for modding/etc). It has been brought to my attention that this new mannequin bug may have been introduced with that update; so I'll be trying to solve it in the next few days I hope. If it IS a matter of DLC causing the drama, I can't help as I don't have any DLC and have no plans to get it.


ch0k3hold - heheheh I know that my Script Fix can be better, but I decided to keep it as close to the Vanilla as possible. The only divergences are enabling poses (which apparently Ma Beth couldn't get to work properly, and is STILL a little on the buggy side in certain cases), converting the slot system to a faster array system, and of course the changes needed to prevent all 3 mannequin-related bugs (Wandering, Naked, Dupe).
User avatar
Rudi Carter
 
Posts: 3365
Joined: Fri Sep 01, 2006 11:09 pm

Post » Mon Nov 19, 2012 5:21 am

Hey, RealmEleven! Where you been man? It's been awhile. I hope all is well. Welcome back.

Dave, you know I was not really complaining about your script but about the nature of the mannequins themselves. I think your script is the best thing we have so far and I've been using it for months with mixed results that are mostly positive. I appreciate the work you and Demonjax put into it.

Since I wrote that comment, I have made some structural revisions to my mod that have helped tremendously in my testing. The Warehouse section of the Dovahkiins Warehouse and Bedroom mod has almost 100 mannequins (97 I think) in one cell. They are split into three roombounds, more or less evenly. On entry, they are all moving, of course, and then generally all go back to their markers as long as I was using your script instead of vanilla. Generally being the operative word though. Sometimes they could be near perfect and other times they could be all over the room. Generally (again) they would be better if you leave immediately and reenter to give them another chance. With the vanilla script, they would usually get worse with each entry and soon be hopelessly scattered. One thing that seems to make a difference is the number of mannequins in the cell. Up to about 24 seems to work pretty well. By thirty, things get pretty dicey.

What I have done is to add entry chambers (vestibules) to the Warehouse that use two roombounds and offset portals to avoid rendering the main rooms until after the mannequins have had a chance to get set and equipped. On the player's first entry to the cell, the mannequins are generally pretty good but probably not perfect. A fast out and back in will set them all perfectly in place and after that, they have been just damn near perfect on every successive entry. I've been more than pleased with the results. I really need something that works as the armory sections I am working on have once cell with nearly 300 mannequins in several rooms, but the main armory has perhaps 200 mannequins in one room. So far, both of those cells are working just as well as the smaller rooms of the Warehouse although I have not tried equipping all the mannequins with the new structure yet.
User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Post » Mon Nov 19, 2012 1:43 pm

I just updated to v1.7; which gave me the source to the Dawnguard scripts. For those of you too proud to use my Script-Fix (or have legit issues with it), I think I found the problem with Dawnguard's mannequinActivatorScript. (BUT it seems the Dawnguard script may still suffer from Dupe and Naked Bugs.. soooo...)

Try inserting a "wait(.2)" after the "disable()" in the "ResetPosition()" function. Enable (and presumably disable) is time-sensitive.. my system cannot run certain functions immediately after enable(), it'll return a '3D not loaded' error. If disable works the same way, the "if !isDisabled()" will never allow that block to execute (though I suspect on high-end systems it MIGHT, but I doubt it). I think this was introduced to the game-engine in the v1.6 update - which I had to fix my Gokstad mod after (by inserting the waits after enables); before that it could run without the waits.

I'll compile the Dawnguard script and test it with my Vanilla Solitude mannequins to see what's what; and whether or not the above fix works or not.

[EDIT: heheheh I know ch0k3hold... but if you know me at all, you know I gotta explain myself! As for your "mixed results" - if you place a wait(x) somewhere in the script, it should give enough time for ALL mannequins to do what they gotta do. In my opinion, with 5 million mannequins, the VM only has time to do a couple of their scripts before it moves on... which may explain why if you exit then reenter (without fast-trav of course), more fall in line (since the first ones are already there). My best guess would be to add the wait(x) immediately after the "moveTo(getLinkedRef())" in the "playCurrentPose()" function... where the "x" you would have to tinker with to see how long for however many mannequins (I would try .2 to start)]
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Mon Nov 19, 2012 4:31 pm

Having tested the Dawnguard mannequin script compiled as-is, with Vanilla Sky (no DLC)... I verified that the Naked and Dupe Bugs ARE still present, but I couldn't get the Wandering Bug to trigger. This was tested in Solitude Proudspire; with a fresh game/unmodded 'quins, fresh game/modded 'quins, and a level 40+ saveGame (with 'quins already obtained and activated)... all the same.

Since I couldn't get the Wandering Bug to trigger, I haven't been able to test the "wait(x)" theory... so it seems you guys are on your own in testing that. Lemme know if it works so I can update the VanQuinScriptFix (for use by rational people).
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am

Post » Mon Nov 19, 2012 5:38 pm

Thanks http://www.gamesas.com/user/764276-sluckyd/, for reminding me. I Have seen something like this before. Oblivion used to have a problem where, if you moved an object with a script, only the texture would be moved but not the mesh. In the case of mannequins, the mesh is in gradual motion while the texture remains stationary. It could be that, by design, there are separate commands for moving texture and for moving mesh. However, I wonder why is the mannequin mesh prone to motion of its own? If this particular glitch (mesh in motion) is unique to mannequins it might be suggestive of a problem with the model.
.
Hello http://www.gamesas.com/user/793970-ch0k3h0ld/! I have my fingers in too many pots and my hands in too many plots these days. Yes, it has been awhile and it is good to be back. Some things can be very demanding. Anyway, I'm still making headway with my Eisamstein mod and, hopefully, I might even have something publishable ready by early next year. I can dodge Mannequin and LOD issues but I'm hoping that the NavMesh Bug has finally been put to bed. After all, one interior space leads to another...
User avatar
Markie Mark
 
Posts: 3420
Joined: Tue Dec 04, 2007 7:24 am

Post » Mon Nov 19, 2012 5:58 pm

This whole issue complicates slightly because Hearthfire includes a compiled .pex file that does something to the mannequins. That could just be the compiled result of the script that slipped in with Dawnguard. Someone would probably have to decompile the Hearthfire .pex file to find out.

@RealmEleven: Yes, the navmesh bug was slain permanently with patch 1.6.
User avatar
Oscar Vazquez
 
Posts: 3418
Joined: Sun Sep 30, 2007 12:08 pm

Post » Mon Nov 19, 2012 10:45 am

Thanks for the reassurance, http://www.gamesas.com/user/176330-arthmoor/, it was much needed. Thanks also for the http://code.google.com/p/skyrim-plugin-decoding-project/downloads/list. I've just downloaded it.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » Mon Nov 19, 2012 1:08 pm

I doubt the game-engine allows for moving tex vs mesh... I think it's more a matter of the tex having rendered in one spot, the engine programmed to continue rendering it, but that bit of code isn't written to update 'real-time' for specific instances. I dunno if an app (such as SKSE/etc, ie- is memory resident) can be written to rectify that. I would have hoped that Ma Beth would have re-written the code to account for these types of things, unless they just want to make due with what they have and leave it at that.

Having just updated my Skyrim two days ago, I know they have yet to offer the source for Hearthfire, just Dawnguard (which may have been a mistake on their part.. offering the sources to we who don't actually have the DLC). It seems that every single thing Ma Beth releases now messes with things prompting everyone to revamp their methodology and/or fix what they've already done... which I believe, will put a severe damper on modding in general.


Does anyone know if the Wandering Bug affects specific mannequins (eg- ONLY in Dawnguard or a specific Vanilla location)? I remember the v1.6 update only messed with certain one (like Winterhold, but not Proudspire). If so, it could be those actors contain data which precludes certain scripting (such as 'enable by parent' etc).


RealmEleven - Mannequins are actors just like any other.. only they have different AI packages and scripting. Presumably, ALL actors would be affected by this, if found containing the offending trigger. I REALLY doubt it's the actual mesh (though mannequins ARE kinda unique in that respect, but it was so long ago I saw that, I don't reme,ber specifically how)... this opinion is backed up by my http://skyrim.nexusmods.com/downloads/file.php?id=10578 , which needed the extra code to prevent all bugs - even though they are clones of non-mannequin actors (but assigned scripting and AI which would offend the game-engine).
User avatar
louise hamilton
 
Posts: 3412
Joined: Wed Jun 07, 2006 9:16 am


Return to V - Skyrim