Jump to content

Weapon Kickback Scripting Help


rondivu

Recommended Posts

So I'm working on a mod for myself, I already know enough scripting to add items to myself in game through a quest that runs once. The weapon I've created (copied technically) is working properly and works the way I want it to, no problems. The issue is the scripting for creating a Kickback effect. What I mean is, a gun so powerful it literally knocks you off your feet. I got this idea from "the Noisy Cricket" gun from M.I.B., and created my own version. I have already created a script for it,

 

scn AAAAmalgamKnockdownScript

 

ref myself

short MyStatE

short MyStatX

short MyStatS

short SKpow

 

Begin OnFire

set myself to getself

set MyStatE to myself.getactorvalue EnergyWeapons

set MyStatX to myself.getactorvalue Explosives

set MyStatS to myself.getactorvalue Strength

set SKpow to ((MyStatE / 25) + (MyStatX / 25) + (MyStatS / 4))

If Skpow >= 3

return

Else

set SKpow to ((1 - (SKpow / 3)) * 12)

pushactoraway myself SKpow

Endif

End

 

Obviously, this script is supposed to knock me back if I don't meet the requirements to wield the weapon. I haven't figured out how to get this effect to work. I attached it to the weapon (not Object Effect), but when I shoot it does nothing. I'm wondering if there is anything wrong with the script itself, if I implemented it incorrectly or otherwise missed something logical in the way the script should be working, or perhaps I need it to be an Object Effect? I will be further trying to figure it out, help would be appreciated.

 

Edit: I've been trying to figure out how to implement this script effect. I figured it was a script that simply ran when used, but is it an object effect? Or an actor effect? Or does it need to be something else. All I know is that it is supposed to run when I shoot the gun, and then push me back because of the force of the hit. Still, I'm not sure if its supposed to be running on two separate blocks either.

Edited by rondivu
Link to comment
Share on other sites

Oh, I suppose that might work. Ill give it a shot!!! TY! Merry Xmas!!!! Edited by rondivu
Link to comment
Share on other sites

  • Recently Browsing   0 members

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