OK, I'm trying to have an effect shader played on the weapon/armor:
Scriptname TESTSCRIPTACTIVATORBS extends ObjectReferenceWeapon Property RunestoneWeapon Auto{Weapon for the runestone to add}Armor Property RunestoneArmor Auto{Armor for the runestone to add}Actor Property PlayerREF Auto{The player, should autofill}Sound Property ActivateSound Auto{The sound to play when activated}EffectShader Property BoundEffect Auto{The runestone bound weapon/armor effect}Auto State ReadyEvent OnActivate(ObjectReference akActionRef)ActivateSound.Play(self)PlayerREF.AddItem(RunestoneWeapon, 1, false); 1 is the count, false is to show that it's been addedPlayerREF.EquipItem(RunestoneWeapon, false, true); last value will not tell the player it's been equipped if trueBoundEffect.Play(RunestoneWeapon, -1.0)PlayerREF.AddItem(RunestoneArmor, 1, false); 1 is the count, false is to show that it's been addedPlayerREF.EquipItem(RunestoneArmor, false, true); last value will not tell the player it's been equipped if trueBoundEffect.Play(RunestoneArmor, -1.0)GoToState("Waiting")EndEventEndStateState WaitingEvent OnActivate(ObjectReference akActionRef)EndEventEvent OnBeginState() RegisterForSingleUpdate(300.0)RegisterForSingleUpdateGameTime(24.0); register for an update in one dayEndEventEvent OnUpdateGameTime()GoToState("Ready")EndEventEvent OnUpdate() PlayerREF.UnequipItem(RunestoneWeapon, false, false) PlayerREF.RemoveItem(RunestoneWeapon, 1, false) BoundEffect.Stop(RunestoneWeapon) PlayerREF.UnequipItem(RunestoneArmor, false, false) PlayerREF.RemoveItem(RunestoneArmor, 1, false)EndEventEndState
But there's an error with Play:
Starting 1 compile threads for 1 files...Compiling "TESTSCRIPTACTIVATORBS"...C:\Games\Steam\steamapps\common\Skyrim\Data\scripts\Source\TESTSCRIPTACTIVATORBS.psc(20,28): type mismatch on parameter 1 (did you forget a cast?)C:\Games\Steam\steamapps\common\Skyrim\Data\scripts\Source\TESTSCRIPTACTIVATORBS.psc(23,49): cannot cast a armor to a objectreference, types are incompatibleNo output generated for TESTSCRIPTACTIVATORBS.psc, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on TESTSCRIPTACTIVATORBS.pscC:\Games\Steam\steamapps\common\Skyrim\Data\scripts\Source\TESTSCRIPTACTIVATORBS.psc(47,22): type mismatch on parameter 1 (did you forget a cast?)[Finished in 1.1s with exit code -1]
Is it not possible to play an EffectShader directly on a weapon or armor?
And I can't cast to objectreference.