HeirOfTheSeptims Posted May 19, 2018 Share Posted May 19, 2018 I'm trying to make a script that adds the player's armor to a form list, then equips the same armor to the actor that the script is on. I keep getting the errors: C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaaGearScript.psc(7,6): AddForm is not a function or does not existC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\aaaGearScript.psc(9,6): Revert is not a function or does not exist Here is a simple version of the script: Scriptname aaaGearScript extends Actor Form Property Gear Auto Event OnLoad()Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000004) as Armor)Self.EquipItem(Gear, True)Gear.Revert()EndEvent Does anyone know why I keep getting the errors? Link to comment Share on other sites More sharing options...
Deleted3897072User Posted May 19, 2018 Share Posted May 19, 2018 You have declared Gear as a Form, not as a FormList. Link to comment Share on other sites More sharing options...
HeirOfTheSeptims Posted May 19, 2018 Author Share Posted May 19, 2018 Thank you! It always seems to be some little thing like that.. Link to comment Share on other sites More sharing options...
HeirOfTheSeptims Posted May 19, 2018 Author Share Posted May 19, 2018 (edited) Now the Script saves and runs, but it wont do anything in game :/ I've tired 3 different iterations of it, but they all refuse to equip the items to the npc. Scriptname aaaGearScript extends Actor FormList Property Gear Auto Event OnLoad()Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000001) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000002) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000004) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000008) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000010) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000020) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000040) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000080) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000100) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000200) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000400) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00000800) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00001000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00002000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00004000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00008000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00010000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00020000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00040000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00080000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00400000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x00800000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x01000000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x02000000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x04000000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x08000000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x10000000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x20000000) as Armor)Gear.AddForm(Game.GetPlayer().GetWornForm(0x40000000) as Armor)Self.AddItem(Gear, 1)Self.EquipItem(Gear, True, True)Gear.Revert()Self.BlockActivation()EndEvent Scriptname aaaGearScript extends Actor FormList Property Gear AutoArmor Armor1Armor Armor2Armor Armor3Armor Armor4Armor Armor5Armor Armor6Armor Armor7Armor Armor8Armor Armor9Armor Armor10Armor Armor11Armor Armor12Armor Armor13Armor Armor14Armor Armor15Armor Armor16Armor Armor17Armor Armor18Armor Armor19Armor Armor20Armor Armor21Armor Armor22Armor Armor23Armor Armor24Armor Armor25Armor Armor26Armor Armor27Armor Armor28Armor Armor29 Event OnLoad()Game.GetPlayer().GetWornForm(0x00000001) as Armor == Armor1Game.GetPlayer().GetWornForm(0x00000002) as Armor == Armor2Game.GetPlayer().GetWornForm(0x00000004) as Armor == Armor3Game.GetPlayer().GetWornForm(0x00000008) as Armor == Armor4Game.GetPlayer().GetWornForm(0x00000010) as Armor == Armor5Game.GetPlayer().GetWornForm(0x00000020) as Armor == Armor6Game.GetPlayer().GetWornForm(0x00000040) as Armor == Armor7Game.GetPlayer().GetWornForm(0x00000080) as Armor == Armor8Game.GetPlayer().GetWornForm(0x00000100) as Armor == Armor9Game.GetPlayer().GetWornForm(0x00000200) as Armor == Armor10Game.GetPlayer().GetWornForm(0x00000400) as Armor == Armor11Game.GetPlayer().GetWornForm(0x00000800) as Armor == Armor12Game.GetPlayer().GetWornForm(0x00001000) as Armor == Armor13Game.GetPlayer().GetWornForm(0x00002000) as Armor == Armor14Game.GetPlayer().GetWornForm(0x00004000) as Armor == Armor15Game.GetPlayer().GetWornForm(0x00008000) as Armor == Armor16Game.GetPlayer().GetWornForm(0x00010000) as Armor == Armor17Game.GetPlayer().GetWornForm(0x00020000) as Armor == Armor18Game.GetPlayer().GetWornForm(0x00040000) as Armor == Armor19Game.GetPlayer().GetWornForm(0x00080000) as Armor == Armor20Game.GetPlayer().GetWornForm(0x00400000) as Armor == Armor21Game.GetPlayer().GetWornForm(0x00800000) as Armor == Armor22Game.GetPlayer().GetWornForm(0x01000000) as Armor == Armor23Game.GetPlayer().GetWornForm(0x02000000) as Armor == Armor24Game.GetPlayer().GetWornForm(0x04000000) as Armor == Armor25Game.GetPlayer().GetWornForm(0x08000000) as Armor == Armor26Game.GetPlayer().GetWornForm(0x10000000) as Armor == Armor27Game.GetPlayer().GetWornForm(0x20000000) as Armor == Armor28Game.GetPlayer().GetWornForm(0x40000000) as Armor == Armor29Gear.AddForm(Armor1)Gear.AddForm(Armor2)Gear.AddForm(Armor3)Gear.AddForm(Armor4)Gear.AddForm(Armor5)Gear.AddForm(Armor6)Gear.AddForm(Armor7)Gear.AddForm(Armor8)Gear.AddForm(Armor9)Gear.AddForm(Armor10)Gear.AddForm(Armor11)Gear.AddForm(Armor12)Gear.AddForm(Armor13)Gear.AddForm(Armor14)Gear.AddForm(Armor15)Gear.AddForm(Armor16)Gear.AddForm(Armor17)Gear.AddForm(Armor18)Gear.AddForm(Armor19)Gear.AddForm(Armor20)Gear.AddForm(Armor21)Gear.AddForm(Armor22)Gear.AddForm(Armor23)Gear.AddForm(Armor24)Gear.AddForm(Armor25)Gear.AddForm(Armor26)Gear.AddForm(Armor27)Gear.AddForm(Armor28)Gear.AddForm(Armor29)Self.EquipItem(Gear, True, True)Gear.Revert()Self.BlockActivation()EndEvent Scriptname aaaGearScript extends Actor FormList Property Gear AutoArmor Armor1Armor Armor2Armor Armor3Armor Armor4Armor Armor5Armor Armor6Armor Armor7Armor Armor8Armor Armor9Armor Armor10Armor Armor11Armor Armor12Armor Armor13Armor Armor14Armor Armor15Armor Armor16Armor Armor17Armor Armor18Armor Armor19Armor Armor20Armor Armor21Armor Armor22Armor Armor23Armor Armor24Armor Armor25Armor Armor26Armor Armor27Armor Armor28Armor Armor29 Event OnLoad()Game.GetPlayer().GetWornForm(0x00000001) as Armor == Armor1Game.GetPlayer().GetWornForm(0x00000002) as Armor == Armor2Game.GetPlayer().GetWornForm(0x00000004) as Armor == Armor3Game.GetPlayer().GetWornForm(0x00000008) as Armor == Armor4Game.GetPlayer().GetWornForm(0x00000010) as Armor == Armor5Game.GetPlayer().GetWornForm(0x00000020) as Armor == Armor6Game.GetPlayer().GetWornForm(0x00000040) as Armor == Armor7Game.GetPlayer().GetWornForm(0x00000080) as Armor == Armor8Game.GetPlayer().GetWornForm(0x00000100) as Armor == Armor9Game.GetPlayer().GetWornForm(0x00000200) as Armor == Armor10Game.GetPlayer().GetWornForm(0x00000400) as Armor == Armor11Game.GetPlayer().GetWornForm(0x00000800) as Armor == Armor12Game.GetPlayer().GetWornForm(0x00001000) as Armor == Armor13Game.GetPlayer().GetWornForm(0x00002000) as Armor == Armor14Game.GetPlayer().GetWornForm(0x00004000) as Armor == Armor15Game.GetPlayer().GetWornForm(0x00008000) as Armor == Armor16Game.GetPlayer().GetWornForm(0x00010000) as Armor == Armor17Game.GetPlayer().GetWornForm(0x00020000) as Armor == Armor18Game.GetPlayer().GetWornForm(0x00040000) as Armor == Armor19Game.GetPlayer().GetWornForm(0x00080000) as Armor == Armor20Game.GetPlayer().GetWornForm(0x00400000) as Armor == Armor21Game.GetPlayer().GetWornForm(0x00800000) as Armor == Armor22Game.GetPlayer().GetWornForm(0x01000000) as Armor == Armor23Game.GetPlayer().GetWornForm(0x02000000) as Armor == Armor24Game.GetPlayer().GetWornForm(0x04000000) as Armor == Armor25Game.GetPlayer().GetWornForm(0x08000000) as Armor == Armor26Game.GetPlayer().GetWornForm(0x10000000) as Armor == Armor27Game.GetPlayer().GetWornForm(0x20000000) as Armor == Armor28Game.GetPlayer().GetWornForm(0x40000000) as Armor == Armor29Self.EquipItem(Armor1)Self.EquipItem(Armor2)Self.EquipItem(Armor3)Self.EquipItem(Armor4)Self.EquipItem(Armor5)Self.EquipItem(Armor6)Self.EquipItem(Armor7)Self.EquipItem(Armor8)Self.EquipItem(Armor9)Self.EquipItem(Armor10)Self.EquipItem(Armor11)Self.EquipItem(Armor12)Self.EquipItem(Armor13)Self.EquipItem(Armor14)Self.EquipItem(Armor15)Self.EquipItem(Armor16)Self.EquipItem(Armor17)Self.EquipItem(Armor18)Self.EquipItem(Armor19)Self.EquipItem(Armor20)Self.EquipItem(Armor21)Self.EquipItem(Armor22)Self.EquipItem(Armor23)Self.EquipItem(Armor24)Self.EquipItem(Armor25)Self.EquipItem(Armor26)Self.EquipItem(Armor27)Self.EquipItem(Armor28)Self.EquipItem(Armor29)Self.BlockActivation()EndEvent Any ideas? Edited May 19, 2018 by HeirOfTheSeptems Link to comment Share on other sites More sharing options...
Deleted3897072User Posted May 19, 2018 Share Posted May 19, 2018 (edited) You are confusing assignment with condtional equaity. For example, the line Game.GetPlayer().GetWornForm(0x00000001) as Armor == Armor1just tests if Armor1 is the same as what the player is wearing, which it probably won't be, but either way it just throws away the result. You probably mean Armor1 = Game.GetPlayer().GetWornForm(0x00000001) as Armorwhich sets the variable Armor1 to be equal to the item worn. I would explain loops to you but you need to understand assignment first. Incidentally, why are you using a FormList at all? Edited May 19, 2018 by OldMansBeard Link to comment Share on other sites More sharing options...
HeirOfTheSeptims Posted May 19, 2018 Author Share Posted May 19, 2018 There we go, now it works perfectly! As for why I used a formlist, I was trying to simplify the script. Link to comment Share on other sites More sharing options...
Deleted3897072User Posted May 20, 2018 Share Posted May 20, 2018 You could consider something like this: Event OnLoad() int iSlotMask = 0x00000001 While (iSlotMask <= 0x40000000) CopySlot(iSlotMask) iSlotMask *= 2 EndWhile EndEvent Function CopySlot(int iSlotMask) Armour Thing = Game.GetPlayer().GetWornForm(iSlotMask) as Armor If Thing EquipItem(Thing) EndIf EndFunction Link to comment Share on other sites More sharing options...
Recommended Posts