1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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.

Sniping mod: Questions

Discussion in 'Programming' started by Kel-Boi, Oct 26, 2001.

  1. Kel-Boi

    Kel-Boi New Member

    Joined:
    Oct 26, 2001
    Messages:
    4
    Likes Received:
    0
    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
     
  2. vlosk

    vlosk New Member

    Joined:
    Feb 4, 2001
    Messages:
    25
    Likes Received:
    0
    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.
     
  3. Kel-Boi

    Kel-Boi New Member

    Joined:
    Oct 26, 2001
    Messages:
    4
    Likes Received:
    0
    Awesome, thanks!

    An email's on the way! =)
     
  4. Captain Kewl

    Captain Kewl I know kewl.

    Joined:
    Feb 13, 2001
    Messages:
    794
    Likes Received:
    0
    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.
     
  5. Kel-Boi

    Kel-Boi New Member

    Joined:
    Oct 26, 2001
    Messages:
    4
    Likes Received:
    0
    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
     
  6. vlosk

    vlosk New Member

    Joined:
    Feb 4, 2001
    Messages:
    25
    Likes Received:
    0
    heh

    that plus the timer system was what my 'jostle' function was ;)
     

Share This Page