Inside3D!
     

Set Command with DarkPlaces

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Wed May 09, 2007 8:11 pm    Post subject: Set Command with DarkPlaces Reply with quote

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.

Quote:
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:

Quote:
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?
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Mon May 14, 2007 7:55 pm    Post subject: Reply with quote

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:

Quote:
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-"
Back to top
View user's profile Send private message
Gilgamesh



Joined: 26 Oct 2004
Posts: 67
Location: Brazil

PostPosted: Tue May 15, 2007 5:12 pm    Post subject: Reply with quote

Thanks for the info! Smile
_________________
#EOP
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group