Jump to content

Using Form List Scripts?


Recommended Posts

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 exist
C:\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

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 Auto

Armor Armor1
Armor Armor2
Armor Armor3
Armor Armor4
Armor Armor5
Armor Armor6
Armor Armor7
Armor Armor8
Armor Armor9
Armor Armor10
Armor Armor11
Armor Armor12
Armor Armor13
Armor Armor14
Armor Armor15
Armor Armor16
Armor Armor17
Armor Armor18
Armor Armor19
Armor Armor20
Armor Armor21
Armor Armor22
Armor Armor23
Armor Armor24
Armor Armor25
Armor Armor26
Armor Armor27
Armor Armor28
Armor Armor29

 

Event OnLoad()
Game.GetPlayer().GetWornForm(0x00000001) as Armor == Armor1
Game.GetPlayer().GetWornForm(0x00000002) as Armor == Armor2
Game.GetPlayer().GetWornForm(0x00000004) as Armor == Armor3
Game.GetPlayer().GetWornForm(0x00000008) as Armor == Armor4
Game.GetPlayer().GetWornForm(0x00000010) as Armor == Armor5
Game.GetPlayer().GetWornForm(0x00000020) as Armor == Armor6
Game.GetPlayer().GetWornForm(0x00000040) as Armor == Armor7
Game.GetPlayer().GetWornForm(0x00000080) as Armor == Armor8
Game.GetPlayer().GetWornForm(0x00000100) as Armor == Armor9
Game.GetPlayer().GetWornForm(0x00000200) as Armor == Armor10
Game.GetPlayer().GetWornForm(0x00000400) as Armor == Armor11
Game.GetPlayer().GetWornForm(0x00000800) as Armor == Armor12
Game.GetPlayer().GetWornForm(0x00001000) as Armor == Armor13
Game.GetPlayer().GetWornForm(0x00002000) as Armor == Armor14
Game.GetPlayer().GetWornForm(0x00004000) as Armor == Armor15
Game.GetPlayer().GetWornForm(0x00008000) as Armor == Armor16
Game.GetPlayer().GetWornForm(0x00010000) as Armor == Armor17
Game.GetPlayer().GetWornForm(0x00020000) as Armor == Armor18
Game.GetPlayer().GetWornForm(0x00040000) as Armor == Armor19
Game.GetPlayer().GetWornForm(0x00080000) as Armor == Armor20
Game.GetPlayer().GetWornForm(0x00400000) as Armor == Armor21
Game.GetPlayer().GetWornForm(0x00800000) as Armor == Armor22
Game.GetPlayer().GetWornForm(0x01000000) as Armor == Armor23
Game.GetPlayer().GetWornForm(0x02000000) as Armor == Armor24
Game.GetPlayer().GetWornForm(0x04000000) as Armor == Armor25
Game.GetPlayer().GetWornForm(0x08000000) as Armor == Armor26
Game.GetPlayer().GetWornForm(0x10000000) as Armor == Armor27
Game.GetPlayer().GetWornForm(0x20000000) as Armor == Armor28
Game.GetPlayer().GetWornForm(0x40000000) as Armor == Armor29

Gear.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 Auto

Armor Armor1
Armor Armor2
Armor Armor3
Armor Armor4
Armor Armor5
Armor Armor6
Armor Armor7
Armor Armor8
Armor Armor9
Armor Armor10
Armor Armor11
Armor Armor12
Armor Armor13
Armor Armor14
Armor Armor15
Armor Armor16
Armor Armor17
Armor Armor18
Armor Armor19
Armor Armor20
Armor Armor21
Armor Armor22
Armor Armor23
Armor Armor24
Armor Armor25
Armor Armor26
Armor Armor27
Armor Armor28
Armor Armor29

 

Event OnLoad()
Game.GetPlayer().GetWornForm(0x00000001) as Armor == Armor1
Game.GetPlayer().GetWornForm(0x00000002) as Armor == Armor2
Game.GetPlayer().GetWornForm(0x00000004) as Armor == Armor3
Game.GetPlayer().GetWornForm(0x00000008) as Armor == Armor4
Game.GetPlayer().GetWornForm(0x00000010) as Armor == Armor5
Game.GetPlayer().GetWornForm(0x00000020) as Armor == Armor6
Game.GetPlayer().GetWornForm(0x00000040) as Armor == Armor7
Game.GetPlayer().GetWornForm(0x00000080) as Armor == Armor8
Game.GetPlayer().GetWornForm(0x00000100) as Armor == Armor9
Game.GetPlayer().GetWornForm(0x00000200) as Armor == Armor10
Game.GetPlayer().GetWornForm(0x00000400) as Armor == Armor11
Game.GetPlayer().GetWornForm(0x00000800) as Armor == Armor12
Game.GetPlayer().GetWornForm(0x00001000) as Armor == Armor13
Game.GetPlayer().GetWornForm(0x00002000) as Armor == Armor14
Game.GetPlayer().GetWornForm(0x00004000) as Armor == Armor15
Game.GetPlayer().GetWornForm(0x00008000) as Armor == Armor16
Game.GetPlayer().GetWornForm(0x00010000) as Armor == Armor17
Game.GetPlayer().GetWornForm(0x00020000) as Armor == Armor18
Game.GetPlayer().GetWornForm(0x00040000) as Armor == Armor19
Game.GetPlayer().GetWornForm(0x00080000) as Armor == Armor20
Game.GetPlayer().GetWornForm(0x00400000) as Armor == Armor21
Game.GetPlayer().GetWornForm(0x00800000) as Armor == Armor22
Game.GetPlayer().GetWornForm(0x01000000) as Armor == Armor23
Game.GetPlayer().GetWornForm(0x02000000) as Armor == Armor24
Game.GetPlayer().GetWornForm(0x04000000) as Armor == Armor25
Game.GetPlayer().GetWornForm(0x08000000) as Armor == Armor26
Game.GetPlayer().GetWornForm(0x10000000) as Armor == Armor27
Game.GetPlayer().GetWornForm(0x20000000) as Armor == Armor28
Game.GetPlayer().GetWornForm(0x40000000) as Armor == Armor29

Self.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 by HeirOfTheSeptems
Link to comment
Share on other sites

You are confusing assignment with condtional equaity. For example, the line

Game.GetPlayer().GetWornForm(0x00000001) as Armor == Armor1

just 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 Armor

which 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 by OldMansBeard
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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