Jump to content

Need help with script to equip armor using a spell


dePog

Recommended Posts

I have set up some horns as quest items so that they appear in the player's inventory at game start. I can also apply the following script to the horns so that they attach to the player and can't be removed:

 

Scriptname TieflingHornsScript extends ObjectReference
Actor Property PlayerREF Auto
Armor Property TieflingHorns Auto
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
If akNewContainer == PlayerREF
Game.GetPlayer() .EquipItem (TieflingHorns, true, true)
EndIf
EndEvent
However, I would prefer to have the horns equip and unequip by using a spell that transforms my character from Human form to Tiefling form. I was hoping to create the spell so that it does several functions such as:
1. cast an effect (flash of light or smoke) to signify the change of form from human to Tiefling
2. equip the horns and tail
3. change faction (add to Tiefling faction when wearing horns and tail, then remove from faction when horns/tail are unequipped)
I have successfully created a spell that performs step 1. I have also attached the script above to that spell to try and perform step 2, but it does not activate.
Any help would be appreciated
Cheers,
dePog
Link to comment
Share on other sites

I'm thinking that since the event to equip the Tiefling items on container change is there, maybe have the spell add the items to the player's inventory on magic cast, then remove them when turning the Tiefling form off. That is, instead of having the items added to the player inventory at game start.

 

I'm not sure if or how that would work, though. Maybe someone else will have a better solution.

Link to comment
Share on other sites

I'm thinking that since the event to equip the Tiefling items on container change is there, maybe have the spell add the items to the player's inventory on magic cast, then remove them when turning the Tiefling form off. That is, instead of having the items added to the player inventory at game start.

 

I'm not sure if or how that would work, though. Maybe someone else will have a better solution.

Yes, that is exactly what I want to do, but when i try to add this script to a spell it does not activate. In fact I can't get any script to activate from using a spell, I attach them but nothing happens. I presume I am using the wrong 'on event' or wrong properties or something

Link to comment
Share on other sites

Ok, its only taken me 3 months to work it out, but finally after trial and error (mostly error) I have created and applied the correct script to attach the tiefling's tail and horns using a spell that toggles them on and off, and changes her faction. Consider this request finalised.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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