Using version zdoom-2.8pre-526-g004cf57
Took a while to work out what it was exactly. But it seems that if a script from a library (in my case a script launched from a library ENTER script) tries to read a user cvar when a map has a BEHAVIOR lump it fails and returns 0. Maps without BEHAVIOR read the cvar correctly.
I don't have a simpler example right now, but this is a packaged version of Z-Kart with just the relevant maps for the bug in it. Load up the kart testing ground from the new game menu. Third person camera works fine, and the readout shows MaxCameraDistance working just fine. Load up the return to hell cup and you'll see the third person camera working wrong and the MaxCameraDistance readout showing 0.
EDIT: As Edward points out below, the problem is nothing to do with cvars.
#define "string" broken in libraries
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.
#define "string" broken in libraries
- Attachments
-
usercvarbug.pk3- It's broked!
- (253 KiB) Downloaded 37 times
Last edited by GooberMan on Sun Jul 20, 2014 11:56 pm, edited 1 time in total.
Re: User cvars not being read under certain circumstances
Well hang on, I'm sure I have played DoomRPG with maps that have scripts before, and that has copious amounts of User CVar checks. Something doesn't seem right about this.
Re: User cvars not being read under certain circumstances
Yeah, it's only my script that's compiled in the kartphysics library. Does Doom RPG do user cvar checks from library scripts launched from a library ENTER script?
Re: User cvars not being read under certain circumstances
I'll have to check. I'll run through some test tomorrow and see what I come up with.
Re: User cvars not being read under certain circumstances
This isn't a bug with usercvars, but rather one with the ACSVM itself, it seems. Your defined string constants are being destroyed when loaded on top of another script, which means all getcvar is seeing is a NULL string. If you use "cl_camdist" manually instead of CVAR_CAMERADISTANCE, everything works as expected. Can't really say why this is happening, though.
Re: #define "string" broken in libraries
Alright, updated the topic to match this new information.
-
Blzut3
-

- Posts: 3215
- Joined: Wed Nov 24, 2004 12:59 pm
- Operating System Version (Optional): Kubuntu
- Graphics Processor: ATI/AMD with Vulkan/Metal Support
- Contact:
Re: #define "string" broken in libraries
Off hand, I'm thinking this is going to be "Switch to DH-acc" where you have a real preprocessor.