Jump to content

Scripting help


speaker60

Recommended Posts

Im trying to make a small script to have the vault suite switch between 5 different armor addons

There different zip states Half Unzipped, fully zipped ect,

My first version made years ago simply swapped between 4 different armors when using an ingest-able(called zipper that never left the inventory)

This works all fine but it basically removes and adds armors and auto equips them which means i cant or rather its pointless to modify the armor at a armor bench as the mods will be lost when i use the zipper

 

So now im attempting to make a version of this that is one armor object that just changes its armor addon to change the visual appearance

this will maintain any mods the armor has

 

Its been many years since iv done any kind of scripting and i have forgotten most of it :(

Im hoping what i want to do is simple enough, i have already setup the vault suite with armor bench mods so i can change the zip appearance at the workbench already

i just now want to set it up to work with the 'zipper' ingestable so i dont need to modify it at a workbench just to visually unzip the suite

 

Old Script

 

Scriptname script_ZipVaultSuit extends activemagiceffect


Group Outfitt

Armor Property VaultSuit01 Auto Const Mandatory

Armor Property VaultSuit02 Auto Const Mandatory

Armor Property VaultSuit03 Auto Const Mandatory

Armor Property VaultSuit04 Auto Const Mandatory

EndGroup



Group Ingestible

Potion Property Alch Auto Const Mandatory

EndGroup



Event onEffectStart(Actor akTarget, Actor akCaster)

If Game.GetPlayer().IsEquipped(VaultSuit01)

Game.GetPlayer().AddItem(VaultSuit02, 1, True)
Game.GetPlayer().EquipItem(VaultSuit02, False, True)
Game.GetPlayer().RemoveItem(VaultSuit01,1, True)


ElseIf Game.GetPlayer().IsEquipped(VaultSuit02)

Game.GetPlayer().AddItem(VaultSuit03, 1, True)
Game.GetPlayer().EquipItem(VaultSuit03, False, True)
Game.GetPlayer().RemoveItem(VaultSuit02,1, True)


ElseIf Game.GetPlayer().IsEquipped(VaultSuit03)

Game.GetPlayer().AddItem(VaultSuit04, 1, True)
Game.GetPlayer().EquipItem(VaultSuit04, False, True)
Game.GetPlayer().RemoveItem(VaultSuit03,1, True)


ElseIf Game.GetPlayer().IsEquipped(VaultSuit04)

Game.GetPlayer().AddItem(VaultSuit01, 1, True)
Game.GetPlayer().EquipItem(VaultSuit01, False, True)
Game.GetPlayer().RemoveItem(VaultSuit04,1, True)


EndIf



Game.GetPlayer().AddItem(Alch,1,True)

EndEvent

 

 

If anyone could help me with an example of code, my old script swapped between 4 states the new one will be 5 as iv added a version of the vault suite with the torso half down by the waist with the arms tied around the waist

Link to comment
Share on other sites

  • Recently Browsing   0 members

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