Cloen Posted November 3, 2018 Share Posted November 3, 2018 I am working on a quest and tl;dr in a part of it the player discovers that the sword found inside a dungeon can take human form. I need a spell that summons the follower an unequips the sword and reverse. I actually found enough material on google to work on a script for both actions separated but I have no idea how to make them work together, and that's kinda the point. Can anyone help me? Link to comment Share on other sites More sharing options...
SeraphimKensai Posted November 4, 2018 Share Posted November 4, 2018 It sounds like you want a custom summon spell that has a condition that the sword is equipped to cast. The script you would need would have an Oneffectstart that unequips the sword and an OnEffectFinish that requires the sword. That way when the spell is over and the follower disappears the sword comes back. Only issue I can see with it being a weapon is that it wouldn't be able to hold any tempering or custom enchants that you put on it during a playthrough. Otherwise, it seems like a pretty simple process. Link to comment Share on other sites More sharing options...
Cloen Posted November 4, 2018 Author Share Posted November 4, 2018 (edited) I can see how it would easily bug though, the sword shouldn't be equipped to work. Let's say the player equips it, summons the follower, the spell ends but the player equipped another weapon meanwhile.if the condition would be to have it in the inventory it would make everything easier. Edited November 4, 2018 by Cloen Link to comment Share on other sites More sharing options...
Cloen Posted November 5, 2018 Author Share Posted November 5, 2018 Scriptname Swordchange Extends ReferenceAlias Spell Property SpellCasted Auto Weapon Property SwordBody Auto Actor Property PlayerRef Auto Event OnSpellCast(Form akSpell) If akSpell == SpellCasted PlayerRef.RemoveItem(SwordBody, 1) EndIf EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) PlayerRef.AddItem(SwordBody, 1) EndEvent Something like this? I swear I have no idea about what I'm doing Link to comment Share on other sites More sharing options...
SeraphimKensai Posted November 6, 2018 Share Posted November 6, 2018 Personally I would build it as a magic effect, so instead of extending reference alias (like you would on a quest), extend ActiveMagicEffect Additionally, instead of OnSpellCast, I would use Oneffectstart. I would use a condition rather than checking the spell to check to make sure you have the sword before removing/adding it. Otherwise I would put in some VFX and sound for your conjuration of the sword to NPC, and use a NPC reference to enable/ MoveTo that actor to you so you can have as a follower or what ever you want to do with it. Then in OnEffectFinish, you clean it up and send the NPC back to it's holding cell and get the sword again. Link to comment Share on other sites More sharing options...
Cloen Posted November 6, 2018 Author Share Posted November 6, 2018 Thanks for your kind help.That's what I had in mind at the beginning but that would make the spell all based on scripting, so I decided to go the easy way. I made a summon spell to summon my npc this way I can just use it as a reference without the teleporting out of a cell thing, then add the removing part to the magic effect. So the player casts the summon spell, the script removes the sword, the effect ends and the scripts adds the sword to the player inventory. The big question here is, what happens when a summoned npc is flagged as a follower, does it override the spell duration? That would be a problem Link to comment Share on other sites More sharing options...
Cloen Posted November 7, 2018 Author Share Posted November 7, 2018 (edited) Scriptname Swordchange Extends ActiveMagicEffect Weapon Property SwordBody Auto Actor Property PlayerRef Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If akCaster == PlayerRef PlayerRef.RemoveItem(SwordBody) EndIf EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) If akCaster == PlayerRef PlayerRef.AddItem(SwordBody) EndIf EndEvent So I went for this script and put it on the magic effect to summon the npc. The npc is summoned just fine but nothing happens to the sword, it stays there *Edit: I fused this one with the first script I wrote and it now works! At least in part....I can't get the spell to not be recastable while active AND the sword gets added back right after the npc is summonednot after the actor faded away *Edit2: Got back to this script and managed to make it work, BUT not on a summon spell. Apparently with summon spells only "onSpellcast" works but not "OnEffectFinish" so I was getting the sword back right after I was summoning the npc. Now I changed the spell type to a cloak effect and the sword gets removed and added back just fine and at the right time, now I just have to make the npc be summoned by the script and make it fade away when the spell ends *Edit3:I. DID. IT! I'm so happyHad to use the MoveTo command and summon the npc as a ObjectReference, then put the same command on a xMarker when the effect of the spell ends Edited November 7, 2018 by Cloen Link to comment Share on other sites More sharing options...
SeraphimKensai Posted November 10, 2018 Share Posted November 10, 2018 Glad it worked. For future reference you can often get more information from people posting these kind of questions in the Creation Kit and Modders subforum. Link to comment Share on other sites More sharing options...
Recommended Posts