Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Redxone

Anti-Freelook (ZScript/ACS)

Recommended Posts

I'm currently working on a weapon mod, and I've got a friend that doesn't like to play with freelook, which is an issue because all my weapons have recoil that stays up and doesn't come back down. This was the original reason for this idea, and it also happens to work perfectly as an "Anti-Freelook" script.

 

I mainly made this to see if it was actually possible, turns out it is! :O

 

If you want to use this in a project of yours just be sure to give me credit, also I wouldn't recommend forcing players to play without freelook but, that part is up to you though.

 

P.S To enable this you need to set the "sv_allowrecoil" CVar to false or 0.

 

Download: https://www.dropbox.com/s/qv2amaimsgzas5q/AntiRecoil.pk3?dl=0

 

 

How it works:

1. First I have an ACS script on ENTER that is looping, this script checks the player's Pitch. If it's under or over 0 a different quantity of a specific inventory item is given to the player. 

2. I spawn a ZScript object which checks the inventory item and sets the player's Pitch accordingly. You may be wondering, how do you make the pitch go down as inventory items cannot be negative? I used a rather simple "sign" trick, If the value of the item is over 127 then I subtract 127 from it. If it's not I just leave it alone. 

 

Edited by Redxone

Share this post


Link to post
28 minutes ago, scifista42 said:

Why use inventory instead of SetActorPitch?

I supposed that would've worked as well. The main reason why I didn't, is that I was trying to see if I could get ACS and ZScript to "talk to each other".

 

I could change it if it'll speed things up. Seems intuitive that there would be a SetActorPitch along-side GetActorPitch.

 

 

Share this post


Link to post

So I'm really grateful for this mod because I often play doom on my commute using just my keyboard and it's nice to be able to use fun mods without having to set up and down keys for when the gun recoils and i want to re center the camera. I have noticed that while it works on Trailblazer, it doesn't work with High Noon Drifter. I wonder why that is. 

 

edit: actually strike that it seems to be based on the maps and not the gun mods. When I play regular Doom 2 it works fine but when I play like, the 50 monsters wad, it doesn't work.

Edited by Dirkdammit

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×