Sniping mod: Questions

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Kel-Boi

New Member
Oct 26, 2001
4
0
0
Visit site
I must have posted this in the wrong forum the first time.

Greetings, folks.

I'm interested in making a mutator that causes a non-crouched player's view to wander/waver randomly. I've noticed that there is a "zooming" state, and I expect I can figure out whether there is a "crouched" state (must be, right? players move slower while crouched), and further whether there is a "zoomed" state, "walking" state, and "running" state. Any tips or hints would be great, since I'm new to the codebase. :)

(Optimally, a sniper's zoomed view would jostle most when running, less when walking, even less when standing still, and less still when crouched and moving, and least (possibly none) when crouched and still.)

I expect the major pain I'll suffer is figuring out how to make the player's view jostle. Any pointers to the right functions/variables would be fantastic. Once I know what to use I'm hoping it will be rather academic to come up with a "jostle" algorithm.

In any case, thanks for any help you folks can provide.
Cheers,
Kel
 

vlosk

New Member
Feb 4, 2001
25
0
0
vlosk.unrealcenter.com
Arg

I don't have the example here on this comp, but e-mail me at: vlsok@powersurfr.com and i can pass you a nice simple little bit of 'jostle' material :)

Also, though state based should in theroy work fine, i think you would be better off making it works as follows:

High Jostle: The player is really moving. This can be falling, jumping, swimming, running, you name it; if it is based on the players speed you have full support for all physics.

Low Jostle: if the player is crouched.

Such would be done in the weapon's tick function, checking the values of the human owner (PlayerPawn(Owner).[something]) again, i don't have any examples here, but i have a bunch of example code bits at home, so e-mail me if you would like to know more.
 

Captain Kewl

I know kewl.
Feb 13, 2001
794
0
0
IN YOUR HOUSE
Visit site
bIsCrouching is in the PlayerPawn class. There's also a ShakeView function which is called when you fire a weapon or take damage.

function ShakeView( float shaketime, float RollMag, float vertmag)

Maybe have a timer that checks every second or so to see of bIsCrouching == False, and if it is, call ShakeView with shaketime of the timer interval and small RollMag and Vertmag. Make the values functions of magnitude of velocity or something.
 

Kel-Boi

New Member
Oct 26, 2001
4
0
0
Visit site
Awesome

Thanks for the tips, Cap Kewl!

I'm impressed and humbled by how helpful the folks on this message board are.

Give me a while, but once I have a working mutator I'll post the results here.

Thanks much!

Kel