BrotherBob Posted September 10, 2013 Share Posted September 10, 2013 I created a new Actor and gave it an Ability. The Ability consists solely of a MagicEffect with a script attached: Projectile Property SteelArrowProjectile auto Spell Property SpecialSpell auto Actor Target Event OnEffectStart(Actor akTarget, Actor akCaster) Target = akTarget endEvent Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) if akProjectile == SteelArrowProjectile SpecialSpell.Cast(Target, Target) endif endEventDespite properly setting the properties, the Actor never casts the spell when hit by a Steel Arrow. Am I doing something wrong? Link to comment Share on other sites More sharing options...
Shadeybladey Posted September 10, 2013 Share Posted September 10, 2013 Don't you have to have a line at the top something like Scriptname YourProjectileScript extends ObjectReference ? This is actually very interesting to me if this can work because if silver weapons do extra damage against undead and werewolves because of the nature of the metal that hits them, it should be silver arrows and bolts, not silver bows and crossbows, that do extra damage in a mod that has such weapons available for crafting. Cheers Link to comment Share on other sites More sharing options...
IsharaMeradin Posted September 10, 2013 Share Posted September 10, 2013 The object being hit needs to run the OnHit event otherwise it will not work properly or at all. Link to comment Share on other sites More sharing options...
BrotherBob Posted September 10, 2013 Author Share Posted September 10, 2013 Sorry, that's part of a Magic Effect that is attached to the Actor, not the Projectile. I just didn't include the first line. I'm just wondering why it won't work. I figure that if I can get this script to work, I can get another of my scripts to work, which is much longer, but I can upload it if anyone is interested. Incidentally, it involves using Silver projectiles against vampires. Link to comment Share on other sites More sharing options...
steve40 Posted September 10, 2013 Share Posted September 10, 2013 Trace statements are your friend. Link to comment Share on other sites More sharing options...
BrotherBob Posted September 11, 2013 Author Share Posted September 11, 2013 Using trace statements, it appears that the Projectile part of Event OnHit is pretty much useless. It always returns None.egocarib suggested the following on another forum:I just searched around a bit and it appears that the projectile part of onHit() is just borked, and always returns none. However, you should be able to check this by doing something like: if akAggressor.getEquippedItemType == 12 ;(12 == crossbow) if akAggressor.wornHasKeyword(WeaponTypeAmmo) ;(vampire must have been hit by the bolt) endif endifJust replace WeaponTypeAmmo with whatever keyword the silver bolt has. I don't have Dawnguard loaded to check the keywords for bolts right now. If it has a generic keyword that all bolts share, you could add your own custom keyword that will only be on silver bolts, which should then work. I'm just reposting in case anyone needs help with that. Link to comment Share on other sites More sharing options...
steve40 Posted September 11, 2013 Share Posted September 11, 2013 The CK wiki doesn't say that akProjectile is broken but it notes that akProjectile will be none if it came from an enchanted weapon. Link to comment Share on other sites More sharing options...
Recommended Posts