MantisBT - Zandronum
View Issue Details
0001787Zandronum[All Projects] Bugpublic2014-04-22 21:402024-03-11 08:10
Klofkac 
Kaminsky 
normalminoralways
resolvedfixed 
1.2 
3.13.1 
0001787: Sector_SetColor not working in clientside scripting
Not sure if this is bug or intended behaviour, but I am trying to create a "drugged" effect by doing sector_setcolor clientsidely on a player who activated certain trigger. It works offline as intended, but when connecting online it does nothing. I have ensured the script runs by printing a message.
Other graphical functions like ChangeFloor, ChangeCeiling, LightFade or SetLineTexture work.
Use the script below in a random map, then create a server, join a game and puke it.
You will see the sectors will not change their colours.
It will work offline, though.
#include "zcommon.acs"

script 1 (void) net clientside
{
    int r,g,b;
    switch(random(1,6))
    {
        case 1:
            r = 255;g = 0;b = 0;
            break;
        case 2:
            r = 0;g = 255;b = 0;
            break;
        case 3:
            r = 0;g = 255;b = 255;
            break;
        case 4:
            r = 255;g = 0;b = 255;
            break;
        case 5:
            r = 255;g = 255;b = 0;
            break;
        case 6:
            r = 127;g = 0;b = 255;
            break;
    }
    Sector_SetColor(0,r,g,b);
    delay(random(105,175));
    restart;
}
No tags attached.
zip sector_setcolor_clientside.zip (1,153) 2014-07-06 17:43
/tracker/file_download.php?file_id=1243&type=bug
Issue History
2014-04-22 21:40KlofkacNew Issue
2014-06-15 16:19WatermelonNote Added: 0009446
2014-06-15 16:19WatermelonStatusnew => feedback
2014-06-15 17:53KlofkacNote Added: 0009472
2014-06-15 17:53KlofkacStatusfeedback => new
2014-06-15 22:08WatermelonNote Added: 0009489
2014-06-15 22:08WatermelonStatusnew => needs review
2014-06-21 14:13Torr SamahoNote Added: 0009615
2014-06-21 14:14Torr SamahoNote Edited: 0009615bug_revision_view_page.php?bugnote_id=9615#r5092
2014-06-21 14:14Torr SamahoNote Revision Dropped: 9615: 0005091
2014-06-21 14:14Torr SamahoAssigned To => Torr Samaho
2014-06-21 14:14Torr SamahoStatusneeds review => assigned
2014-06-21 14:14Torr SamahoStatusassigned => feedback
2014-07-05 10:20Torr SamahoNote Added: 0009844
2014-07-05 20:05Torr SamahoProduct Version2.0-beta => 1.2
2014-07-06 02:51CatastropheNote Added: 0009869
2014-07-06 07:53Torr SamahoNote Added: 0009875
2014-07-06 17:43DuskFile Added: sector_setcolor_clientside.zip
2014-07-06 17:44DuskNote Added: 0009881
2014-07-06 17:44DuskStatusfeedback => assigned
2014-07-06 17:48DuskNote Edited: 0009881bug_revision_view_page.php?bugnote_id=9881#r5283
2014-07-07 06:09Torr SamahoNote Added: 0009883
2014-07-07 06:10Torr SamahoNote Edited: 0009883bug_revision_view_page.php?bugnote_id=9883#r5287
2014-07-07 06:10Torr SamahoNote Revision Dropped: 9883: 0005286
2014-07-07 07:02CatastropheNote Added: 0009884
2014-07-07 09:33DuskNote Added: 0009886
2014-07-07 17:02Torr SamahoNote Added: 0009887
2021-07-26 12:45KaminskyNote Added: 0021639
2021-07-26 12:45KaminskyAssigned ToTorr Samaho => Kaminsky
2021-07-26 12:45KaminskyStatusassigned => needs testing
2021-07-26 12:47KaminskyTarget Version => 3.1
2024-03-11 08:10unknownnaNote Added: 0023351
2024-03-11 08:10unknownnaStatusneeds testing => resolved
2024-03-11 08:10unknownnaResolutionopen => fixed
2024-03-11 08:10unknownnaFixed in Version => 3.1

Notes
(0009446)
Watermelon   
2014-06-15 16:19   
Is this supposed to be used clientside?
(0009472)
Klofkac   
2014-06-15 17:53   
I don't see a problem why it should not. It's purely graphical function and using it clientsidely would create some interesting effects, like:
- Changing certain sector colours depending on which team player is at
- Making a single player with "weak vision", where just for the players some sectors are darkened
- The above mentioned drugged effect
- Make the map look slightly different for each player
- And so on...
The other graphical functions work, for example changing sector brightness, setting the textures, etc.

Making these (not just) graphical changes clientsidely just to desired ConsolePlayer is the power of clientside scripting without which some effects would not be possible at all. There are actually some mods around which benefit from it.
(0009489)
Watermelon   
2014-06-15 22:08   
Requiring comment on if they're okay with this being added and/or fixed
(0009615)
Torr Samaho   
2014-06-21 14:13   
(edited on: 2014-06-21 14:14)
CLIENTSIDE scripts are not really intended to desynchronize sector properties, but since this is a purely visual effect, we can just go ahead and do so.

The fix is trivial. We only have to change

sectors[secnum].SetColor(arg1, arg2, arg3, arg4, false);

to

sectors[secnum].SetColor(arg1, arg2, arg3, arg4, false, true);

in FUNC(LS_Sector_SetColor). If you post a minimal example wad, I'll fix this.

(0009844)
Torr Samaho   
2014-07-05 10:20   
No minimal example wad in sight after about two weeks of waiting. If nobody posts a minimal example wad soon, I'll close this ticket.
(0009869)
Catastrophe   
2014-07-06 02:51   
I'll make one, so a wad doing sector_setcolor on a clientside script correct?
(0009875)
Torr Samaho   
2014-07-06 07:53   
Yes, please.
(0009881)
Dusk   
2014-07-06 17:44   
(edited on: 2014-07-06 17:48)
compiled the ACS posted in the description into an example WAD.

yay automation

(0009883)
Torr Samaho   
2014-07-07 06:09   
(edited on: 2014-07-07 06:10)
Unfortunately, without a map with properly tagged sectors, the wad with just the script is not of much use: I didn't see any effects when just running the example wad with Doom2 map01.

(0009884)
Catastrophe   
2014-07-07 07:02   
Strange, using sector_setcolor with 0 as a tag should be working on all sectors tagged as 0, I've done it before.
(0009886)
Dusk   
2014-07-07 09:33   
Works fine for me offline when using it on map01...
(0009887)
Torr Samaho   
2014-07-07 17:02   
Weird. When I start Zandronum 1.2.2 under Windows with
zandronum.exe -file sector_setcolor_clientside.zip +map map01

I don't experience any sector color changes.
(0021639)
Kaminsky   
2021-07-26 12:45   
Sector_SetColor (as well as Sector_SetFade) now work, and only work, inside CLIENTSIDE ACS scripts in 3.1. A client cannot execute these specials if they're called from outside an ACS script, like on a line or an actor.
(0023351)
unknownna   
2024-03-11 08:10   
Quote from Torr Samaho
I don't experience any sector color changes.

It seems that one has to manually puke script 1 in the console.

Anyway, the example wad works online in 3.1 now. Great job, Kaminsky!