MantisBT - Zandronum
View Issue Details
0002634Zandronum[All Projects] Bugpublic2016-02-13 16:132017-04-16 07:03
arkore 
 
normalminoralways
closedno change required 
MicrosoftWindowsXP/Vista/7
3.0-beta 
3.0 
0002634: CLIENTSIDE SetMusic() or CVARINFO not working.
When monster is active, music is no longer changing -- either because CLIENTSIDE script problem, or CVAR problem.

Run this .pk3 and type summon TestMan.
When legendary monster is active, new music should be playing. When monster dies, music is reset back to map music.

This is how it's done in the LCA mod, for Complex Doom.

---

This is working in Zan 2.1.
No tags attached.
related to 0003054closed Torr Samaho Using GetCVar clientside with user cvars is broken in 3.0 
? clientside-music.pk3 (79,639) 2016-02-13 16:13
/tracker/file_download.php?file_id=1739&type=bug
? usercvarmusictest.wad (5,849) 2016-11-29 23:32
/tracker/file_download.php?file_id=1975&type=bug
? usercvarmusictest2.wad (6,004) 2016-11-30 05:53
/tracker/file_download.php?file_id=1976&type=bug
Issue History
2016-02-13 16:13arkoreNew Issue
2016-02-13 16:13arkoreFile Added: clientside-music.pk3
2016-03-13 21:14arkoreNote Added: 0014578
2016-03-13 21:16arkoreNote Added: 0014579
2016-11-27 09:50Torr SamahoNote Added: 0016338
2016-11-27 09:51Torr SamahoStatusnew => feedback
2016-11-29 20:35Torr SamahoTarget Version => 3.0
2016-11-29 23:32arkoreFile Added: usercvarmusictest.wad
2016-11-29 23:36arkoreNote Added: 0016391
2016-11-29 23:36arkoreStatusfeedback => new
2016-11-30 05:53arkoreFile Added: usercvarmusictest2.wad
2016-11-30 05:54arkoreNote Added: 0016393
2016-11-30 07:02Torr SamahoNote Added: 0016394
2016-11-30 07:07Torr SamahoStatusnew => feedback
2016-11-30 08:16Edward-sanNote Added: 0016395
2016-11-30 08:44Edward-sanNote Edited: 0016395bug_revision_view_page.php?bugnote_id=16395#r9944
2016-11-30 09:10Edward-sanNote Edited: 0016395bug_revision_view_page.php?bugnote_id=16395#r9945
2016-11-30 20:04Torr SamahoNote Added: 0016403
2016-11-30 20:18arkoreNote Added: 0016404
2016-11-30 20:18arkoreStatusfeedback => new
2016-11-30 20:47Edward-sanNote Added: 0016405
2016-11-30 20:48Edward-sanNote Edited: 0016405bug_revision_view_page.php?bugnote_id=16405#r9953
2017-01-28 05:09StrikerMan780Note Added: 0016704
2017-02-06 19:36DuskStatusnew => closed
2017-02-06 19:36DuskResolutionopen => no change required
2017-04-16 07:03Torr SamahoRelationship addedrelated to 0003054

Notes
(0014578)
arkore   
2016-03-13 21:14   
I somehow got this working, so, please close this ticket.
(0014579)
arkore   
2016-03-13 21:16   
My mistake, I was thinking of something else. This issue is still an issue.
(0016338)
Torr Samaho   
2016-11-27 09:50   
This doesn't seem to be anything client related since it also happens offline. Furthermore, the problem also appears in GZDoom 1.8.6 and the latest GZDoom version for me. So it's either a bug of the wad or a GZDoom bug. Can you confirm this?
(0016391)
arkore   
2016-11-29 23:36   
I can confirm the issue still occurs with latest dev 3.0 build 161030-2038.

It seems this issue primarily a CVAR issue. The Cvar is just not registering properly, or being read properly from GetCvar(). Works fine in Zandronum 2.1.2 though.

I've added usercvarmusictest.wad to this ticket now. It has minimal code, and uses the map SCRIPTS lump for execution. See the CVARINFO, DECORATE, and SCRIPTS lump. Here is pastebin of it:'http://pastebin.com/bUbamTqL [^]'
(0016393)
arkore   
2016-11-30 05:54   
I added usercvarmusictest2.wad now, which correctly executes the non-CLIENTSIDE version of the script.
(0016394)
Torr Samaho   
2016-11-30 07:02   
Thanks for the updated examples! usercvarmusictest.wad fails for me in single player both in 3.0 and the latest GZDoom version. Can you confirm this?
(0016395)
Edward-san   
2016-11-30 08:16   
(edited on: 2016-11-30 09:10)
According to the code, GetCVar expects the activator to be a player when the cvar in question is a user cvar, so that it checks such player's user cvar. zan 2.1 had the code commented out (in function GetCVar in p_acs.cpp), so this is why it never happened over there.

Probably it's a limitation of the user cvar system, but I'll ask at the zdoom forum anyways.

[edit] Just a note regarding the proper way to use user cvars: I think that GetUserCVar should be used. It has more freedom, as you can specify which players should have their user cvar checked.

[edit2] I fear it may be considered as [not a bug] because that seems intentional according to zdoom r4283 changelog. Torr, what's your opinion on this?

(0016403)
Torr Samaho   
2016-11-30 20:04   
Looks like this is a mod error then, but I hate breaking backwards compatibility. We could let GetCVar fallback to the consoleplayer value if it's called without a player as activator on a user CVar.
(0016404)
arkore   
2016-11-30 20:18   
Seems like the GetUserCvar() is the correct way to get user cvars, go figure. Also, the GetCvar wiki page has a big fat warning on it.

I suspect there won't be many mods like this, and so I wouldn't provide a fallback. I think that any mods affected by this should be updated/fixed instead of relying on a fallback.

Feel free to close this issue.
(0016405)
Edward-san   
2016-11-30 20:47   
(edited on: 2016-11-30 20:48)
I think the only circumstance I could see the solution in comment 0002634:0016403 causing no problems would be a CLIENTSIDE script. In the server side, how would we choose which player's user cvar would be read?

(0016704)
StrikerMan780   
2017-01-28 05:09   
GetUserCVar is fixed now. As for the SetMusic stuff, try LocalSetMusic if you want to set music for a single client. If you want to set music for all clients, use SetMusic in a non-clientside script.