Faceshifter Posted April 15, 2011 Share Posted April 15, 2011 (edited) I've been trying to make a weapon with a chance to knock down your op(p)on(n)ent.All went well, untill I wanted to equip the item on a NPC. I used:player.pushactorawayAnd that worked when I was wielding the weapon, but I have found no function to get the wielder of the weapon.I suppose this is impossible and I can probably work my way around it but it would be kind of ugly ( making new weapons with new scripts for every new NPC who is wielding it). I can imagine something like: Scn ScriptName Ref Pushed Ref Pusher Ref RandomChance Begin ScriptEffectStart set RandomChance to GetRandomPercent if ( RandomChance > 94 ) Set Pushed to GetSelf Set Pusher to GetWielder Pusher.PushActorAway Pushed 15 endif End Only problem is the GetWielder function (this is no real thing of course)Does anyone know a real function for that? Edited April 15, 2011 by Faceshifter Link to comment Share on other sites More sharing options...
Maskar Posted April 15, 2011 Share Posted April 15, 2011 (edited) I myself like using Event Handlers like OnHit and OnHitWith, but GetContainer as suggested below should indeed work. I used it myself in 1 of my mods to find the reference to an actor owning a token. Edited April 15, 2011 by Maskar Link to comment Share on other sites More sharing options...
Hickory Posted April 15, 2011 Share Posted April 15, 2011 Try this: Scn ScriptName Ref Pushed Ref Pusher Ref RandomChance Begin ScriptEffectStart set RandomChance to GetRandomPercent if ( RandomChance > 94 ) Set Pushed to GetCombatTarget Set Pusher to GetSelf Pusher.PushActorAway Pushed 15 endif End Link to comment Share on other sites More sharing options...
Faceshifter Posted April 15, 2011 Author Share Posted April 15, 2011 I used GetSelf to get the one that was hit. I used a magic script effect.Won't GetSelf return the target and result in an upward launching of the combat target? Link to comment Share on other sites More sharing options...
fg109 Posted April 15, 2011 Share Posted April 15, 2011 There's no GetWielder, but there's GetContainer. Although it says container, it works on actors as well. Link to comment Share on other sites More sharing options...
Hickory Posted April 15, 2011 Share Posted April 15, 2011 I used GetSelf to get the one that was hit. I used a magic script effect.Won't GetSelf return the target and result in an upward launching of the combat target? The one that is hit is the combat target, hence GetCombatTarget. GetSelf is the reference that the script is running on, ie. THIS reference. Link to comment Share on other sites More sharing options...
Faceshifter Posted April 15, 2011 Author Share Posted April 15, 2011 (edited) So this script is applied to the weapon? Or on the actor? Edited April 16, 2011 by Faceshifter Link to comment Share on other sites More sharing options...
Recommended Posts