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

How to execute CVARs automatically?

Recommended Posts

I've now spent many hours trying to figure out how to make my map execute CVARs. The reason is that I have reduced the movement speed of the player and for some reason that causes some insane headbobing. In short, it's horrible if you have motion sickness.

So I want the map to automatically change the movebob CVAR when it's loaded so I have added this to the KEYCONF lump:

alias bobfix "movebob 0.1";
Problem 1: I don't know how to make script the executes this alias.

I've thought about binding it to a key but then again I don't know how to make a script that "presses a button".

Problem 2: If I execute this alias manually it's saves the movebob value to the ini file so it is used in all other wads too... How do I avoid this?

So any suggestion to what I can do (and why does this have to be so complicated)?

Share this post


Link to post

I don't think this is possible (at least not in the actual ZDoom version) , i heard it is possible to create hidden player classes but i'm not sure if it's possible to change the class of player using an ACS Script, if you give each class a custom bobstyle and change it with an ACS Script you're done .

Share this post


Link to post

You cannot change CVARs from a script. ZDoom will never let you do that (except for CVARs that you define yourself).

However, what you can do is replace all the weapons to change their Weapon.BobSpeed property.

Share this post


Link to post
Gez said:

You cannot change CVARs from a script. ZDoom will never let you do that (except for CVARs that you define yourself).

However, what you can do is replace all the weapons to change their Weapon.BobSpeed property.

I know that, but I thought that only changed how much they sway back and forth and that's not the problem. The camera moving up and down is what's causing the problems.

Share this post


Link to post

Oh, yeah, good point.


Thinking about it I'm kinda surprised that there isn't a Player.MoveBob property.

Share this post


Link to post
Gez said:

Oh, yeah, good point.


Thinking about it I'm kinda surprised that there isn't a Player.MoveBob property.

Me too, and from my searches this has been a problem for people for many years.

Share this post


Link to post

So I tried to do some workarounds. This is the latest.

alias bobfix "movebob 0.1; rebind bobnorm"
alias bobnorm "movebob 1; rebind bobfix"
bind k bobfix
But whatever I do the game refuse to save the bind. I've tried to map it to different keys, but all the ini file says is: k=movebob

edit: I just manually changed the ini to k=bobfix and it works perfectly. Why isn't the bind line working..?

Share this post


Link to post
Knas said:

So I tried to do some workarounds. This is the latest.

alias bobfix "movebob 0.1; rebind bobnorm"
alias bobnorm "movebob 1; rebind bobfix"
bind k bobfix
But whatever I do the game refuse to save the bind. I've tried to map it to different keys, but all the ini file says is: k=movebob

edit: I just manually changed the ini to k=bobfix and it works perfectly. Why isn't the bind line working..?

Have you tried to put these on the kEYCONF ?

Share this post


Link to post
DMGUYDZ64 said:

Have you tried to put these on the kEYCONF ?

Ah, yes. That's where they are.

edit: I figured out the problem. It has to be defaultbind instead of bind. Don't know why but bind doesn't seem to do anything.

Share this post


Link to post
Edward850 said:

Because that would allow you to rebind someone else's keys. Very much a bad idea.

Not if there would have been a feature to have a custom profile for each wad.

Share this post


Link to post

Aside from the part where bind would imply you couldn't rebind the key at all, as KEYCONF would reset it every time it was parsed, from a user end standpoint it would also be infuriating over all. I certainly wouldn't want to rebind my keys for literally every mapset I load, this includes if I change my desired bind layout later. It's a mod, not a game, and thus one would expect the game settings to still be applied.

That's why defaultbind exists, so you can have an alias that has a low priority bind, unique to your mod. It's already independent to your keyconf profile, as well.

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
×