Page 1 of 1

[SOLVED] What's the catch with GetCVarString?

Posted: Tue Aug 19, 2014 4:34 pm
by Konda
EDIT: Turns out Zandronum doesn't support GetCVarString yet :(
However, even with that I still did manage to get some string to be read from GetCVarString via the compiler I use on linux. If I play around with it enough, I may be able to replicate the unsupported feature's behavior....
Original post:

If a user-defined cvar is a string, I should use GetCVarString to retrieve its value, right? I tried that with this script:

Code: Select all

script 781 (void)
{
  print(s:GetCVarString("testtt"));
}
Spoiler: result (Open)
Image

After that I tried using this code:

Code: Select all

script 781 (void)
{
  ConsoleCommand("set testtt hi");
  print(s:GetCVarString("testtt"));
}
Spoiler: result (Open)
Image
So, how does this work? Can you guys try these scripts and see if it works? Maybe something's up with my compiler but I doubt it...

RE: What's the catch with GetCVarString?

Posted: Tue Aug 19, 2014 5:09 pm
by Monsterovich
GetCVarString and SetCVarString are 2.7.1 :cry: , but incoming in zan 1.3, right?

RE: What's the catch with GetCVarString?

Posted: Tue Aug 19, 2014 5:35 pm
by Konda
It doesn't say on the wiki that GetCVarString is 2.7.1+, it only says that for SetCvar/SetCVarString. I tried to compile my script using SetCVarString just to see if my compiler would complain, and surprisingly it compiled, which means either something may be up with my compiler, or GetCVarString is also not currently supported by Zandronum but it compiles for me because obviously I'm using a compiler that supports the new zdoom features. I am using Linux ATM so I downloaded acc from the zdoom website and compiled it from source, since on the zandronum wiki you're only given an archive with an exe file.

RE: What's the catch with GetCVarString?

Posted: Tue Aug 19, 2014 5:58 pm
by XutaWoo
Looks to be more weirdness with ConsoleCommand, honestly. Probably due to the fact that you can't use quotation marks within the ConsoleCommand'd command, so it's confusing the console and both reading the entirety of the string as a command as what to set the CVar to.

Best bet would, unfortunately, probably be just waiting for the SetCVar stuff.

RE: What's the catch with GetCVarString?

Posted: Tue Aug 19, 2014 5:59 pm
by Konda
I just booted into windows to use GZDoom Builder's Skulltag acc compiler with updated zspecial.acs to support new zandronum features:

Image
Seriously? :|
XutaWoo wrote: Looks to be more weirdness with ConsoleCommand, honestly. Probably due to the fact that you can't use quotation marks within the ConsoleCommand'd command, so it's confusing the console and both reading the entirety of the string as a command as what to set the CVar to.
Actually, you can use quotation marks within the ConsoleCommand if they are preceded with a backslash.

Code: Select all

ConsoleCommand("say \"hi\"");

RE: [SOLVED] What's the catch with GetCVarString?

Posted: Wed Aug 20, 2014 6:18 am
by ZzZombo
"Ported CVARINFO lump support and the ACS functions SetCVar, GetCVarString and SetCVarString from ZDoom. This includes support for CVars that are automatically synced between server and clients. User CVars are not support for now though. [Torr Samaho]".

Unless you're using not a developer build, you should be able to use the function.