View Full Version : Sniping mod: Questions

26th Oct 2001, 12:36 PM
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.

26th Oct 2001, 11:13 PM
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.

27th Oct 2001, 09:45 AM
An email's on the way! =)

Captain Kewl
27th Oct 2001, 09:52 AM
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.

27th Oct 2001, 11:27 AM
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!


27th Oct 2001, 03:56 PM
that plus the timer system was what my 'jostle' function was ;)