Possible console command?
-
- Posts: 60
- Joined: Sun Jul 20, 2003 6:35 pm
Possible console command?
for moddifying console variables with standard math functions?
e.g: modvar FOV +5 would add 5 to the cvar "FOV"
e.g: modvar chase_dist *2 would multiply the chase distance by 2
and you could have *, /, -, +
I can see this being helpfull on nurmerous occasions, there isnt all ready anything like this is there?
e.g: modvar FOV +5 would add 5 to the cvar "FOV"
e.g: modvar chase_dist *2 would multiply the chase distance by 2
and you could have *, /, -, +
I can see this being helpfull on nurmerous occasions, there isnt all ready anything like this is there?
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
Yes.
There are two commands currently implemented which will allow you to use mathematics to display information and/or manipulate variables.
The first is:
test <expression> <iftrue> [iffalse]
If <expression> evaluates to TRUE, executes <iftrue>. If not, and [iffalse] exists, executes [iffalse]. Remeber to enclose arguments in quotation marks when you need spaces.
Example:
test "zoomfov == 1" "fov 20" "fov 90"
If the custom cvar, "zoomfov" has been set to 1, will set the FOV to 20, otherwise will set the FOV to 90... In theory. In practice, I can't get this to work, but know it's possible.
The second command is:
eval <expression> [variable]
Evaluate <expression>. If [variable] is specified, store the result in [variable]. If not, report the result to the console.
<expression> uses some screwed up kinda notation that I don't fully understand, but is easy to use if you just need to do simple things. For example, instead of:
2 + 3 or 2 * (5 + 3)
you use:
+ 2 3 or * 2 + 5 3
Why? I don't know.
Also, do NOT enclose the calculation in quotation marks. (Otherwise it'll evaluate it as a string)
Again, variables *should* work in the expression, so to do your request you would use:
eval + fov 5 fov
However, as I previously stated, I can't get cvars to work. Anybody know what I'm doing wrong?
[EDIT] My second example was flawed because of the quotations. Fixed. [/EDIT]
[EDIT #2] A quick check to the console.html and I found out how to use cvars. Along the way, I found a bug. Yay!
To use cvars in the eval function, you use $, followed by the command name. To use the example given in console.html:
eval - $screenblocks 1 screenblocks
This take the value stored in "screenblocks", reduces it by 1, and stores the result in screenblocks, reducing the visible area of your screen by 1 setting. The example works perfectly.
However, this doesn't:
eval + $fov 5 fov
Why not? Because $fov is treated as a string even though FOV is a legal variable... Randy? [/EDIT]
[EDIT #3! I'm on a roll!] A few tests for you to chew on:
> fov
fov is 90
> eval + $fov 5
$fov5
> eval + $fov 5 fov
unknown variable fov
> unset fov
> fov
fov is 90
There are two commands currently implemented which will allow you to use mathematics to display information and/or manipulate variables.
The first is:
test <expression> <iftrue> [iffalse]
If <expression> evaluates to TRUE, executes <iftrue>. If not, and [iffalse] exists, executes [iffalse]. Remeber to enclose arguments in quotation marks when you need spaces.
Example:
test "zoomfov == 1" "fov 20" "fov 90"
If the custom cvar, "zoomfov" has been set to 1, will set the FOV to 20, otherwise will set the FOV to 90... In theory. In practice, I can't get this to work, but know it's possible.
The second command is:
eval <expression> [variable]
Evaluate <expression>. If [variable] is specified, store the result in [variable]. If not, report the result to the console.
<expression> uses some screwed up kinda notation that I don't fully understand, but is easy to use if you just need to do simple things. For example, instead of:
2 + 3 or 2 * (5 + 3)
you use:
+ 2 3 or * 2 + 5 3
Why? I don't know.

Again, variables *should* work in the expression, so to do your request you would use:
eval + fov 5 fov
However, as I previously stated, I can't get cvars to work. Anybody know what I'm doing wrong?
[EDIT] My second example was flawed because of the quotations. Fixed. [/EDIT]
[EDIT #2] A quick check to the console.html and I found out how to use cvars. Along the way, I found a bug. Yay!
To use cvars in the eval function, you use $, followed by the command name. To use the example given in console.html:
eval - $screenblocks 1 screenblocks
This take the value stored in "screenblocks", reduces it by 1, and stores the result in screenblocks, reducing the visible area of your screen by 1 setting. The example works perfectly.
However, this doesn't:
eval + $fov 5 fov
Why not? Because $fov is treated as a string even though FOV is a legal variable... Randy? [/EDIT]
[EDIT #3! I'm on a roll!] A few tests for you to chew on:
> fov
fov is 90
> eval + $fov 5
$fov5
> eval + $fov 5 fov
unknown variable fov
> unset fov
> fov
fov is 90
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
I refuse to edit that post anymore.
Also, I am an idiot. In fact, I think I've done this before. Oh well.
FOV is not a cvar, it is a command. Therefore, its value cannot be used in the eval command, nor can it be used to hold the result. This is what we shall hence forth refer to as a "major bummer".
Also, I am an idiot. In fact, I think I've done this before. Oh well.
FOV is not a cvar, it is a command. Therefore, its value cannot be used in the eval command, nor can it be used to hold the result. This is what we shall hence forth refer to as a "major bummer".
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
Now watch the magic of aliases at work:
>set fovvar 90
>fov 90
>alias maxcheck "test > $fovvar 90 \"set fovvar 90; fov 90\""
>alias mincheck "test < $fovvar 20 \"set fovvar 20; fov 20\""
>alias morezoom "eval - $fovvar 5 fovvar"
>alias lesszoom "eval + $fovvar 5 fovvar"
>alias zoomin "morezoom; fov $fovvar; mincheck"
>alias zoomout "lesszoom; fov $fovvar; maxcheck"
>bind mwheelup zoomin
>bind mwheeldown zoomout
Roll your mouse wheel forward to zoom in. Roll it back to zoom out.
>set fovvar 90
>fov 90
>alias maxcheck "test > $fovvar 90 \"set fovvar 90; fov 90\""
>alias mincheck "test < $fovvar 20 \"set fovvar 20; fov 20\""
>alias morezoom "eval - $fovvar 5 fovvar"
>alias lesszoom "eval + $fovvar 5 fovvar"
>alias zoomin "morezoom; fov $fovvar; mincheck"
>alias zoomout "lesszoom; fov $fovvar; maxcheck"
>bind mwheelup zoomin
>bind mwheeldown zoomout
Roll your mouse wheel forward to zoom in. Roll it back to zoom out.
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
Hahaha. If you wanna get REAL technical, add the following to the above:
>alias activezoom "wait; activezoom"
>alias +zoomin "alias activezoom \"zoomin; wait; activezoom\""
>alias -zoomin "alias activezoom \"wait; activezoom\""
>alias +zoomout "alias activezoom \"zoomout; wait; activezoom\""
>alias -zoomout "alias activezoom \"wait; activezoom\""
>bind m +zoomin
>bind n +zoomout
>activezoom
Hold M to zoom in. Hold N to zoom out.
Oh lord I have too much free time.
>alias activezoom "wait; activezoom"
>alias +zoomin "alias activezoom \"zoomin; wait; activezoom\""
>alias -zoomin "alias activezoom \"wait; activezoom\""
>alias +zoomout "alias activezoom \"zoomout; wait; activezoom\""
>alias -zoomout "alias activezoom \"wait; activezoom\""
>bind m +zoomin
>bind n +zoomout
>activezoom
Hold M to zoom in. Hold N to zoom out.
Oh lord I have too much free time.
-
- Posts: 272
- Joined: Tue Jul 15, 2003 5:48 pm
- Location: Chesterfield, Missouri
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
-
- Posts: 28
- Joined: Wed Jul 16, 2003 3:12 am
- Location: Edinburgh/Dundee, Scotland
-
- Posts: 272
- Joined: Tue Jul 15, 2003 5:48 pm
- Location: Chesterfield, Missouri
-
- Posts: 60
- Joined: Sun Jul 20, 2003 6:35 pm
I did figure a way to simulate a key that increases the fov value using rather brutal tactics...
Code: Select all
[Doom.ConsoleAliases]
Name=zoom4
Command=FOV 90;R_DRAWPLAYERSPRITES 1;bind c zoom;echo "ZOOM DISABLED"
Name=zoomoff
Command=FOV 90;R_DRAWPLAYERSPRITES 1;bind c zoom;ECHO "ZOOM DISABLED"
Name=zoom
Command=FOV 68;R_DRAWPLAYERSPRITES 0;bind c zoom2;echo "ZOOM 125%"
Name=zoom3
Command=FOV 23;R_DRAWPLAYERSPRITES 0;bind c zoom5;echo "ZOOM 175%"
Name=zoom2
Command=FOV 45;R_DRAWPLAYERSPRITES 0;bind c zoom3;echo "ZOOM 150%"
Name=zoom5
Command=FOV 0;R_DRAWPLAYERSPRITES 0;bind c zoom4;echo "ZOOM 200%"
[Doom.Bindings]
x=zoomoff
c=zoom
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
Zell has not yet started a thread that didn't have to do with ZDoom.Mighty Duck X-treme wrote:Wonderful, go tell that to Zell as wellzarcyb wrote:Coming from the ZDoom forum spammer.
Zell has not made a complete ass of himself in nearly every post he's made.
Zell is not a blatant forum troll.
Seriously, why don't you go find somewhere else to post your useless blather? It's getting to the point where I just skip to the next post whenever I see your avatar.
Some people are a complete waste of oxygen.
-
-
- Posts: 10772
- Joined: Sun Jul 20, 2003 12:15 pm
ROFL! It's gotten to the point where you two fight so much that it's stupid. So stupid, it's funny. Heck, Hotwax made my day when I looked at that post in which he said "Open mouth, insert foot". The war that is going on between you two is so hilariously stupid. I don't mean that in a bad way, you two really add life to these forums! 

-
- Posts: 513
- Joined: Wed Jul 16, 2003 3:36 am
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
"gotten to the point"? The first post I made that was addressed to him was done last night. You talk as if we've been going on long enough that historians already refer to it as World War 3.Xaser wrote:ROFL! It's gotten to the point where you two fight so much that it's stupid. So stupid, it's funny. Heck, Hotwax made my day when I looked at that post in which he said "Open mouth, insert foot". The war that is going on between you two is so hilariously stupid. I don't mean that in a bad way, you two really add life to these forums!
That is an opinion that I do not share.Sphagne wrote:Comeon, he has become a lot better than when he first started, we shall wait and see if he keeps getting better or not.
-
- Posts: 272
- Joined: Tue Jul 15, 2003 5:48 pm
- Location: Chesterfield, Missouri