There've been some errors which it has logged that I've been able to fix myself but there's this one for Enhanced Economy which has me stumped. Mainly because I'm a complete novice at scripting.
Error:
Unknown reference object for function 'SetBarterGold'. Execution of script 'EEresetBarterGold' stopped.
The EEresetBarterGold script:
ScriptName EEresetBarterGoldref merchantBegin Function {}	AlvesUvenimRef.SetBarterGold 800 	AngalmoRef.SetBarterGold 800 	ArdalineRef.SetBarterGold 800 	ClaudettePerrickRef.SetBarterGold 1200 	EilonwyRef.SetBarterGold 800 	EngormRef.SetBarterGold 5 	FalanuHlaaluRef.SetBarterGold 800 	FelenRelasRef.SetBarterGold 600 	JulienneFanisRef.SetBarterGold 15 	OgierGeorickRef.SetBarterGold 800 	SdrassaRef.SetBarterGold 10 	SelenaOraniaRef.SetBarterGold 800 	SigridRef.SetBarterGold 200 	SinderionRef.SetBarterGold 400 	DiramSerethiRef.SetBarterGold 200 	ErnestManisRef.SetBarterGold 50 	MargarteRef.SetBarterGold 5 	BugakgroBolRef.SetBarterGold 1000 	EstelleRenoitRef.SetBarterGold 600 	MachNaRef.SetBarterGold 1200 	PhintiasRef.SetBarterGold 1200 	PaloniryaRef.SetBarterGold 1200 	SkjortaRef.SetBarterGold 1000 	AymarDouarRef.SetBarterGold 5 	CalindilRef.SetBarterGold 1000 	DelmarRef.SetBarterGold 1200 	EdgarVautrineRef.SetBarterGold 800 	UngarionRef.SetBarterGold 800 	DarJeeRef.SetBarterGold 800 	FathisUlesRef.SetBarterGold 1500 	LucianaGalenaRef.SetBarterGold 1000 	OngartheWorldWearyRef.SetBarterGold 600 	OrrinRef.SetBarterGold 1200 	JensineRef.SetBarterGold 600 	AgnetethePickledRef.SetBarterGold 1200 	BatulgraSharobRef.SetBarterGold 200 	DaenlinRef.SetBarterGold 1000 	EnilrothRef.SetBarterGold 600 	FjotreidRef.SetBarterGold 800 	MaroRufusRef.SetBarterGold 800 	OlfandRef.SetBarterGold 1000 	RashedaRef.SetBarterGold 1200 	RohssanRef.SetBarterGold 1200 	SabineLaulRef.SetBarterGold 600 	TertiaViduciaRef.SetBarterGold 1000 	TunZeeusRef.SetBarterGold 800 	UrbulgroOrkulgRef.SetBarterGold 800 	VarelMorvaynRef.SetBarterGold 1200 	VarnadoRef.SetBarterGold 1000 	ViatorAcciusRef.SetBarterGold 1000 	BorbagraUzgashRef.SetBarterGold 1000 	ElsyniaRef.SetBarterGold 1000 	EtiraMoslinRef.SetBarterGold 200 	GundalasRef.SetBarterGold 1000 	GunderRef.SetBarterGold 800 	MaenlornRef.SetBarterGold 600 	NilawenRef.SetBarterGold 800 	NorbertLellesRef.SetBarterGold 800 	NordinorRef.SetBarterGold 400 	RindirRef.SetBarterGold 600 	SergiusVerusRef.SetBarterGold 1000 	ShadySamRef.SetBarterGold 400 	SuurootanRef.SetBarterGold 600 	TertullianVerusRef.SetBarterGold 1000 	ThoronirRef.SetBarterGold 800 	SeedNeeusRef.SetBarterGold 800 	AbhukiRef.SetBarterGold 50 	AndreasDraconisRef.SetBarterGold 50 	AugustaCalidiaRef.SetBarterGold 50 	BogrumGroGalashRef.SetBarterGold 50 	ChristopheMaraneRef.SetBarterGold 50 	DavelaHlarenRef.SetBarterGold 50 	DelosFandasRef.SetBarterGold 50 	DerveraRomalenRef.SetBarterGold 50 	EmfridRef.SetBarterGold 50 	ErinaJeranusRef.SetBarterGold 50 	ForochRef.SetBarterGold 50 	GilgondorinRef.SetBarterGold 50 	HafidHollowlegRef.SetBarterGold 50 	KirstenRef.SetBarterGold 50 	LeyMarillinRef.SetBarterGold 50 	LutherBroadRef.SetBarterGold 50 	MaleneRef.SetBarterGold 50 	ManheimMaulhandRef.SetBarterGold 50 	MarianaAnchariaRef.SetBarterGold 50 	MoggraMogakhRef.SetBarterGold 50 	NerussaRef.SetBarterGold 50 	OlavRef.SetBarterGold 50 	OrmilRef.SetBarterGold 50 	ShuraviRef.SetBarterGold 50 	SthasaRef.SetBarterGold 50 	TalasmaRef.SetBarterGold 50 	VelusHosidiusRef.SetBarterGold 50 	VlanhonderMoslinRef.SetBarterGold 50 	WilburRef.SetBarterGold 50 	WilletRef.SetBarterGold 50 	WitseidutseiRef.SetBarterGold 50 	if IsModLoaded "DLCShiveringIsles.esp"		let merchant := GetFormFromMod "Oblivion.esm" "015868"		merchant.SetBarterGold 1200		let merchant := GetFormFromMod "Oblivion.esm" "013BB6"		merchant.SetBarterGold 3		let merchant := GetFormFromMod "Oblivion.esm" "01586D"		merchant.SetBarterGold 1200		let merchant := GetFormFromMod "Oblivion.esm" "013BBA"		merchant.SetBarterGold 1000		let merchant := GetFormFromMod "Oblivion.esm" "015866"		merchant.SetBarterGold 1000		let merchant := GetFormFromMod "Oblivion.esm" "013B47"		merchant.SetBarterGold 1200		let merchant := GetFormFromMod "Oblivion.esm" "015869"		merchant.SetBarterGold 1000		let merchant := GetFormFromMod "Oblivion.esm" "01586C"		merchant.SetBarterGold 5		let merchant := GetFormFromMod "Oblivion.esm" "0131F9"		merchant.SetBarterGold 300	endifEndUsing CSE I've hovered the cursor over all of the objects like "WitseidutseiRef" and there aren't any errors flagged in the ToolTip text.
Using TES4Edit I've checked the FormIDs (e.g. 0131F9) for the Shivering Isles and they all seem to be valid NPCs.
I thought I'd try using CSE's to compile Enhanced Economy's scripts to see if that flagged any errors. No errors were flagged in the EEresetBarterGold script but three other scripts showed errors in the CSE console. From my limited understanding I think these other script errors are in bits of the scripts reserved for debugging.
[CSE] Script 'EElocalEconomyMenus' {0103BCC8}:
[CS] Script 'EElocalEconomyMenus', line 354: Script command "SetString" not found.
[CS] Script 'EElocalEconomyMenus', line 355: Script command "FindFirstFile" not found.
[CS] Script 'EElocalEconomyMenus', line 360: Script command "FindNextFile" not found.
[CS] Script 'EElocalEconomyMenus', line 356: Invalid operands for operator -.
[CS] Script 'EElocalEconomyMenus', line 356: Could not parse this line.
[CS] Script 'EElocalEconomyMenus', line 357: Syntax Error. Unknown command 'ToOBSE'.
[CS] Script 'EElocalEconomyMenus', line 357: Syntax Error. Missing expression in set command.
ScriptName EElocalEconomyMenus
ScriptName EElocalEconomyMenusshort menushort buttonshort ishort eeTempref eeMerchantfloat eeTempFarray_var item_listarray_var item_relationsshort menu_indexshort menu_sub_indexshort menu_index_topshort menu_modearray_var a1array_var a2array_var menu_arrayarray_var menu_array_namesstring_var menu_namestring_var sub_menu_namestring_var s1string_var s2short price_selectorarray_var merchant_listshort priceDataIndexarray_var item_listarray_var repriced_refsarray_var repriced_valsref itemfloat pricefloat fQuestDelayTimeBegin MenuMode let fQuestDelayTime := 0.01 if MenuMode 1002 if IsConsoleOpen==0 if OnKeyDown tnoEE.menuKey if tnoEE.resetKey || tnoEE.useLocationPrices > 0 || tnoEE.useMerchantPrices > 0 || tnoEEM.priceReadingEnabled let menu := -1 endif endif endif endif if menu > 0 let button := GetButtonPressed else let button := -1 endif if menu == -1 SetDebugMode tnoEE.debug let s1 := "Enhanced Economy options" if tnoEE.resetKey let s1 += "|Reset merchants" let i := 1 let priceDataIndex := 1 else let i := 0 let priceDataIndex := 0 endif if tnoEE.useLocationPrices > 0 let s1 += "|Location prices" let priceDataIndex += 1 endif if tnoEE.useMerchantPrices > 0 let s1 += "|Merchant prices" let priceDataIndex += 1 endif if tnoEEM.priceReadingEnabled let s1 += "|Read price data" else let priceDataIndex := -1 endif let s1 += "|Cancel" MessageBoxEx $s1 let menu := 1 elseif menu == 1 if button == -1 return endif if button == 0 && tnoEE.resetKey let menu := -10 else if tnoEE.useLocationPrices > 0 if button == i let menu := -20 let menu_mode := 0 let menu_name := "Location" let menu_array := tnoEE.location_prices return endif let i += 1 endif if tnoEE.useMerchantPrices > 0 && button == i let menu := -20 let menu_mode := 1 let menu_name := "Merchant" let menu_array := tnoEE.merchant_prices return endif if button == priceDataIndex let menu := -60 return endif let menu := 0 endif elseif menu == -10 let s1 := "Enhanced Economy will now reset all merchants' barter gold" if tnoEE.autoHaggle == 0 && tnoEE.haggleLimit > 0 let s1 += " and haggle count" endif let s1 += ".%rAre you sure?|OK|Cancel" MessageBoxEx $s1 let menu := 10 elseif menu == 10 if button == 0 let tnoEEM.merchant_list := ar_Construct Array DebugPrint "EE:Resetting merchant list" let menu := 0 elseif button == 1 let menu := 0 endif elseif menu == -20 MessageBoxEx "Enhanced Economy %z dependent prices:|Reset all|Edit|Close", menu_name let menu := 20 elseif menu == 20 if button == 0 let menu := -21 elseif button == 1 let menu_index := 0 let menu_index_top := 0 let menu_array_names := ar_Construct Array ForEach a1 <- menu_array let menu_array_names[menu_index_top] := a1["Key"] let menu_index_top += 1 Loop let item_list := ar_Construct Array let item_list[0] := "All" let item_list[1] := "Armor" let item_list[2] := "LiShield" let item_list[3] := "LiArmor" let item_list[4] := "HeShield" let item_list[5] := "HeArmor" let item_list[6] := "RprHammer" let item_list[7] := "Weapon" let item_list[8] := "Blade" let item_list[9] := "Blunt" let item_list[10] := "Bow" let item_list[11] := "Arrow" let item_list[12] := "Magic" let item_list[13] := "Staff" let item_list[14] := "Scroll" let item_list[15] := "SoulGem" let item_list[16] := "Ayleid" let item_list[17] := "Furniture" let item_list[18] := "Book" let item_list[19] := "Ingredient" let item_list[20] := "Food" let item_list[21] := "Drink" let item_list[22] := "Potion" let item_list[23] := "Apparatus" let item_list[24] := "Jewelry" let item_list[25] := "Clothes" let item_list[26] := "ClothesLo" let item_list[27] := "ClothesMi" let item_list[28] := "ClothesUp" let item_list[29] := "Misc" let item_list[30] := "LockPick" let item_list[31] := "Gems" let item_list[32] := "Cloth" let item_list[33] := "MiscLower" let item_list[34] := "MiscMiddle" let item_list[35] := "MiscUpper" let item_list[36] := "Pelt" let item_list[37] := "Enchanted" let menu := -30 elseif button == 2 let menu := 0 endif elseif menu == -21 MessageBoxEx "Enhanced Economy will now reset all %z dependent prices to default.%rAre you sure?|OK|Cancel", menu_name let menu := 21 elseif menu == 21 if button == 0 let a1 := ar_Null ForEach a1 <- menu_array let a2 := a1["Value"] let eeTemp := ar_Size a2 ar_Erase a2 "-":"aaa" let i := ar_Size a2 if i != eeTemp let s1 := a1["Key"] DebugPrint "EE:%z reduced from %.0f to %.0f elements", s1, eeTemp, i endif Loop let a2 := ar_Null let menu := 0 elseif button == 1 let menu := 0 endif elseif menu == -30 let s1 := "Enhanced Economy " + menu_name + "s.%rClick to edit." let i := menu_index While i < menu_index + 7 let s1 += "|" + menu_array_names[i] let i += 1 Loop if menu_index > 0 let s1 += "|< Previous" endif if menu_index + 7 < menu_index_top let s1 += "|> Next" endif let s1 += "|Close" MessageBoxEx $s1 let menu := 30 elseif menu == 30 if button >= 0 && button < 7 let i := menu_index + button let sub_menu_name := menu_array_names[i] let menu_sub_index := 0 let menu_index_top := ar_Size item_list if menu_mode == 0 let menu_index_top -= 1 endif let menu_array := menu_array[$sub_menu_name] let menu := -40 elseif button == 7 && menu_index > 0 let menu_index -= 7 if menu_index < 0 let menu_index := 0 endif let menu := -30 elseif (button == 7 && menu_index == 0) || (button == 8 && menu_index > 0 && menu_index + 7 < menu_index_top) let menu_index += 7 if menu_index + 7 > menu_index_top let menu_index := menu_index_top - 7 endif let menu := -30 elseif button > 0 let menu := -100 ; cleanup endif elseif menu == -40 let s1 := "Enhanced Economy " + menu_name + " settings: " + sub_menu_name + "%rClick to edit." let i := menu_sub_index While i < menu_sub_index + 7 let s2 := item_list[i] let eeTempF := Call EElocalEconomyFindPrice menu_array ar_Null s2 1 if price_selector < 2 let s1 += sv_Construct "|%z - %.2f", s2, eeTempF if price_selector == 0 let s1 += "*" endif else let s1 += sv_Construct "|%z - (%.2f)", s2, eeTempF endif let i += 1 Loop if menu_sub_index > 0 let s1 += "|< Previous" endif if menu_sub_index + 7 < menu_index_top let s1 += "|> Next" endif let s1 += sv_Construct "|^Up to %zs", menu_name MessageBoxEx $s1 let menu := 40 elseif menu == 40 if button >= 0 && button < 7 let i := menu_sub_index + button let s2 := item_list[i] let menu := -50 elseif button == 7 && menu_sub_index > 0 let menu_sub_index -= 7 if menu_sub_index < 0 let menu_sub_index := 0 endif let menu := -40 elseif (button == 7 && menu_sub_index == 0) || (button == 8 && menu_sub_index > 0 && menu_sub_index + 7 < menu_index_top) let menu_sub_index += 7 if menu_sub_index + 7 > menu_index_top let menu_sub_index := menu_index_top - 7 endif let menu := -40 elseif button > 0 let menu_index_top := ar_Size menu_array_names if menu_mode == 0 let menu_array := tnoEE.location_prices else let menu_array := tnoEE.merchant_prices endif let menu := -30 endif elseif menu == -50 if IsTextInputInUse MessageBox "Text Input box is busy!" let menu := 0 return endif let eeTempF := Call EElocalEconomyFindPrice menu_array ar_Null s2 1 let s1 := sv_Construct "New value for %z %z, with current effective value %.2f%rEmpty means value is inherited by parent.%r", menu_name, sub_menu_name, eeTempF if price_selector == 0 let s1 += "|Reset" endif let s1 += "|OK|Cancel" OpenTextInput $s1 0 6 if price_selector < 2 if (Floor eeTempF) == eeTempF InsertInInputText "%.0f" eeTempF else let eeTemp := eeTempF * 10 if (Floor eeTemp) == eeTempF*10 InsertInInputText "%.1f" eeTempF else InsertInInputText "%.2f" eeTempF endif endif endif let menu := 50 elseif menu == 50 if button == -1 UpdateTextInput else if button == 0 && price_selector == 0 let s1 := "-" + s2 ar_Erase menu_array $s1 elseif button == 0 || (button == 1 && price_selector == 0) set s1 to GetInputText if sv_Length s1 == 0 let s1 := "-" + s2 ar_Erase menu_array $s1 else let eeTempF := sv_ToNumeric s1 let s2 := "-" + s2 let menu_array[$s2] := eeTempF endif endif CloseTextInput let menu := -40 endif elseif menu == -60 let item_list := ar_Construct Array let i := 0 SetString -2010 "Enhanced Economy\*.txt" FindFirstFile -2011 -2010 1 While (StringLen -2011) > 0 Set s1 to ToOBSE -2011 let item_list[i] := s1 let i += 1 FindNextFile -2011 Loop if i == 0 MessageBox "No price files are found in 'Data\Enhanced Economy\!" let menu := 0 return endif Call EElocalEconomyResetPrices let menu_index := 0 let menu_index_top := i let menu := -61 elseif menu == -61 let s1 := "Choose Price file" let i := menu_index While i < menu_index + 7 && i < menu_index_top let s2 := item_list[i] let s2 := s2[0:-5] let s1 += "|" + s2 let i += 1 Loop let priceDataIndex := i - menu_index if menu_index > 0 let s1 += "|< Previous" endif if menu_index + 7 < menu_index_top let s1 += "|> Next" endif let s1 += "|Close" MessageBoxEx $s1 let menu := 61 elseif menu == 61 if button == -1 return elseif button < priceDataIndex let i := menu_index + button let sub_menu_name := item_list[i] let menu := -62 elseif button == priceDataIndex && menu_index > 0 let menu_index -= 7 if menu_index < 0 let menu_index := 0 endif let menu := -61 elseif (button == priceDataIndex || (button == 8 && menu_index > 0)) && menu_index + 7 < menu_index_top let menu_index += 7 if menu_index + 7 > menu_index_top let menu_index := menu_index_top - 7 endif let menu := -61 else let menu := -100 ; cleanup endif elseif menu == -62 let eeTemp := Call EEreadPrices sub_menu_name if eeTemp == -2 MessageBox "Unable to read the file!" let menu := 63 elseif eeTemp == -1 MessageBox "Invalid price file!" let menu := 63 else let s2 := sv_Construct "%0.f items will change prices. Continue?|OK|Cancel", eeTemp let s1 := s1 + "%r" + s2 MessageBoxEx $s1 let menu := 62 endif elseif menu == 62 if button == -1 return elseif button == 0 let i := 0 While i < eeTemp let item := repriced_refs[i] let price := repriced_vals[i] let eeTempF := GetGoldValue item SetGoldValue price item DebugPrint "EE:Change val of %n (%i) from %.0f to %.0f", item, item, eeTempF, price let i += 1 Loop MessageBox "Changed price of %.0f items!", eeTemp let button := -1 let menu := 63 else let menu := -61 endif elseif menu == 63 if button == 0 let menu := -61 endif elseif menu == -100 sv_Destruct menu_name sv_Destruct sub_menu_name sv_Destruct s1 sv_Destruct s2 let menu_array := ar_Null let menu_array_names := ar_Null let item_list := ar_Null let menu := 0 let repriced_refs := ar_Null let repriced_vals := ar_Null endifEnd
From line numbers the CSE errors seem to be in this bit of code:
elseif menu == -60 let item_list := ar_Construct Array let i := 0 SetString -2010 "Enhanced Economy\*.txt" FindFirstFile -2011 -2010 1 While (StringLen -2011) > 0 Set s1 to ToOBSE -2011 let item_list[i] := s1 let i += 1 FindNextFile -2011 Loop if i == 0 MessageBox "No price files are found in 'Data\Enhanced Economy\!" let menu := 0 return endif Call EElocalEconomyResetPrices let menu_index := 0 let menu_index_top := i let menu := -61[CSE] Script 'EElootTarget' {01018630}:
[CS] Script 'EElootTarget', line 305: Script command "SetString" not found.
[CS] Script 'EElootTarget', line 306: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 307: Script command "FMTSTring" not found.
[CS] Script 'EElootTarget', line 308: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 309: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 310: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 311: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 320: Script command "FMTString" not found.
[CS] Script 'EElootTarget', line 321: Script command "DelTxtFile" not found.
[CS] Script 'EElootTarget', line 322: Script command "RenTxtFile" not found.
[CS] Script 'EElootTarget', line 323: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 324: Script command "FMTSTring" not found.
[CS] Script 'EElootTarget', line 325: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 326: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 327: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 328: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 330: Script command "FMTString" not found.
[CS] Script 'EElootTarget', line 331: Script command "StringToTxtFile" not found.
[CS] Script 'EElootTarget', line 314: Syntax Error. Unknown command 'GetFileSize'.
[CS] Script 'EElootTarget', line 314: Invalid condition expression.
Script EElootTarget
ScriptName EElootTargetref lootTargetref lootItemlong removedGoldlong currentGoldlong itemCountlong itemTypeshort lastTargetIndexarray_var lastTargetshort hasRemovedItemshort addedBackRemovedItemsarray_var loot_dataarray_var item_varshort itemRemovalshort tempshort removeItemsshort questContainershort broken_typeshort illegalDeadNPCBegin Function {lootTarget}	let loot_data := ar_Construct Array	let loot_data[0] := 0	SetFunctionValue loot_data	SetDebugMode tnoEE.debug		let hasRemovedItem := 0	let addedBackRemovedItems := 0	let removeItems := 0	let removedGold := 0	let questContainer := 0	if IsActor		let currentGold := GetItemCount Gold001		if GetDead			if isOwner				DebugPrint "EE:Don't remove from owned creature"			else				let removedGold := currentGold - (currentGold * tnoEE.deadActorAdjustment / 100)				if removedGold != 0					DebugPrint "EE:Remove %.0f gold from dead %n", removedGold, lootTarget				endif				let removeItems := tnoEE.removeFromDeadActors								if tnoEE.illegalLootingEnabled >= 2					if isCreature == 0						let illegalDeadNPC := 1					endif				endif			endif		; Not dead actor		elseif isCreature == 0 && player.isSneaking			let removedGold := currentGold - (currentGold * tnoEE.npcAdjustment / 100)			if removedGold != 0				DebugPrint "EE:Remove %.0f gold from NPC %n", removedGold, lootTarget			endif		else			; Merchant or other alive actor			return		endif	; Not actor	elseif IsContainer			if isOwner || player.IsInMyOwnedCell			DebugPrint "EE:Don't remove from owned container"		elseif GetContainerRespawns == 0			DebugPrint "EE:%n is non-respawnable", lootTarget			let removeItems := tnoEE.removeFromContainers && tnoEE.removeFromNonSpawnable		else			; OK remove gold			let currentGold := GetItemCount Gold001			if currentGold && tnoEE.containerAdjustment != 100				let removedGold := currentGold - (currentGold * tnoEE.containerAdjustment / 100)				if removedGold != 0					DebugPrint "EE:Remove %.0f gold from %n", removedGold, lootTarget				endif			endif			let removeItems :=  tnoEE.removeFromContainers		endif		if tnoEEQ.active_questId > 0			if player.isInInterior				; May find quest item here				let questContainer := 1			endif		endif	else		; Not actor or container - nothing to loot		return	endif	if removedGold != 0		if removedGold > 0			removeItemNS Gold001 removedGold		else			let temp := 0 - removedGold			addItemNS Gold001 temp		endif		let hasRemovedItem := 2		let loot_data[0] := 1		let loot_data[1] := ar_Null		let loot_data[2] := removedGold		let loot_data[3] := hasRemovedItem		let loot_data[4] := 0	endif		Call EElocalEconomy This 0	;If target has a eeCheckedToken, there is nothing to do - but check if a quest item can be there, or if it is illegal to loot first.	if GetItemCount eeCheckedToken		DebugPrint "EE:%n has already been ransacked" lootTarget		if questContainer			Call EEquestContainer lootTarget		endif		if illegalDeadNPC			Call EEdeadNpcOwnership lootTarget 0		endif		return	endif	;Some targets are not to be ransacked at all	if Call EEisImmune lootTarget		return	endif	if removeItems		; Check if target is stored in the tnoEE.removedItems array:		let lastTarget := ar_Null		let lastTargetIndex := ar_Size tnoEE.removedItems		While eval (!lastTarget) && lastTargetIndex > 0			let lastTargetIndex -= 1			let lastTarget := tnoEE.removedItems[lastTargetIndex]			if eval (lastTarget[0] == lootTarget)				DebugPrint "EE:found previous target %n at pos %0.f", lootTarget, lastTargetIndex			else				let lootItem := lastTarget[0] 				let lastTarget := ar_Null			endif		Loop			if tnoEE.immuneKey && IsKeyPressed3 tnoEE.immuneKey			DebugPrint "EE:don't remove anything with immuneKey held down."			if eval lastTarget				let temp := 1 ; 1 means not yet found				ForEach item_var <- lastTarget					if temp						let temp := 0 ; skip first entrance, since that is the actor					else						let lootItem := item_var["value"]						if (IsPlayable lootItem) == 0							DebugPrint "EE:Adding back %n", lootItem							addItemNs lootItem 1							let addedBackRemovedItems := 1							let hasRemovedItem := 1						else							DebugPrint "EE:%n is already visible", lootItem						endif					endif				loop				let item_var := ar_Null			endif		elseif eval lastTarget && GetItemCount eeRemovalToken			DebugPrint "EE:has already removed equipment from %n", lootTarget			; Hide "removed" items			let temp := 1 			ForEach item_var <- lastTarget				if temp					let temp := 0 ; skip first entrance, since that is the actor				else					let lootItem := item_var["value"]					if (IsPlayable lootItem)						DebugPrint "EE:Hiding %n", lootItem						let hasRemovedItem := 1						SetIsPlayable 0 lootItem					else						DebugPrint "EE:%n is already removed", lootItem					endif				endif			loop			let item_var := ar_Null		else			; Actor without eeRemovalToken or not found in tnoEE.removedItems. Apply new removal			if eval lastTarget 				DebugPrint "EE:Actor ID found, but no token. Zero index %0.f", lastTargetIndex				let lastTarget := ar_Null				let tnoEE.removedItems[lastTargetIndex][0] := 0			endif			let itemCount := GetNumItems			While itemCount > 0				let itemCount := itemCount - 1				let lootItem := GetInventoryObject itemCount								; Check that the item is playable, not scripted and not a quest item				if IsPlayable2 lootItem == 0					Continue				elseif IsScripted lootItem					Continue				elseif IsQuestItem lootItem					Continue				else					let itemType := GetObjectType lootItem					if itemType != 26							; Not light						if GetFullGoldValue lootItem == 0							if tnoEE.removeWorthlessItems == 0								Continue							endif						endif					endif				endif								let broken_type := 1				; weapons				if itemType == 33					if (tnoEE.removeUnEnchanted || GetEnchantment lootItem)						let itemType := GetWeaponType lootItem						if itemType == 4							let itemRemoval := (tnoEE.staffAdjustment <= GetRandomPercent)						else							let itemRemoval := (tnoEE.weaponAdjustment <= GetRandomPercent)						endif					endif				; Armor				elseif itemType == 20					if (tnoEE.removeUnEnchanted || GetEnchantment lootItem)						let itemRemoval := (tnoEE.armorAdjustment <= GetRandomPercent)					endif				; Clothing				elseif itemType == 22					if (tnoEE.removeUnEnchanted || GetEnchantment lootItem)						if (CompareName "ring" lootItem) || (CompareMaleIconPath "ring" lootItem)							if lootItem == MG02RingofBurden								DebugPrint "EE:Did not attempt := remove %n",lootItem							else								let itemRemoval := (tnoEE.ringAdjustment <= GetRandomPercent)							endif						elseif (CompareName "amulet" lootItem) || (CompareName "necklace" lootItem) || (CompareMaleIconPath "amulet" lootItem)							let itemRemoval := (tnoEE.amuletAdjustment <= GetRandomPercent)						else							let itemRemoval := (tnoEE.clothingAdjustment <= GetRandomPercent)						endif					endif				; Soulgems				elseif itemType == 38					if (CompareName "black" lootItem) == 0						let itemRemoval := (tnoEE.soulgemAdjustment <= GetRandomPercent)					endif				; Potions				elseif itemType == 40					let itemRemoval := (tnoEE.potionAdjustment <= GetRandomPercent)					let broken_type := 2				; Books				elseif itemType == 21					if GetBookIsScroll lootItem						if GetEnchantment lootItem							let itemRemoval := (tnoEE.scrollAdjustment <= GetRandomPercent)						endif						let broken_type := 2					endif				; Ingredients				elseif itemType == 25					if IsFood lootItem						let itemRemoval := (tnoEE.foodAdjustment <= GetRandomPercent)					else						let itemRemoval := (tnoEE.ingredientAdjustment <= GetRandomPercent)					endif					let broken_type := 2				; Misc				elseif itemType == 27					if lootItem != Lockpick && lootItem != RepairHammer && lootItem != Gold001						let itemRemoval := (tnoEE.miscItemsAdjustment <= GetRandomPercent)					endif					let broken_type := 2				; Light				elseif itemType == 26					let itemRemoval := (tnoEE.lightAdjustment <= GetRandomPercent)					let broken_type := 2				endif				if itemRemoval					PrintC "EE:delete %n (%i) of type %.0f from %n", lootItem, lootItem, itemType, lootTarget					if (IsPlayable lootItem)						SetIsPlayable 0 lootItem					else						RemoveItemNS lootItem 1					endif					if tnoEE.useBrokenItem >= broken_type						AddItemNS EEbrokenItem 1					endif					; Check if actor already is stored in tnoEE.removedItems array. If not, add him					if lastTarget == 0						let temp := ar_Size tnoEE.removedItems						if temp >= tnoEE.removedMaxSize							if tnoEE.removedIndex >= tnoEE.removedMaxSize								DebugPrint "EE:overwriting first processed actor"								let tnoEE.removedIndex := 0							endif						endif						let tnoEE.removedItems[tnoEE.removedIndex] := ar_Construct Array						let lastTarget := tnoEE.removedItems[tnoEE.removedIndex]						let lastTarget[0] := lootTarget						let tnoEE.removedIndex += 1					endif					let temp := ar_Size lastTarget 					let lastTarget[temp] := lootItem					let hasRemovedItem := 1					if tnoEE.logEnabled && tnoEE.logInitiated						if tnoEE.loggedLoadTime == 0							SetString -2047 "EnhancedEconomyLog.txt" 0							StringToTxtFile -2047 -1310 0							FMTSTring -2048 0 "EE Log time started "							StringToTxtFile -2047 -2048 0							StringToTxtFile -2047 -9000 0							StringToTxtFile -2047 -32 0							StringToTxtFile -2047 -9001							let tnoEE.loggedLoadTime := 1						endIf						if (GetFileSize -2047 0) >= tnoEE.logMaxSize							; Log file is full. Now rename the old and start a new							let tnoEE.logFileIndex += 1							if tnoEE.logFileIndex >= tnoEE.logMaxFiles								let tnoEE.logFileIndex := 1							endif							FMTString -2048 0 "EnhancedEconomyLog%0.f.txt" tnoEE.logFileIndex							DelTxtFile -2048							RenTxtFile -2047 -2048							StringToTxtFile -2047 -1310 0							FMTSTring -2048 0 "EE started new log file "							StringToTxtFile -2047 -2048 0							StringToTxtFile -2047 -9000 0							StringToTxtFile -2047 -32 0							StringToTxtFile -2047 -9001						endif						FMTString -2048 0 "Remove %n (%i) from %n" lootItem lootItem lootTarget						StringToTxtFile -2047 -2048					endif									endif			Loop			if hasRemovedItem == 1				AddItemNS eeRemovalToken 1				DebugPrint "EE:Adding removal token"			else				AddItemNS eeCheckedToken 1				DebugPrint "EE:Adding checked token"			endif		endif	else		AddItemNS eeCheckedToken 1		DebugPrint "EE:Adding checked token"	endif		if questContainer		Call EEquestContainer lootTarget	endif	if illegalDeadNPC		Call EEdeadNpcOwnership lootTarget 0	endif		if removeItems		let loot_data[0] := 1		let loot_data[1] := lastTarget		let loot_data[2] := removedGold		let loot_data[3] := hasRemovedItem		let loot_data[4] := addedBackRemovedItems	endifEndProblems seem to be in this bit:
if tnoEE.logEnabled && tnoEE.logInitiated if tnoEE.loggedLoadTime == 0 SetString -2047 "EnhancedEconomyLog.txt" 0 StringToTxtFile -2047 -1310 0 FMTSTring -2048 0 "EE Log time started " StringToTxtFile -2047 -2048 0 StringToTxtFile -2047 -9000 0 StringToTxtFile -2047 -32 0 StringToTxtFile -2047 -9001 let tnoEE.loggedLoadTime := 1 endIf if (GetFileSize -2047 0) >= tnoEE.logMaxSize ; Log file is full. Now rename the old and start a new let tnoEE.logFileIndex += 1 if tnoEE.logFileIndex >= tnoEE.logMaxFiles let tnoEE.logFileIndex := 1 endif FMTString -2048 0 "EnhancedEconomyLog%0.f.txt" tnoEE.logFileIndex DelTxtFile -2048 RenTxtFile -2047 -2048 StringToTxtFile -2047 -1310 0 FMTSTring -2048 0 "EE started new log file " StringToTxtFile -2047 -2048 0 StringToTxtFile -2047 -9000 0 StringToTxtFile -2047 -32 0 StringToTxtFile -2047 -9001 endif FMTString -2048 0 "Remove %n (%i) from %n" lootItem lootItem lootTarget StringToTxtFile -2047 -2048 endif[CSE] Script 'EEreadPrices' {010526AC}:
[CS] Script 'EEreadPrices', line 22: Script command "SetString" not found.
[CS] Script 'EEreadPrices', line 31: Script command "FileToString" not found.
[CS] Script 'EEreadPrices', line 43: Script command "SetString" not found.
[CS] Script 'EEreadPrices', line 46: Script command "CopyString" not found.
[CS] Script 'EEreadPrices', line 56: Script command "CopyString" not found.
[CS] Script 'EEreadPrices', line 24: Syntax Error. Unknown command 'UserFileExists'.
[CS] Script 'EEreadPrices', line 24: Invalid condition expression.
[CS] Script 'EEreadPrices', line 25: Syntax Error. Unknown command 'ToOBSE'.
[CS] Script 'EEreadPrices', line 25: Syntax Error. Missing expression in set command.
[CS] Script 'EEreadPrices', line 32: Syntax Error. Unknown command 'StringLen'.
[CS] Script 'EEreadPrices', line 32: Syntax Error. Missing expression in set command.
[CS] Script 'EEreadPrices', line 44: Syntax Error. Unknown command 'StringPos'.
[CS] Script 'EEreadPrices', line 44: Syntax Error. Missing expression in set command.
[CS] Script 'EEreadPrices', line 48: Syntax Error. Unknown command 'ToOBSE'.
[CS] Script 'EEreadPrices', line 48: Syntax Error. Missing expression in set command.
[CS] Script 'EEreadPrices', line 59: Syntax Error. Unknown command 'StringLen'.
[CS] Script 'EEreadPrices', line 59: Syntax Error. Missing expression in set command.
[CS] Script 'EEreadPrices', line 62: Syntax Error. Unknown command 'ToOBSE'.
[CS] Script 'EEreadPrices', line 62: Syntax Error. Missing expression in set command.
Script EEreadPrices
ScriptName EEreadPricesstring_var s1string_var s2string_var modarray_var itemsarray_var item_rowarray_var item_datashort ishort jshort found_modshort str_lenshort str_indexshort repriced_countfloat old_valfloat new_valref itemBegin Function {s1}	SetDebugMode tnoEE.debug		let s1 := "Enhanced Economy\" + s1	DebugPrint "EE:Filename is %z", s1	SetString -2010 $s1		if (UserFileExists -2010 1) == 0 		Set s1 to ToOBSE -2010		DebugPrint "EE:File not found error: %z", s1		SetFunctionValue -2		return	endif		FileToString -2010 -2011 0 1	Set str_len to StringLen -2011	if str_len <= 1		DebugPrint "EE:File too short error: %z", s1		SetFunctionValue -1		return	endif		let tnoEELE.repriced_refs := ar_Construct Array	let tnoEELE.repriced_vals := ar_Construct Array		; Look for description	SetString -2012 "["	Set i to (StringPos -2012 -2011) - 1	if i > 0		CopyString -2010 -2011 1 i		sv_Destruct tnoEELE.s1		Set tnoEELE.s1 to ToOBSE -2010		let str_index := i + 1	else		let str_index := 1	endif	let found_mod := 0	let repriced_count := 0	While str_index <= str_len		CopyString -2010 -2011 str_index 10000		let str_index += 10000				Set i to StringLen -2010;		DebugPrint "EE:New section length %.0f", i				Set s1 to ToOBSE -2010		let items := sv_Split s1 "%r"		let i := ar_Size items		if (i <= 0) && (str_index <= str_len)			let j := sv_Length s1			DebugPrint "EE:Error in file, size: %.0f, items %.0f, str_index %.0f, str_len %.0f", j, i, str_index, str_len			let repriced_count := -1			Break		endif				; Put last element "back" if it is not a complete line		if str_index < str_len			let s2 := s1[-1]			if eval s2 != "%r"				let i := (ar_Size items) -1				if i <= 0					DebugPrint "EE:Error in file at split, items %.0f, str_index %.0f, str_len %.0f", i, str_index, str_len					let repriced_count := -1					Break				endif				let s1 := items[i]				ar_Erase items i				let i := (sv_Length s1) + 1				let str_index -= i;				DebugPrint "EE:Put back %0.f: %z, str_index %.0f, str_len %.0f", i, s1, str_index, str_len			endif		endif					ForEach item_row <- items			let s1 := item_row["Value"]			let i := (sv_Find "[" s1) + 1			if i > 0				let j := (sv_Find "]" s1) - 1				if j > 0 && j > i					let mod := s1[i:j]				elseif j < 0					let mod := s1[i:-2]				else					DebugPrint "EE:Warning: %z was not parsed", s1					Continue				endif				if IsModLoaded $mod					DebugPrint "EE:Found new mod section: %z", mod					let found_mod := 1				else					DebugPrint "EE:Unknown mod section: %z from line %z", mod, s1					let mod := ""					let found_mod := 0				endif			elseif found_mod							let item_data := sv_Split s1 ", "				let s2 := item_data[0]				let i := sv_Length s2				if i >= 6					if i > 6						let i -= 6						sv_Erase s2 0, i					endif					let item := GetFormFromMod $mod $s2					if IsFormValid item						let old_val := GetGoldValue item						let s2 := item_data[1]						let new_val := sv_ToNumeric s2						if old_val != new_val							let tnoEELE.repriced_refs[repriced_count] := item							let tnoEELE.repriced_vals[repriced_count] := new_val							let repriced_count += 1						endif					else						DebugPrint "EE:Line %z did not contain valid formId (%z) for %z", s1, s2, mod					endif				else					DebugPrint "EE:Line %z has incorrect formId (%z)", s1, s2				endif			endif		Loop	Loop		sv_Destruct s1	sv_Destruct s2	sv_Destruct mod	let items := ar_Null	let item_row := ar_Null	let item_data := ar_Null	SetFunctionValue repriced_countEndAgain, the bit of code where I think the problems are:
SetDebugMode tnoEE.debug let s1 := "Enhanced Economy\" + s1 DebugPrint "EE:Filename is %z", s1 SetString -2010 $s1 if (UserFileExists -2010 1) == 0 Set s1 to ToOBSE -2010 DebugPrint "EE:File not found error: %z", s1 SetFunctionValue -2 return endif FileToString -2010 -2011 0 1 Set str_len to StringLen -2011 if str_len <= 1 DebugPrint "EE:File too short error: %z", s1 SetFunctionValue -1 return endif let tnoEELE.repriced_refs := ar_Construct Array let tnoEELE.repriced_vals := ar_Construct Array ; Look for description SetString -2012 "[" Set i to (StringPos -2012 -2011) - 1 if i > 0 CopyString -2010 -2011 1 i sv_Destruct tnoEELE.s1 Set tnoEELE.s1 to ToOBSE -2010 let str_index := i + 1 else let str_index := 1 endifSo. Apologies for the WoT.
I guess my primary question is:
Does anyone know what the problematic object in the EEresetBarterGold script is? That seems to be the most serious error as the whole script is being stopped when the game's running.
Secondarily, are the errors flagged by CSE serious ones? As I say, to my untutored eye, they look to be inside some debugging code blocks. I'm not 100% sure though...

 » Mon Aug 31, 2015 3:55 pm
  » Mon Aug 31, 2015 3:55 pm 



