GetUserVariable reports incorrect value
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
GetUserVariable reports incorrect value
GetUserVariable is returning false positives. Freshly-initialized variables should be zero, and checking it in DECORATE verifies this. But GetUserVariable is producing values that are very much not zero.
- Attachments
-
uservartest.wad- (641 Bytes) Downloaded 30 times
- GFD
- Posts: 347
- Joined: Mon May 31, 2010 7:42 pm
- Preferred Pronouns: He/Him
- Location: Canada
- Contact:
Re: GetUserVariable reports incorrect value
There appear to be further issues interacting with user variables from ACS. Calling SetUserVariable from ACS always seems to make ZDoom vanish.
This example has an ACS script that constantly logs the value of an uninitialized user variable on the player. If you press fire, the script sets it to 1. The correct value does get logged and displayed on the screen, and you can hear the monsters that are alerted, but it crashes immediately afterwards.
This example has an ACS script that constantly logs the value of an uninitialized user variable on the player. If you press fire, the script sets it to 1. The correct value does get logged and displayed on the screen, and you can hear the monsters that are alerted, but it crashes immediately afterwards.
- Attachments
-
setuservarexample.pk3- (1.27 KiB) Downloaded 28 times
- Major Cooke
- Posts: 8215
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: GetUserVariable reports incorrect value
Actually the ACS might be another bug entirely. http://forum.zdoom.org/viewtopic.php?f=2&t=50731
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: GetUserVariable reports incorrect value
Strangely I have not experienced that bug.
- Major Cooke
- Posts: 8215
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: GetUserVariable reports incorrect value
There might be the issue of ACS returning a non-initialized variable as well, one so far out that it may be causing the crash. At this point, though, I'm speculating.
- Ed the Bat
- Posts: 3060
- Joined: Thu May 03, 2012 1:18 pm
- Graphics Processor: nVidia with Vulkan support
- Location: Maryland, US
- Contact:
Re: GetUserVariable reports incorrect value
All I can say for sure is that the user variable does indeed hold the correct value. A_JumpIf confirmed my example's variable to be zero, as expected. But GetUserVariable(); keeps returning some other value.

