Forum

Set Command with DarkPlaces

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Set Command with DarkPlaces

Postby Baker » Wed May 09, 2007 8:11 pm

I made a superzoom alias in DarkPlaces that restores the FOV and sensitivity to whatever value was being used prior to using it.

You just do the old ...

bind mouse3 +superzoom

... and it works fine.

alias +superzoom "set scratch1 $fov; set scratch2 $sensitivity; fov 70; sensitivity 4; wait; fov 58; sensitivity 3.25; wait; fov 45; sensitivity 2.50; wait; fov 32; sensitivity 1.74; wait; fov 20; sensitivity 14.0"

alias -superzoom "fov 32; sensitivity 1.75; wait; fov 45; sensitivity 2.50; wait; fov 58; sensitivity 3.25; wait; sensitivity 4; wait; set sensitivity $scratch2; set fov $scratch1"


However, I get an onscreen messages saying this:

7Warning: could not find cvar fov; when expanding alias +superzoom
set scratch1 $fov; set scratch2 $sensitivity; fov 70; sensitivity 4; wait;
fov 58; sensitivity 3.25; wait; fov 45; sensitivity 2.50; wait; fov 32;
sensitivity 1.74; wait; fov 20; sensitivity 14.0

Warning: could not find cvar sensitivity; when expanding alias +superzoom
set scratch1 $fov; set scratch2 $sensitivity; fov 70; sensitivity 4; wait;
fov 58; sensitivity 3.25; wait; fov 45; sensitivity 2.50; wait; fov 32;
sensitivity 1.74; wait; fov 20; sensitivity 14.0

Warning: could not find cvar scratch2; when expanding alias -superzoom
fov 32; sensitivity 1.75; wait; fov 45; sensitivity 2.50; wait; fov 58;
sensitivity 3.25; wait; sensitivity 4; wait; set sensitivity $scratch2; set fov
$scratch1

Warning: could not find cvar scratch2; when expanding alias -superzoom
fov 32; sensitivity 1.75; wait; fov 45; sensitivity 2.50; wait; fov 58;
sensitivity 3.25; wait; sensitivity 4; wait; set sensitivity $scratch2; set fov
$scratch1


Any ideas on why the script would work fine, but I get these warning messages?
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Baker » Mon May 14, 2007 7:55 pm

After doing everything to try to figure this out myself, I ended up asking LordHavoc and the answer was that a space needs to follow the cvars in the SET statements otherwise it thinks I'm trying to use "fov;" as a cvar.

The following works fine:

alias +superzoom "set fov- $fov ; set sensitivity- $sensitivity ; fov 70; sensitivity 4; wait; fov 58; sensitivity 3.25; wait; fov 45; sensitivity 2.50; wait; fov 32; sensitivity 1.74; wait; fov 20; sensitivity 14.0"
alias -superzoom "fov 32; sensitivity 1.75; wait; fov 45; sensitivity 2.50; wait; fov 58; sensitivity 3.25; wait; sensitivity 4; wait; set sensitivity $sensitivity- ; set fov $fov-"
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Gilgamesh » Tue May 15, 2007 5:12 pm

Thanks for the info! :)
#EOP
Gilgamesh
 
Posts: 67
Joined: Tue Oct 26, 2004 6:08 pm
Location: Brazil


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest