Problem with new cvar parsing in svn

If you've had any problems with Nexuiz, or would like to report bugs, post here.

Moderators: Nexuiz Moderators, Moderators

Sat Jul 14, 2007 5:38 am

  • As of svn r7466/7467, the following binds that I have no longer work properly. The toggle is fine, but displaying the value of the cvar is problematic. If I paste the binds below into config.cfg, they work as expected -- but only the first time I launch Nexuiz. The $$r_novis becomes $r_novis after the first run, then it becomes the last value for that cvar after the second. I also tried ${$r_novis} without success: Nexuiz displays "Could not expand $$r_novis".

    bind h "toggle r_shadow_realtime_world; echo Realtime World Lighting: $$r_shadow_realtime_world"
    bind j "toggle r_novis; echo r_noVis: $$r_novis"
    animus
    Member
     
    Posts: 17
    Joined: Sat Jul 07, 2007 8:24 pm
    Location: Michigan

Sat Jul 14, 2007 7:30 am

  • Yes, LordHavoc wanted alias to have a special exception that no cvar expansion takes place in its arguments - then the same should go for bind and in_bind, IMHO.

    Code: Select all
    set x 3

    bind FOO "echo $x"
    // will echo the value of $x when FOO is pressed

    "bind" FOO "echo $x"
    // will echo 3 when FOO is pressed


    Done.

    Also, backslashes and quotes are now saved correctly.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sat Jul 14, 2007 8:38 am

  • divVerent wrote:Yes, LordHavoc wanted alias to have a special exception that no cvar expansion takes place in its arguments - then the same should go for bind and in_bind, IMHO.

    Code: Select all
    set x 3

    bind FOO "echo $x"
    // will echo the value of $x when FOO is pressed

    "bind" FOO "echo $x"
    // will echo 3 when FOO is pressed


    Done.

    Also, backslashes and quotes are now saved correctly.

    So, do backslashes work for quotes only, or can I use
    "bind" FOO "echo \$x"
    to work like
    bind FOO "echo $x"
    User avatar
    Blµb
    Alien trapper
     
    Posts: 277
    Joined: Thu Mar 29, 2007 1:49 pm

Sat Jul 14, 2007 10:26 pm

  • Alright, these now work as expected. Thanks. :)

    bind h "toggle r_shadow_realtime_world; echo Realtime World Lighting: $r_shadow_realtime_world"
    bind j "toggle r_novis; echo r_noVis: $r_novis"
    animus
    Member
     
    Posts: 17
    Joined: Sat Jul 07, 2007 8:24 pm
    Location: Michigan

Sun Jul 15, 2007 9:11 am

  • Backslash doesn't quote $, but $ does: $$ is a quoted $.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Tue Jul 17, 2007 9:30 am

  • then there's no way to have
    bind x display_var "echo $$varname"

    display the var defined in varname? so I toggle through a bunch of varnames, setting $varname to their name, and have $$varname display it?
    like
    set varname fov;
    then x displays fov?

    :P
    User avatar
    Blµb
    Alien trapper
     
    Posts: 277
    Joined: Thu Mar 29, 2007 1:49 pm

Tue Jul 17, 2007 6:45 pm

  • bind x "echo ${$varname}"

    Indirection, which previously was possible unintendedly in alias+cvar expansion (because they were two separate steps), was reintroduced as an intentional feature.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sat Jan 05, 2008 1:46 am

  • Indirection isn't working in 2.3 on Macs or in 2.4 on Linux. Here's an example:
    set x 1
    set i x
    echo ${$i}

    Outputs:
    Warning: could not find cvar {$i}
    Warning: could not find cvar i}

    It works correctly in 2.3 on Linux. Didn't get it tested on Windows.
    ------------------------------------------------

    Here's another parsing error WinstonSmith pointed out on IRC:
    // blah ; echo "this shouldn't print"

    Outputs:
    this shouldn't print

    There is a workaround for this one:
    // "blah ; echo "this shouldn't print""

    no output since the ; is within quotes
    So much to do, so little time to do it
    User avatar
    AceOfThumbs
    Alien
     
    Posts: 158
    Joined: Tue Sep 04, 2007 11:12 pm

Sat Jan 05, 2008 8:17 am

  • Indirection works very fine here. You must be using an old engine build.

    set x 1
    set i x
    echo ${$i}
    1
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sun Jan 06, 2008 12:38 am

  • I'm using the May 30, 2007 2.3 release for Mac. I don't have Linux, but WinstonSmith on IRC said he tested the 2.3 release on Linux and it worked, but on the 2.4 SVN it didn't.
    So much to do, so little time to do it
    User avatar
    AceOfThumbs
    Alien
     
    Posts: 158
    Joined: Tue Sep 04, 2007 11:12 pm

Sun Jan 06, 2008 6:19 am

  • It did not work like that in 2.3, and in my 2.4 svn it works just fine. You may be using 2.4 svn with a 2.3 engine.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sun Jan 06, 2008 11:02 am

  • AceOfThumbs wrote:I'm using the May 30, 2007 2.3 release for Mac. I don't have Linux, but WinstonSmith on IRC said he tested the 2.3 release on Linux and it worked, but on the 2.4 SVN it didn't.
    I may have confused you :D

    I tried 2.3 and 2008-01-02c build on Kubuntu.

    Kubuntu, regular 2.3 (patched with Blub's name completion)
    Code: Select all
    set x qwer
    set i x
    echo ${$i}
    Warning: could not find cvar {$i}
    Warning: could not find cvar i}
    ${$i}


    Kubuntu, 2008-01-02c build
    Code: Select all
    set w qwer
    set e w
    echo ${$e}
    qwer


    Windows 2000, regular 2.3 (no patches)
    Code: Select all
    set x qwer
    set i x
    echo ${$i}
    Warning: could not find cvar {$i}
    Warning: could not find cvar i}
    ${$i}

    This indirection bug is present in 2.3, but has been fixed in the SVN version.


    Comments being truncated by a semi-colon is present in all the builds I've tried. :(

    // "blah ; echo "this shouldn't print""
    bind u "wait ; wait" // ; wait ; wait" //make a short delay

    bind o "echo hello" //displays your message; quit

    Winston
    Spaceman
    Alien trapper
     
    Posts: 264
    Joined: Tue Aug 28, 2007 10:53 am

Sun Jan 06, 2008 12:08 pm

  • The indirection "bug" is not a bug - it simply is a new feature in svn builds. There was no indirection in 2.3. And changing // looks complicated... I'd fear to break other stuff when fixing that parsing. Instead, just don't use semicolons in comments...
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE

Sun Jan 06, 2008 10:43 pm

  • divVerent wrote:It did not work like that in 2.3, and in my 2.4 svn it works just fine. You may be using 2.4 svn with a 2.3 engine.


    If 2.3 doesn't have indirection, that explains why it won't work for me since I am using 2.3. :) Sorry for the confusion.

    What do you mean about "2.4 svn with a 2.3 engine"? I did try the 2.4 engine-only download. I copied it to my Nexuiz folder which had 2.3. It works on my one of my older Macs, but not on the new one. So I deleted the 2.4 engine files and copied the 2.3 engine back.
    So much to do, so little time to do it
    User avatar
    AceOfThumbs
    Alien
     
    Posts: 158
    Joined: Tue Sep 04, 2007 11:12 pm

Tue Jan 08, 2008 8:07 am

  • anyone had problems with console and the latest svn ? for xp

    atfer the new font thingy the console disapeart it doesnt render the letters or something when i press tilde
    Urbanshenkie
    Alien
     
    Posts: 145
    Joined: Tue Dec 04, 2007 11:15 am

Tue Jan 08, 2008 10:21 am

  • Known bug and Black fixed it yesterday.
    1. Open Notepad
    2. Paste: ÿþMSMSMS
    3. Save
    4. Open the file in Notepad again

    You can vary the number of "MS", so you can clearly see it's MS which is causing it.
    User avatar
    divVerent
    Site admin and keyboard killer
     
    Posts: 3809
    Joined: Thu Mar 02, 2006 4:46 pm
    Location: BRLOGENSHFEGLE



Return to Nexuiz - Support / Bugs




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest