Jump to content

Knockdown with weapon


Faceshifter

Recommended Posts

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.pushactoraway

And 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 by Faceshifter
Link to comment
Share on other sites

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 by Maskar
Link to comment
Share on other sites

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...