[SOLVED] What's the catch with GetCVarString?

Discuss all aspects related to modding Zandronum here.
Post Reply
Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

[SOLVED] What's the catch with GetCVarString?

#1

Post by Konda » Tue Aug 19, 2014 4:34 pm

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...
Last edited by Konda on Tue Aug 19, 2014 6:11 pm, edited 1 time in total.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

User avatar
Monsterovich
Forum Regular
Posts: 343
Joined: Sun Jun 17, 2012 5:46 pm

RE: What's the catch with GetCVarString?

#2

Post by Monsterovich » Tue Aug 19, 2014 5:09 pm

GetCVarString and SetCVarString are 2.7.1 :cry: , but incoming in zan 1.3, right?
Last edited by Monsterovich on Tue Aug 19, 2014 5:15 pm, edited 1 time in total.

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

RE: What's the catch with GetCVarString?

#3

Post by Konda » Tue Aug 19, 2014 5:35 pm

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.
Last edited by Konda on Tue Aug 19, 2014 5:35 pm, edited 1 time in total.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

XutaWoo
Forum Regular
Posts: 113
Joined: Mon Jun 04, 2012 7:04 am

RE: What's the catch with GetCVarString?

#4

Post by XutaWoo » Tue Aug 19, 2014 5:58 pm

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.
[spoiler]Image[/spoiler]
Image

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

RE: What's the catch with GetCVarString?

#5

Post by Konda » Tue Aug 19, 2014 5:59 pm

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\"");
Last edited by Konda on Tue Aug 19, 2014 6:02 pm, edited 1 time in total.

Code: Select all

<Synert> fuck
<Synert> plugged in my memory stick and got a bsod

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

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

#6

Post by ZzZombo » Wed Aug 20, 2014 6:18 am

"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.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

Post Reply