Jump to content

Fill a formlist with all spells a player knows? shouts?


irswat

Recommended Posts

I made this clean save without any mods except DLC enabled. It's really a clean save.

I haven't done the test you propose, but I think it would be interesting to see the results. I just made a post on the SKSE thread. Maybe the functions are bugged?

Link to comment
Share on other sites

figured out something interesting. The script does work quite wonderfully in fact. I purchased some spells books, frostbite, clairvoyance, fury, etc. I read the books, and then when I hit the refresh/debug key it listed the new spells that I just learned in addition to the weird ones mentioned earlier. Like you said it would be interesting to start a new game and see what happens. It's possible this mod will simply require a new game to work properly.

Link to comment
Share on other sites

I think this is how I can go about sorting items from the players inventory into formlists?

 

	int nItemsPlayerHas=PlayerRef.GetNumItems()
	
	form curForm
	int fType
	LoopCounter=0
		
	while (LoopCounter<nItemsPlayerHas)
		curForm=PlayerRef.GetNthForm(LoopCounter)
		fType=curForm.GetType()
		if fType==41	;this is a weapon
			if WeaponFormList.HasForm(curForm)==false
				WeaponFormList.AddForm(curForm)
				debug.trace("Weapon added to formlist: " + curForm.GetName())
				debug.notification("Weapon added to formlist: " + curForm.GetName())
			endif
		elseif fType==64 || fType==42 || fType==50
			if AmmoFormList.HasForm(curForm)==false
				AmmoFormList.AddForm(curForm)
				debug.trace("Arrow/ammo added to formlist: " + curForm.GetName())
				debug.notification("Arrow added to formlist: " + curForm.GetName())
			endif
		elseif fType==26
			if ArmorFormList.HasForm(curForm)==false
				ArmorFormList.AddForm(curForm)
				debug.trace("Armor added to formlist: " + curForm.GetName())
				debug.notification("Armor added to formlist: " + curForm.GetName())
			endif
		elseif fType==46
			if PotionFormList.HasForm(curForm)==false
				PotionFormList.AddForm(curForm)
				debug.trace("Potion added to formlist: " + curForm.GetName())
				debug.notification("Potion added to formlist: " + curForm.GetName())
			endif
		endif
	endWhile

 

 

Edited by irswat
Link to comment
Share on other sites

You are super helpful as always Ishara! Thank you! If this method actually works, it will means there is no need for those tes5edit scripts, which is a good thing, but I feel bad that you wrote those scripts that might not be put to use. I'm thankful to God for the inspiration to do it this way because if this works, it's better in every way!

Link to comment
Share on other sites

Eureka! New code cuts the response time of the script in half! Now reaction time will be dependent on number of item type in players inventory. Before it was dependent on the number of items in the game.

Still a couple minor bug, but my God I'm making progress here!

 

 

[11/19/2016 - 12:34:19PM] Spells player knows: 8

[11/19/2016 - 12:34:19PM] Spell 0 added: Shrouded Armor Full Set
[11/19/2016 - 12:34:19PM] Spell 1 added: Nightingale Armor Full Set
[11/19/2016 - 12:34:19PM] Spell 2 added: The Warrior Stone
[11/19/2016 - 12:34:19PM] Spell 3 added: Oakflesh
[11/19/2016 - 12:34:20PM] Spell 4 added: Sparks
[11/19/2016 - 12:34:20PM] Spell 5 added: Ahzidal's Genius
[11/19/2016 - 12:34:20PM] Spell 6 added: Deathbrand Instinct
[11/19/2016 - 12:34:20PM] Spell 7 added: Crossbow bonus
[11/19/2016 - 12:34:20PM] Player has 16 items in inventory.
[11/19/2016 - 12:34:20PM] Item 0 : Lockpick
[11/19/2016 - 12:34:20PM] Item 1 : Long Bow
[11/19/2016 - 12:34:20PM] Item 2 : Iron Arrow
[11/19/2016 - 12:34:21PM] Item 3 : gold
[11/19/2016 - 12:34:21PM] Item 4 : Potion of Minor Healing
[11/19/2016 - 12:34:21PM] Item 5 : Potion of Minor Magicka
[11/19/2016 - 12:34:21PM] Item 6 : Potion of Minor Stamina
[11/19/2016 - 12:34:21PM] Item 7 : Leather
[11/19/2016 - 12:34:21PM] Item 8 : Leather Strips
[11/19/2016 - 12:34:21PM] Item 9 : Key to Gerdur's House
[11/19/2016 - 12:34:21PM] Item 10 : Frostbite Venom
[11/19/2016 - 12:34:22PM] Item 11 : Imperial Bracers
[11/19/2016 - 12:34:22PM] Item 12 : Imperial Boots
[11/19/2016 - 12:34:22PM] Item 13 : Imperial Officer's Helmet
[11/19/2016 - 12:34:22PM] Item 14 : Imperial Armor
[11/19/2016 - 12:34:22PM] Item 15 : Imperial Sword
[11/19/2016 - 12:34:22PM] dumping from data/SVE_PI.txt to SVE_PO
[11/19/2016 - 12:34:22PM] File found: reading file.
[11/19/2016 - 12:34:22PM] Word 0: Equip
[11/19/2016 - 12:34:22PM] Word 1: Staff
[11/19/2016 - 12:34:22PM] Word 2: of
[11/19/2016 - 12:34:22PM] Word 3: Magnus
[11/19/2016 - 12:34:22PM] Word 4: QUICK
[11/19/2016 - 12:34:22PM] Line 1 complete
[11/19/2016 - 12:34:22PM] Word 5: Equip
[11/19/2016 - 12:34:22PM] Word 6: Nightingale
[11/19/2016 - 12:34:22PM] Word 7: Bow
[11/19/2016 - 12:34:22PM] Word 8: QUICK
[11/19/2016 - 12:34:22PM] Line 2 complete
[11/19/2016 - 12:34:22PM] Word 9: Equip
[11/19/2016 - 12:34:22PM] Word 10: Blade
[11/19/2016 - 12:34:22PM] Word 11: of
[11/19/2016 - 12:34:22PM] Word 12: Woe
[11/19/2016 - 12:34:22PM] Word 13: QUICK
[11/19/2016 - 12:34:22PM] Line 3 complete
[11/19/2016 - 12:34:22PM] Word 14: Equip
[11/19/2016 - 12:34:22PM] Word 15: IMPERIAL
[11/19/2016 - 12:34:22PM] Word 16: Sword
[11/19/2016 - 12:34:22PM] Word 17: Both
[11/19/2016 - 12:34:22PM] Word 18: QUICK
[11/19/2016 - 12:34:22PM] Line 4 complete
[11/19/2016 - 12:34:22PM] SVE DUMP COMPLETE.
[11/19/2016 - 12:34:22PM] Loop 1 of 4
[11/19/2016 - 12:34:22PM] FindCommandCounter Reset? 0
[11/19/2016 - 12:34:22PM] Searching for command Thuum beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Equip beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: 0
[11/19/2016 - 12:34:22PM] Command found: Equip in index 0
[11/19/2016 - 12:34:22PM] Equip CMD detected
[11/19/2016 - 12:34:22PM] Weapon type detected in index 1
[11/19/2016 - 12:34:22PM] Unique weapon modifier detected in index 2
[11/19/2016 - 12:34:22PM] Unique weapon modifier detected in index 3
[11/19/2016 - 12:34:22PM] Form: 0
[11/19/2016 - 12:34:22PM] CurrentItemName: Long Bow ; LengthOfItemName: 2
[11/19/2016 - 12:34:22PM] Filling weapon string from current item name
[11/19/2016 - 12:34:22PM] Current word from form name: Long
[11/19/2016 - 12:34:22PM] Form: 1
[11/19/2016 - 12:34:22PM] CurrentItemName: Imperial Sword ; LengthOfItemName: 2
[11/19/2016 - 12:34:22PM] Filling weapon string from current item name
[11/19/2016 - 12:34:22PM] Current word from form name: IMPERIAL
[11/19/2016 - 12:34:22PM] Invalid command. Command content not found in inventory.
[11/19/2016 - 12:34:22PM] Array reset.
[11/19/2016 - 12:34:22PM] Array reset.
[11/19/2016 - 12:34:22PM] Searching for command Unequip beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Use beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Cast beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Map beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Save beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Exit beginning in SVE_Dump at index 0
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Reinitializing variables
[11/19/2016 - 12:34:22PM] Loop 2 of 4
[11/19/2016 - 12:34:22PM] FindCommandCounter Reset? 0
[11/19/2016 - 12:34:22PM] Searching for command Thuum beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Equip beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: 5
[11/19/2016 - 12:34:22PM] Command found: Equip in index 5
[11/19/2016 - 12:34:22PM] Equip CMD detected
[11/19/2016 - 12:34:22PM] Unique weapon modifier detected in index 1
[11/19/2016 - 12:34:22PM] Weapon type detected in index 2
[11/19/2016 - 12:34:22PM] Form: 0
[11/19/2016 - 12:34:22PM] CurrentItemName: Long Bow ; LengthOfItemName: 2
[11/19/2016 - 12:34:22PM] Filling weapon string from current item name
[11/19/2016 - 12:34:22PM] Current word from form name: Long
[11/19/2016 - 12:34:22PM] Form: 1
[11/19/2016 - 12:34:22PM] CurrentItemName: Imperial Sword ; LengthOfItemName: 2
[11/19/2016 - 12:34:22PM] Filling weapon string from current item name
[11/19/2016 - 12:34:22PM] Current word from form name: IMPERIAL
[11/19/2016 - 12:34:22PM] Invalid command. Command content not found in inventory.
[11/19/2016 - 12:34:22PM] Array reset.
[11/19/2016 - 12:34:22PM] Array reset.
[11/19/2016 - 12:34:22PM] Searching for command Unequip beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Use beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Cast beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Map beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Save beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Exit beginning in SVE_Dump at index 4
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Reinitializing variables
[11/19/2016 - 12:34:22PM] Loop 3 of 4
[11/19/2016 - 12:34:22PM] FindCommandCounter Reset? 0
[11/19/2016 - 12:34:22PM] Searching for command Thuum beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:22PM] iCMDFound: -1
[11/19/2016 - 12:34:22PM] Searching for command Equip beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:22PM] iCMDFound: 9
[11/19/2016 - 12:34:22PM] Command found: Equip in index 9
[11/19/2016 - 12:34:22PM] Equip CMD detected
[11/19/2016 - 12:34:22PM] Weapon type detected in index 1
[11/19/2016 - 12:34:22PM] Unique weapon modifier detected in index 2
[11/19/2016 - 12:34:22PM] Unique weapon modifier detected in index 3
[11/19/2016 - 12:34:23PM] Form: 0
[11/19/2016 - 12:34:23PM] CurrentItemName: Long Bow ; LengthOfItemName: 2
[11/19/2016 - 12:34:23PM] Filling weapon string from current item name
[11/19/2016 - 12:34:23PM] Current word from form name: Long
[11/19/2016 - 12:34:23PM] Form: 1
[11/19/2016 - 12:34:23PM] CurrentItemName: Imperial Sword ; LengthOfItemName: 2
[11/19/2016 - 12:34:23PM] Filling weapon string from current item name
[11/19/2016 - 12:34:23PM] Current word from form name: IMPERIAL
[11/19/2016 - 12:34:23PM] Invalid command. Command content not found in inventory.
[11/19/2016 - 12:34:23PM] Array reset.
[11/19/2016 - 12:34:23PM] Array reset.
[11/19/2016 - 12:34:23PM] Searching for command Unequip beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Use beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Cast beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Map beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Save beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Exit beginning in SVE_Dump at index 8
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Reinitializing variables
[11/19/2016 - 12:34:23PM] Loop 4 of 4
[11/19/2016 - 12:34:23PM] FindCommandCounter Reset? 0
[11/19/2016 - 12:34:23PM] Searching for command Thuum beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Equip beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: 14
[11/19/2016 - 12:34:23PM] Command found: Equip in index 14
[11/19/2016 - 12:34:23PM] Equip CMD detected
[11/19/2016 - 12:34:23PM] Material type detected in index 1
[11/19/2016 - 12:34:23PM] Weapon type detected in index 2
[11/19/2016 - 12:34:23PM] Equip slot 3
[11/19/2016 - 12:34:23PM] Form: 0
[11/19/2016 - 12:34:23PM] CurrentItemName: Long Bow ; LengthOfItemName: 2
[11/19/2016 - 12:34:23PM] Filling weapon string from current item name
[11/19/2016 - 12:34:23PM] Current word from form name: Long
[11/19/2016 - 12:34:23PM] Form: 1
[11/19/2016 - 12:34:23PM] CurrentItemName: Imperial Sword ; LengthOfItemName: 2
[11/19/2016 - 12:34:23PM] Filling weapon string from current item name
[11/19/2016 - 12:34:23PM] Current word from form name: IMPERIAL
[11/19/2016 - 12:34:23PM] Current word from form name: Sword
[11/19/2016 - 12:34:23PM] CHECK WT: Sword; MT: IMPERIAL
[11/19/2016 - 12:34:23PM] Possible match found! WT: Sword; MT: IMPERIAL UWM:
[11/19/2016 - 12:34:23PM] Check for match. Current Word from form: IMPERIAL
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: 0
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: IMPERIAL
[11/19/2016 - 12:34:23PM] Match Found! Matching Words: 1
[11/19/2016 - 12:34:23PM] CurrentWordFromForm: IMPERIAL ;CurrentWordFromCMD: IMPERIAL
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: Sword
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: Both
[11/19/2016 - 12:34:23PM] Check for match. Current Word from form: Sword
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: 0
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: IMPERIAL
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: Sword
[11/19/2016 - 12:34:23PM] Match Found! Matching Words: 2
[11/19/2016 - 12:34:23PM] CurrentWordFromForm: Sword ;CurrentWordFromCMD: Sword
[11/19/2016 - 12:34:23PM] Check for match. Current Word from CMD: Both
[11/19/2016 - 12:34:23PM] Check for match. Current Word from form:
[11/19/2016 - 12:34:23PM] Array reset.
[11/19/2016 - 12:34:23PM] Matching words analysis: 2 matching words between current cmd 0 IMPERIAL Sword Both and Imperial Sword
[11/19/2016 - 12:34:23PM] The form name with the greatest match is: Imperial Sword
[11/19/2016 - 12:34:23PM] The form number is [WEAPON < (000135B8)>]
[11/19/2016 - 12:34:23PM] The form matches 0 words of the original command Equip 0 IMPERIAL Sword Both
[11/19/2016 - 12:34:23PM] The form match is 0.000000%
[11/19/2016 - 12:34:23PM] Array reset.
[11/19/2016 - 12:34:23PM] Array reset.
[11/19/2016 - 12:34:23PM] Searching for command Unequip beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Use beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Cast beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Map beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Save beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Searching for command Exit beginning in SVE_Dump at index 13
[11/19/2016 - 12:34:23PM] iCMDFound: -1
[11/19/2016 - 12:34:23PM] Reinitializing variables
[11/19/2016 - 12:34:23PM] Command parser test complete in 0.000229 seconds.

 



edit: Next steps: adding equipment functionality for bows; equipping spells, casting spells, using potions.

Edited by irswat
Link to comment
Share on other sites

One of my favorite things in the world to do

 

 

 

 

PotionPotencies=new string[20]

PotionPotencies[1]="Weak"
PotionPotencies[2]="Strong"
PotionPotencies[3]="Minor"
PotionPotencies[4]="Ultimate"
PotionPotencies[5]="Brief"
PotionPotencies[6]="Deadly"
PotionPotencies[7]="Enduring"
PotionPotencies[8]="Enhanced"
PotionPotencies[9]="Extended"
PotionPotencies[10]="Extra"
PotionPotencies[11]="Perfect"
PotionPotencies[12]="Grand"
PotionPotencies[13]="Lasting"
PotionPotencies[14]="Lingering"
PotionPotencies[15]="Long"
PotionPotencies[16]="Persisting"
PotionPotencies[17]="Potent"
PotionPotencies[18]="Potency"
PotionPotencies[19]="Unceasing"
PotionPotencies[20]="Virulent"
PotionAlchTypes=new string[20]
PotionAlchTypes[1]="Draught"
PotionAlchTypes[2]="Elixir"
PotionAlchTypes[3]="Elixer"
PotionAlchTypes[4]="Essence"
PotionAlchTypes[5]="Extract"
PotionAlchTypes[6]="Phial"
PotionAlchTypes[7]="Philter"
PotionAlchTypes[8]="Potion"
PotionAlchTypes[9]="Reserve"
PotionAlchTypes[10]="Solution"
PotionAlchTypes[11]="Perfect"
PotionAlchTypes[12]=""
PotionAlchTypes[13]=""
PotionAlchTypes[14]=""
PotionAlchTypes[15]=""
PotionAlchTypes[16]=""
PotionAlchTypes[17]=""
PotionAlchTypes[18]=""
PotionAlchTypes[19]=""
PotionAlchTypes[20]=""
PotionTypes=new string[20]
PotionTypes[1]="Weak"
PotionTypes[2]="Strong"
PotionTypes[3]="Minor"
PotionTypes[4]="Ultimate"
PotionTypes[5]="Brief"
PotionTypes[6]="Deadly"
PotionTypes[7]="Enduring"
PotionTypes[8]="Enhanced"
PotionTypes[9]="Extended"
PotionTypes[10]="Extra"
PotionTypes[11]="Perfect"
PotionTypes[12]="Grand"
PotionTypes[13]="Lasting"
PotionTypes[14]="Lingering"
PotionTypes[15]="Long"
PotionTypes[16]="Persisting"
PotionTypes[17]="Potent"
PotionTypes[18]="Potency"
PotionTypes[19]="Unceasing"
PotionTypes[20]="Virulent"
PotionEffects=new string[30]
PotionEffects[1]="Aversion"
PotionEffects[2]="Conflict"
PotionEffects[3]="Cure"
PotionEffects[4]="Healing"
PotionEffects[5]="Stamina"
PotionEffects[6]="Disease"
PotionEffects[7]="Fear"
PotionEffects[8]="Fire"
PotionEffects[9]="Frenzy"
PotionEffects[10]="Frost"
PotionEffects[11]="Frostbite"
PotionEffects[12]="Glibness"
PotionEffects[13]="Health"
PotionEffects[14]="Ice"
PotionEffects[15]="Invisibility"
PotionEffects[16]="Magic"
PotionEffects[17]="Magick"
PotionEffects[18]="Magicka"
PotionEffects[19]="Malign"
PotionEffects[20]="Paralysis"
PotionEffects[21]="Recovery"
PotionEffects[22]="Regeneration"
PotionEffects[23]="Resist"
PotionEffects[24]="Sap"
PotionEffects[25]="Shock"
PotionEffects[26]="Sleeping"
PotionEffects[27]="Torpor"
PotionEffects[28]="Berserker"
PotionEffects[29]="Vigor"
PotionEffects[30]="Waterbreathing"
PotionSkills=new string[20]
PotionSkills[1]="Blacksmith's"
PotionSkills[2]="Alteration"
PotionSkills[3]="Conjurer's"
PotionSkills[4]="Defender"
PotionSkills[5]="Escape"
PotionSkills[6]="Feet"
PotionSkills[7]="Haggling"
PotionSkills[8]="Healer"
PotionSkills[9]="Illusion"
PotionSkills[10]="Keenshot"
PotionSkills[11]="Knight"
PotionSkills[12]="Larceny"
PotionSkills[13]="Lockpicking"
PotionSkills[14]="Plunder"
PotionSkills[15]="Shot"
PotionSkills[16]="Skirmisher's"
PotionSkills[17]="Strength"
PotionSkills[18]="True"
PotionSkills[19]="Warrior"
PotionSkills[20]=""
Foods=new string[60]
Foods[0]="Tower"
Foods[1]="Ale"
Foods[2]="Alto"
Foods[3]="Apple"
Foods[4]="Argonian"
Foods[5]="Baked"
Foods[6]="Beef"
Foods[7]="Berry"
Foods[8]="Black-Briar"
Foods[9]="Blood"
Foods[10]="Blue"
Foods[11]="Boiled"
Foods[12]="Brandy"
Foods[13]="Bread"
Foods[14]="Breast"
Foods[15]="Cabbage"
Foods[16]="Carrot"
Foods[17]="Charred"
Foods[18]="Cheese"
Foods[19]="Chicken"
Foods[20]="Chop"
Foods[21]="Clam"
Foods[22]="Cooked"
Foods[23]="Cream"
Foods[24]="Dog"
Foods[25]="Double-Distilled"
Foods[26]="Carrot"
Foods[27]="Charred"
Foods[28]="Goat"
Foods[29]="Gourd"
Foods[30]="Green"
Foods[31]="Haunch"
Foods[32]="Homecooked"
Foods[33]="Honey"
Foods[34]="Honningbrew"
Foods[35]="Horker"
Foods[36]="Horse"
Foods[37]="Juniper"
Foods[38]="Leeks"
Foods[39]="Leg"
Foods[40]="Lotus"
Foods[41]="Mammoth"
Foods[42]="Mead"
Foods[43]="Meal"
Foods[44]="Meat"
Foods[45]="Nightshade"
Foods[46]="Nord"
Foods[47]="Nut"
Foods[48]="Pheasant"
Foods[49]="Pie"
Foods[50]="Potato"
Foods[31]="Potatoes"
Foods[32]="Raw"
Foods[33]="Red"
Foods[34]="Roll"
Foods[35]="Rum"
Foods[36]="Salmon"
Foods[37]="Skeever"
Foods[38]="Skooma"
Foods[39]="Sliced"
Foods[40]="Snout"
Foods[41]="Soup"
Foods[42]="Spiced"
Foods[43]="Stew"
Foods[44]="Taffy"
Foods[45]="Tomato"
Foods[46]="Treat"
Foods[47]="Tree"
Foods[48]="Vegetavle"
Foods[49]="Velvet"
Foods[50]="Venison"
Foods[51]="Wedge"
Foods[52]="Wheel"
Foods[53]="White"
Foods[54]="White-Gold"
Foods[55]="Tomato"
Foods[56]="Wine"
Foods[57]=""
Foods[58]=""
Foods[59]=""
Foods[60]=""
PotionMisc=new string[30]
PotionMisc[1]="Argonian"
PotionMisc[2]="Balmora"
PotionMisc[3]="Bane"
PotionMisc[4]="Breath"
PotionMisc[5]="Cliff"
PotionMisc[6]="Colovian"
PotionMisc[7]="Cyrodillic"
PotionMisc[8]="Dragon's"
PotionMisc[9]="Eidar"
PotionMisc[10]="Elsweyr"
PotionMisc[11]="Esbern's"
PotionMisc[12]="Falmer"
PotionMisc[13]="Finebrand"
PotionMisc[14]="Holy"
PotionMisc[15]="Jessica's"
PotionMisc[16]="Kordir's"
PotionMisc[17]="LeChance"
PotionMisc[18]="M'Kai"
PotionMisc[19]="Stallion's"
PotionMisc[20]="Stros"
PotionMisc[21]="the"
PotionMisc[22]="to"
PotionMisc[23]="of"
PotionMisc[24]="Unknown"
PotionMisc[25]="Vaermina's"
PotionMisc[26]="Wraith"
PotionMisc[27]=""
PotionMisc[28]=""
PotionMisc[29]=""
PotionMisc[30]=""

 



[/sarcasm]

Link to comment
Share on other sites

This script above should run faster if you rewrite it to avoid GetType and generally it's better to process anything related to inventory in reverse order. Try this and see how it compares. Without the tracing and notification it takes only 2-3 frames per item. The GetType call adds an extra frame per item and unless you're trying to distinguish between certain subtypes of MiscObject that don't have matching scripts it's not needed because the casts are faster.


	form curForm
	int LoopCounter=PlayerRef.GetNumItems()
	while (LoopCounter > 0)
                LoopCounter -= 1
		curForm=PlayerRef.GetNthForm(LoopCounter)
		if curForm as Weapon
			if !WeaponFormList.HasForm(curForm)
				WeaponFormList.AddForm(curForm)
			endif
		elseif curForm as Ammo
			if !AmmoFormList.HasForm(curForm)
				AmmoFormList.AddForm(curForm)
			endif
		elseif curForm as Armor
			if !ArmorFormList.HasForm(curForm)
				ArmorFormList.AddForm(curForm)
			endif
		elseif curForm as Potion
			if !PotionFormList.HasForm(curForm)
				PotionFormList.AddForm(curForm)
			endif
		endif
	endWhile
Link to comment
Share on other sites

  • Recently Browsing   0 members

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