Urban Terror Forums: Ability to echo variables from the console or config - 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

Ability to echo variables from the console or config Rate Topic: -----

#1 User is offline   KroniK Icon

  •   QA member   
  • Account: kronik
  • Country:
  • Joined: 14-January 11
  • Posts: 305

Posted 07 February 2015 - 11:08 AM

One thing that I wish I could do is use ut_echo to echo variables which I have created. For example, lets say I create a variable with the current mouse sensitivity, and then I want to display that later, I would like to be able to simply use the ut_echo to display that. Currently the ut_echo only displays exactly what is in the quotes that follow it.

I guess I'm looking for a bit more of a comparable command to the linux echo command.

#2 User is offline   Clear Icon

  •   former FS member   
    Programmer
  • Account: clear
  • Main tag: 6th|
  • Country:
  • Joined: 16-August 11
  • Posts: 121

Posted 13 February 2015 - 03:18 AM

Added. Just for you, KroniK <3

Use $cvar to get a cvar's value.

#3 User is offline   Iye Icon

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

Posted 13 February 2015 - 11:41 AM

<3 <3. Now just add those coditional commands and i might as well get back to scripting again. ;)
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   KroniK Icon

  •   QA member   
  • Account: kronik
  • Country:
  • Joined: 14-January 11
  • Posts: 305

Posted 27 February 2015 - 02:27 AM

So just to be Clear (pun intended) how would I go about echoing a variable?

lets say I use "set var1 potato" Then to echo the word "potato" I would use ut_echo "$var1"? or would it be ut_echo "$cvar var1"

Also, you are the best!!! This is going to make my config so much nicer! Also, conditional commands would be a dream come true... but I expect that to remain a dream.

This post has been edited by KroniK: 27 February 2015 - 02:29 AM


#5 User is offline   Clear Icon

  •   former FS member   
    Programmer
  • Account: clear
  • Main tag: 6th|
  • Country:
  • Joined: 16-August 11
  • Posts: 121

Posted 28 February 2015 - 05:07 PM

You'd do something like ut_echo Sensitivity: $sensitivity

bullet_loaderAdvertisement

#6 User is offline   Iye Icon

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

Posted 01 March 2015 - 12:46 AM

does this work for default cvars or also for custom ones (set foo "bar;"; echo "$foo") ?
Sorry for my bad spelling - I am still asleep. :)

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

#7 User is offline   karnute Icon

  •   community dev   
  • Account: karnute
  • Joined: 09-August 11
  • Posts: 157

Posted 01 March 2015 - 01:13 PM

View PostIye, on 01 March 2015 - 12:46 AM, said:

does this work for default cvars or also for custom ones (set foo "bar;"; echo "$foo") ?

Also, could it be possible to use value in composing other command or value, besides "echo"?
set foo "bar";  set baz "something $foo"; vstr baz


#8 User is offline   Clear Icon

  •   former FS member   
    Programmer
  • Account: clear
  • Main tag: 6th|
  • Country:
  • Joined: 16-August 11
  • Posts: 121

Posted 02 March 2015 - 02:59 AM

View PostIye, on 01 March 2015 - 12:46 AM, said:

does this work for default cvars or also for custom ones (set foo "bar;"; echo "$foo") ?

It'll work for both

View Postkarnute, on 01 March 2015 - 01:13 PM, said:

Also, could it be possible to use value in composing other command or value, besides "echo"?
set foo "bar";  set baz "something $foo"; vstr baz


That's possible, yes, but I'd rather not do it globally. Maybe just for echo and set

#9 User is offline   Iye Icon

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

Posted 02 March 2015 - 11:30 AM

Quote

That's possible, yes, but I'd rather not do it globally.


o.0 even more awesomeness! yay! :blink: :rolleyes: :biggrin:
Sorry for my bad spelling - I am still asleep. :)

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

#10 User is offline   karnute Icon

  •   community dev   
  • Account: karnute
  • Joined: 09-August 11
  • Posts: 157

Posted 02 March 2015 - 11:32 AM

View PostClear, on 02 March 2015 - 02:59 AM, said:

That's possible, yes, but I'd rather not do it globally. Maybe just for echo and set

Just in "set" (and "seta"?) would be enought, as you can compose the command inside set and launch it with vstr, that is safer.
But it could be usefull also for fixed binds with: echo, ut_echo, say, say_team, ut_radio, tell and tell_target.
In any case, thanks for your good work; it is a nice feature.

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