MantisBT - Zandronum
View Issue Details
0002932Zandronum[All Projects] Bugpublic2016-11-25 18:402017-04-30 01:46
Catastrophe 
 
normalminoralways
closedno change required 
MicrosoftWindowsXP/Vista/7
2.1 
 
0002932: OPEN CLIENTSIDE scripts do not run upon connection
Hello, the wiki states "Open scripts will executed by the world when the level loads on the client (i.e. upon connection)". From my investigations however, this does not appear to be the case. To demonstrate, I have prepared two wads, both which spawn a skybox if you are using open-gl upon connection.

Currently, for a clientsided script to run upon connection, you you need two scripts like this: openclientside-bug.pk3:'http://pastebin.com/raw/EthaZ1bA [^]'

However, this SHOULD be doable in one script without loops as demonstrated in openclientside-should.pk3:'http://pastebin.com/raw/w0Fm6LP0 [^]'

Unfortunately, that is not the case for 2.0, 2.1, and the latest publicly-available beta build. To my knowledge, this strange behavior has been around for years now.
Just host a server loading either of the wads and connect, don't join the game.
openclientside-bug.pk3 -> How to run clientside scripts upon connection currently
openclientside-should.pk3 -> How it should be, but isn't.
No tags attached.
? openclientside-bug.pk3 (2,389) 2016-11-25 18:40
https://zandronum.com/tracker/file_download.php?file_id=1970&type=bug
? openclientside-should.pk3 (2,273) 2016-11-25 18:40
https://zandronum.com/tracker/file_download.php?file_id=1971&type=bug
? openclientside-fixed.pk3 (2,323) 2017-04-27 14:39
https://zandronum.com/tracker/file_download.php?file_id=2080&type=bug
Issue History
2016-11-25 18:40CatastropheNew Issue
2016-11-25 18:40CatastropheFile Added: openclientside-bug.pk3
2016-11-25 18:40CatastropheFile Added: openclientside-should.pk3
2017-04-27 14:36KorshunNote Added: 0017363
2017-04-27 14:38KorshunNote Edited: 0017363bug_revision_view_page.php?bugnote_id=17363#r10425
2017-04-27 14:39KorshunFile Added: openclientside-fixed.pk3
2017-04-27 18:46FusedNote Added: 0017370
2017-04-27 18:47FusedNote Edited: 0017370bug_revision_view_page.php?bugnote_id=17370#r10432
2017-04-27 18:48FusedNote Edited: 0017370bug_revision_view_page.php?bugnote_id=17370#r10433
2017-04-27 19:21KorshunNote Added: 0017372
2017-04-27 19:21KorshunNote Edited: 0017372bug_revision_view_page.php?bugnote_id=17372#r10435
2017-04-27 20:05FusedNote Added: 0017375
2017-04-27 21:13ibm5155Note Added: 0017377
2017-04-29 16:34Torr SamahoNote Added: 0017412
2017-04-29 22:24CatastropheNote Added: 0017433
2017-04-30 01:46Ru5tK1ngStatusnew => closed
2017-04-30 01:46Ru5tK1ngResolutionopen => no change required

Notes
(0017363)
Korshun   
2017-04-27 14:36   
(edited on: 2017-04-27 14:38)
> if(consoleplayernumber() != playernumber()) terminate;
OPEN scripts (including CLIENTSIDE) don't have an activator. Remove this line.

This script works:

script 1 OPEN CLIENTSIDE
{
    printbold(s:"This is an open clientside script. It only runs on the client that has connected. It doesn't run for other clients when a client connects.");
}

(0017370)
Fused   
2017-04-27 18:46   
(edited on: 2017-04-27 18:48)
The whole OPEN CLIENTSIDE script type is weird in general.
I guess since the game does not take spectators as activators, you really cannot to a lot with this scripttype, unless you wanna use ConsolePlayerNumber() everywhere. It would be great if you could set them as activators, instead of having everybody force to join first. But I guess this would mean a rewrite of the existing system, and possibly breaking mods?

(0017372)
Korshun   
2017-04-27 19:21   
The OPEN CLIENTSIDE script type is not weird at all. It's just a script that is ran by the client when it loads the level.

And what can you do with a spectator activator? This should be a separate feature request.

(0017375)
Fused   
2017-04-27 20:05   
Quote

The OPEN CLIENTSIDE script type is not weird at all. It's just a script that is ran by the client when it loads the level.


Well in that case you could also just use an ENTER CLIENTSIDE type script for this. This will only not work for spectators of course like said above.
I guess another ticket for it is indeed best.
(0017377)
ibm5155   
2017-04-27 21:13   
-open clientside will only be executed when the map start.
-no need for printbold in clientside, print should work just fine.

you could make a clientside connect script that calls all those open clientside script...
If I remember clientside works fine with spectators, the only problem is that as a spectator, you do not have a body to register your movments and also your position .

AND that's a nice feature that could be done, do something so GetPlayerInput works for spectators only if called by a clientside script (so there's no need to send those data for the server)
(0017412)
Torr Samaho   
2017-04-29 16:34   
Let me quote the ZDoom Wiki:
Quote
Code that affects the script activator should not be used in an OPEN script, as the "activator" for these types of scripts is the game world and not a specific player. Use the ENTER script type if you want to script actions that directly affect the player(s) at the beginning of the level.


So it sounds to me as if OPEN CLIENTSIDE already work as intended.
(0017433)
Catastrophe   
2017-04-29 22:24   
In that case, this can be closed then.