Author Topic: How to run invoke a console function in script?  (Read 1653 times)

I'm guessing this would just work normally, but double checking here since I'm not at my computer at the moment and can't check it. Basically, if there is a function you'd normally run from the console (say, mousefire(1);, would that simply be called like a normal function in a script (exactly how I just wrote it? Or is there a more efficient way of invoking these functions? Just so you know, the specific function I'd be calling is setFOV();. Running trace on the setFOV function didn't provide me with anything useful, so don't bother suggesting that.

I tried setting $Pref::Player::DefaultFOV and $Pref::Player::CurrentFOV instead, but upon using trace, it would seem that this only works with an "updateFOV" function, which I can't seem to figure out how to utilize. If someone could inform me on how to call this function, that'd be great, as I am assuming that it could be more efficient than setFOV, unless, of course, this is exactly what setFOV does anyway.

yeah, the console is basically a miniature notepad to create small scripts and tweak stuff at runtime. mouseFire(1); in the console would be the same inside any script file.

Are you trying to just set the fov of your client? I don't know how running trace on setFov() would help you call it (besides getting the arguments), but it works the same way as mouseFire. If you want your fov to be 90 until something else sets it, just do setFov(90);.. unless I'm missing something?

yeah, the console is basically a miniature notepad to create small scripts and tweak stuff at runtime. mouseFire(1); in the console would be the same inside any script file.

Are you trying to just set the fov of your client? I don't know how running trace on setFov() would help you call it (besides getting the arguments), but it works the same way as mouseFire. If you want your fov to be 90 until something else sets it, just do setFov(90);.. unless I'm missing something?
Thanks. I'm actually making a script that changes the FOV automatically, proportional to the player's speed.

Thanks. I'm actually making a script that changes the FOV automatically, proportional to the player's speed.

It exists already but I can't find it. Go for it.


http://rtb-archive.host22.com/add_ons/Client_DynamicFov.zip
Shhh...

Actually, what features does this one have? If it has everything I was gonna include anyway, I may just skip it (or add more features).

Shhh...

Actually, what features does this one have? If it has everything I was gonna include anyway, I may just skip it (or add more features).

Has a keybind for enabling and disabling it, or you can have it only change FOV while in a vehicle (you can still have dyn fov while not on one)

Has a keybind for enabling and disabling it, or you can have it only change FOV while in a vehicle (you can still have dyn fov while not on one)
Hmm... Ok, I may just skip it then. Thanks anyway.