BisquitsNgravy Posted July 5, 2012 Posted July 5, 2012 I am trying to find an example object script which will cast or cause the player to cast a spell when the object is added to the player or equipped on the player. I have a mod I am trying to modify to cast a spell at a certain thresh hold. I have managed to get it to add various items to the player as tokens. I have tried adding clothing items and equipping them. The spell works fine when I manually add it to the player and cast it so I know the spell works. But I can not get the player to cast the spell with an activator or even with a ring added and equipped, That is the latest thing I have tried. This sounds so simple but I just cannot get it to work. **scn Equipedringscript** short isEquipped begin onEquip player set isEquipped to 1 player.addspell 02014faa player.Cast 02014faa player End
Guest Donkey Posted July 6, 2012 Posted July 6, 2012 Cursedarmor should have samples like this. Also i think i created something similar but that was long time ago where you will be able to milk your breast and an animation would play then a new item will be added to your inventory. But i deleted most of my other stuff from my pc to save space. I am not sure, but instead of begin onEquiped did you try: begin onAdd instead ?? **scn Equipedringscript** short isEquipped begin onEquip player set isEquipped to 1 player.addspell 02014faa player.Cast 02014faa player End How are you forcing it to be equiped on the player after it is added in ?? In the context above it will only work if you go to your inventory and use the item yourself.
mem4ob4 Posted July 7, 2012 Posted July 7, 2012 Did a bit of testing and reading on this. If the player equips the ring themselves, it will not do the cast. If the ring is hotkeyed, it works fine. So if player is in menumode when the onequip runs... no casting. scn Equipedringscript ref bucket begin onEquip player set bucket to GetContainer if bucket.HasSpell MemRingTestSpell == 0 bucket.addspell MemRingTestSpell endif SelectPlayerSpell MemRingTestSpell PrintToConsole "Tap it!" TapControl 7 End Might have the same problem with onadd if player takes it from a container. If you force the equip from another script, be sure to use OBSEs EquipItem2 to insure the OnEquip block runs. Mem
BisquitsNgravy Posted July 7, 2012 Author Posted July 7, 2012 I got it working just had to use an object script instead of a spell to move an activator to my character and it casts the spell just fine thanks guys.
Grumpf Posted July 23, 2012 Posted July 23, 2012 I assume using the activator you didn't added the spell to the player magic book?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.