Urban Terror Forums: Saving custom variable in q3config? - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

Saving custom variable in q3config? Rate Topic: -----

#1 User is offline   UpiornyOdkurzacz Icon

Posted 29 December 2012 - 11:43 PM

Hello.

Is there any way to save a value of custom variable to be present after restarting whole game?
As "custom variable" I mean things like:

set TeddyBear "ut_echo I like them :)"

And now I want to restart the game and after typing
vstr TeddyBear

get "ut_echo" action (it's just an example!).

Is there any way to do this? It's very important for me, so I would be thankful if you help me.

PS. Please don't tell me about autoexec or this kind of things. I know about it, and it's not what I'm asking for :)

This post has been edited by UpiornyOdkurzacz: 29 December 2012 - 11:45 PM


#2 User is offline   ObScUrE Icon

  •   head moderator   
    Co-Chief Community Moderator
  • Account: obscure
  • Country:
  • Joined: 28-February 10
  • Posts: 2,192

Posted 30 December 2012 - 08:31 AM

Quote

PS. Please don't tell me about autoexec or this kind of things. I know about it, and it's not what I'm asking for :)

That's how it usually works.

Copy the first line to your autoexec,

type /vstr TeddyBear in console and you can read the message in the upper left corner between the death messages.


To make it easier you can bind the command to a specific key:

bind T "ut_echo I like them :)"

-
or when you have it already defined:

bind T "vstr Teddybear"

Quote

BenQ-XL2420T|Filco-Ninja-TKL-MXRed|Logitech-G403|AKG-K70201000010 01101100 01110101 01110100 01010010 01100001 01110101 00100100 01100011 01101000~The quieter you become, the more you are able to hear.~

#3 User is offline   don Icon

  • Account: don
  • Main tag: GlaD-
  • Joined: 28-February 10
  • Posts: 2,640

Posted 30 December 2012 - 09:18 AM

use seta instead of set.

seta should permanently place it into your q3config, whereas set just lasts for the session.

theoretically, anyway. the best solution is to not rely on q3config to save anything, but instead use autoexec (and, if wanted, other .cfg files to keep things tidy).
GlaD-don
Past teams:
Partners in Terror | The Dark | Team Terror | Noobs Gone Wild | Xor | Blight Gaming | Area 51 Gaming | Team Lzuruha | Besserman6 | Console | No Care Bears | Zing | Pro5 | American Idols | Team Canada | No Defiance | Unlimited Gaming
<3 to the people who built and sustained the North American competitive community over the years. xil, r, vex, icu, bos, .e, '`|v|~, iF, -x-, ill, un, xor, glad & all the rest. thanks for the games

#4 User is offline   UpiornyOdkurzacz Icon

Posted 31 December 2012 - 09:43 AM

Quote

That's how it usually works.

Copy the first line to your autoexec,

type /vstr TeddyBear in console and you can read the message in the upper left corner between the death messages.


To make it easier you can bind the command to a specific key:

bind T "ut_echo I like them :)"


Come on... I said "please don't tell me about autoexec" :(

You don't understand. For example, what if I set my Teddy Bear to say "I like them :)" in autoexec file, and then I change it to "I love them :))" in game? After resetting, it will still say that I only like them, but you know that I love them!
I need to save it dynamically.

And really, you don't need to explain me how binding works :D

Quote

use seta instead of set.

seta should permanently place it into your q3config, whereas set just lasts for the session.


Yeah, I see that you know what I was talking about. Well, it looks like a good idea, but I tried it before creating this topic. "seta" command works only for CVARs! It doesn't work for custom variables...

Is there any other way to do this? There must be something...

#5 User is offline   n1n Icon

  •   verified user   
  • Account: n1n
  • Joined: 28-February 10
  • Posts: 453

Posted 31 December 2012 - 03:47 PM

any chance you might tell us the big secret of the practical use of this, because liking teddy bears doesn't sound convincing anyone ;)

else just get used to autoexec or use custom config files (and exec them from autoexec), like one where you'd keep all cvars and keeping it up to date from outside the game seems not to be any issue, quite the opposite, you can't handle text code from the console as well as you would do from a text editor.
<sXe>

bullet_loaderAdvertisement

#6 User is offline   YAY5637 Icon

  • Account: yay5637
  • Main tag: <PWC>
  • Country:
  • Joined: 28-February 10
  • Posts: 633

Posted 31 December 2012 - 07:39 PM

I think what you could do is define it in your autoexec and change it from ingame?

#7 User is offline   UpiornyOdkurzacz Icon

Posted 01 January 2013 - 09:17 PM

View Postn1n, on 31 December 2012 - 03:47 PM, said:

any chance you might tell us the big secret of the practical use of this, because liking teddy bears doesn't sound convincing anyone ;)

else just get used to autoexec or use custom config files (and exec them from autoexec), like one where you'd keep all cvars and keeping it up to date from outside the game seems not to be any issue, quite the opposite, you can't handle text code from the console as well as you would do from a text editor.


I do not really know what you are doing in QA Team. Your incompetence is alarming.

I do not have to tell you why I need it. I do not have time to explain this whole thing, and you do not have time to read it. It just doesn't matter, because you know the point. Or hmmm. Nope. YOU don't know. And now I am thinking... why did you even write anything here? I said it two times, that I do not want you to explain me how autoexec works.
But I will do that one more time.

Well, it's not like I don't want to use autoexec, because I don't want to be mainstream or something. You do not understand what I want to do.

I set my variable to any value. Lets say it's "1", because I realized, that teddy bears sound bad for you.
So I set it to "1" in this way:

Quote

set Variable "echo 1"

Now I launch the game, get to the console, and type:

Quote

set Variable "echo 2"

Then I turn off my game and launch it one more time. I type in a console:

Quote

vstr Variable

And guess what I get. Yes! It's "1"!

But I would rather like to get "2". Now you get it?

#8 User is offline   don Icon

  • Account: don
  • Main tag: GlaD-
  • Joined: 28-February 10
  • Posts: 2,640

Posted 01 January 2013 - 11:57 PM

View PostUpiornyOdkurzacz, on 01 January 2013 - 09:17 PM, said:

I do not really know what you are doing in QA Team. Your incompetence is alarming.



QA team is chosen for their ability to...well you can figure it out I think.




Your example worked for me.
I did the following:

/seta abc "echo 3"

/vstr abc
output: 3

/seta abc "echo 4"

/vstr abc
output: 4

/quit

Launch urt again

/vstr abc
output: 4



Tried it a few times. Works for me. I'm not sure if what you're trying to do is more complex, and thus runs into problems, but yeah the above worked for me.
Even worked with set after I made the initial variable "abc" using seta. Would you mind PMing me the exact variables you are using? I have another idea that might work as well that doesn't involve config files.
GlaD-don
Past teams:
Partners in Terror | The Dark | Team Terror | Noobs Gone Wild | Xor | Blight Gaming | Area 51 Gaming | Team Lzuruha | Besserman6 | Console | No Care Bears | Zing | Pro5 | American Idols | Team Canada | No Defiance | Unlimited Gaming
<3 to the people who built and sustained the North American competitive community over the years. xil, r, vex, icu, bos, .e, '`|v|~, iF, -x-, ill, un, xor, glad & all the rest. thanks for the games

#9 User is offline   UpiornyOdkurzacz Icon

Posted 02 January 2013 - 12:28 AM

View Postdon, on 01 January 2013 - 11:57 PM, said:

Tried it a few times. Works for me. I'm not sure if what you're trying to do is more complex, and thus runs into problems, but yeah the above worked for me.
Even worked with set after I made the initial variable "abc" using seta. Would you mind PMing me the exact variables you are using? I have another idea that might work as well that doesn't involve config files.


It doesn't work for me!
But I guess you are testing it on UrT 4.2 right?

Interesting...

#10 User is offline   don Icon

  • Account: don
  • Main tag: GlaD-
  • Joined: 28-February 10
  • Posts: 2,640

Posted 02 January 2013 - 02:28 AM

ew no. I don't have/play 4.2.


I am using the a client that I compiled from a codebase dating back to October 2007. It should be virtually identical to the .exe included with the 4.1 download. I modified nothing except to make cl_guid non-readonly (irritating getting GUID banned). The source code from Urban Terror's Github page is buggy and crashes when I try to open the menu.. If you're using something compiled from that code or any of these new builds, try the client included with the 4.1 download. If you're using that client, try deleting q3config so q3 generates a new one. Might just be a value hanging around in there interfering...who knows.

You on Windows? The code has a lot of "if on such and such OS, do something totally different" areas.
GlaD-don
Past teams:
Partners in Terror | The Dark | Team Terror | Noobs Gone Wild | Xor | Blight Gaming | Area 51 Gaming | Team Lzuruha | Besserman6 | Console | No Care Bears | Zing | Pro5 | American Idols | Team Canada | No Defiance | Unlimited Gaming
<3 to the people who built and sustained the North American competitive community over the years. xil, r, vex, icu, bos, .e, '`|v|~, iF, -x-, ill, un, xor, glad & all the rest. thanks for the games

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • This topic is locked

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