Urban Terror Forums: Quotation marks scope when defining a cvar - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Quotation marks scope when defining a cvar Rate Topic: -----

"

#1 User is offline   ETRNL-JG Icon

  • Account: etrnljg
  • Main tag: [FAOD]
  • Country:
  • Joined: 25-June 10
  • Posts: 4

Posted 12 April 2016 - 11:05 AM

I wanted to update/clean a bit my config that is now about 3 years old but I run into a problem.
I'm a bit surprised by the scope of the quotation marks.

Indeed, it looks like
set set_default_mouse1    bind MOUSE1 "+attack; +vstr low_sensi high_sensi"

has the same behavior of
set set_default_mouse1    "bind MOUSE1 +attack; +vstr low_sensi high_sensi"


The error I got on the console says that "+vstr" is called outside of a key-press/release, which means it is called with as a second instruction of the "set".
Do you see any way to enforce the expected behavior?

#2 User is online   Iye Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: iye
  • Country:
  • Joined: 07-June 11
  • Posts: 1,054

Posted 12 April 2016 - 03:02 PM

I think it is not possible to do a multi action bind within a cvar.
Basically because you can not nest quotation marks. iirc it will always expect them to start after the 1st argument of the 1st set or bind.

Scematic workaround, with quite a dangerous combination of +vstr and +attack
set set_default_mouse1 "bind MOUSE1 +vstr low_sensi high_sensi";
set low_sensi "+attack;sensitivity [low]";
set high_sensi "-attack;sensitivity [high]";



Note the -attack, which is required because +attack isnt in the arguments of bind anymore and therefor -attack isnt automatically called.

Also note that i wouldnt use +vstr combined with +action's. It might happen that e.g. your fps vary and then you release mouse1 and it keeps spraying.
Even though in this case you could just fire again and it should stop once you release mouse1.....

This post has been edited by Iye: 12 April 2016 - 03:06 PM

Sorry for my bad spelling - I am still asleep. :)

|=| Iye's UrT Addon |=| Firefox Personas |=| Maps |=|
http://www.mediafire...vk3a602hcfg.jpg

#3 User is online   Iye Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: iye
  • Country:
  • Joined: 07-June 11
  • Posts: 1,054

Posted 12 April 2016 - 04:37 PM

i just considered that one could probably move the binds into a separate config, which might allow bind MOUSE1 "+attack;+vtsr A B"; to work.
Sorry for my bad spelling - I am still asleep. :)

|=| Iye's UrT Addon |=| Firefox Personas |=| Maps |=|
http://www.mediafire...vk3a602hcfg.jpg

#4 User is offline   ETRNL-JG Icon

  • Account: etrnljg
  • Main tag: [FAOD]
  • Country:
  • Joined: 25-June 10
  • Posts: 4

Posted 12 April 2016 - 05:44 PM

I'm trying to get the behavior I'm describing to keep my config clear.
I already have working scripts that change depending which other key is pressed. The idea behind my update was to centralize at some place the behavior of a key, instead of duplicating it everywhere every time I'm changing it.

You're only taking my changes back to my existing config :/

This post has been edited by ETRNL-JG: 12 April 2016 - 05:46 PM


#5 User is online   Iye Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: iye
  • Country:
  • Joined: 07-June 11
  • Posts: 1,054

Posted 12 April 2016 - 06:47 PM

i assumed as much :P
i did A LOT of scripting back in the day. (1st link in my signature)

"sad" but true story is that you probably wont have any other choice in this case
Sorry for my bad spelling - I am still asleep. :)

|=| Iye's UrT Addon |=| Firefox Personas |=| Maps |=|
http://www.mediafire...vk3a602hcfg.jpg

bullet_loaderAdvertisement
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Advertisement


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942