Page 1 of 1

CLIENTSIDE alternative?

Posted: Sat Feb 07, 2015 12:38 pm
by Zeberpal
*Player goes from one location to another...
Image
Image

It works allright in Singleplayer, right. The trick is FSKY1ed floors and ceilings, as well as ChangeSky function and other secrets.

But how to make it work online?? Obviously if Player enters another "sky" location it will switch for everyone which is ew ow uh.

I tried to use CLIENTSIDE script, thinking it will do things only for player who triggered that script, but yet it changes for everyone, meh.
Still don't get the point of clientside script anyway. I also tried Skybox picker trick with teleporting people to another area, but it is way too messed up and glitchy.

Any ideas guys D: ?

RE: CLIENTSIDE alternative?

Posted: Sat Feb 07, 2015 1:13 pm
by Konda
http://wiki.zandronum.com/Clientside_Scripting
Even that you should take with a grain of salt, though. I tried some of the things the wiki page says it works, and it just didn't work as expected (like making an actor execute a clientside ACS script which would supposedly make all clients executing its code do the dame thing - that just didn't work for me). My take is that clientside scripts are very buggy and should be avoided. Hope the wiki page will be helpful, though. It provides some insight on how the thing actually works (or how it is expected to work :lol: ).

RE: CLIENTSIDE alternative?

Posted: Sat Feb 07, 2015 3:17 pm
by Arctangent
I have seen evidence that stuff that affects the world can't be client-sided, even when it's purely visual. You might just have to drop multiplayer support entirely if you want to use those backgrounds.

RE: CLIENTSIDE alternative?

Posted: Sat Feb 07, 2015 4:08 pm
by Zeberpal
Arctangent wrote: You might just have to drop multiplayer support entirely if you want to use those backgrounds.
Unfortunatelly, it looks that way :hmm:
Tried every solution it gave, it was no effect. Thanks, though

Well, I guess...I'll... I'll go now..

/me sadly cries and goes away. :sad:

RE: CLIENTSIDE alternative?

Posted: Sat Feb 07, 2015 5:27 pm
by Ænima
Somebody ran into this before with trying to change map fog on just one player. I really don't think you can change parts of the map on purely the clientside. IMO you should be able to but it would have potential to cause massive desync.

RE: CLIENTSIDE alternative?

Posted: Sat Feb 07, 2015 7:13 pm
by Leonard
Ænima wrote: Somebody ran into this before with trying to change map fog on just one player. I really don't think you can change parts of the map on purely the clientside. IMO you should be able to but it would have potential to cause massive desync.
Arctangent wrote: I have seen evidence that stuff that affects the world can't be client-sided, even when it's purely visual. You might just have to drop multiplayer support entirely if you want to use those backgrounds.
That isn't true.
The only problem I see here is how you want to trigger the clientside script.
A client won't predict any thing executed special or line triggered special.
I think you could try to make a clientside script that will run on entering the map and that keeps track of the player's position in a loop and make it do things once that player reaches a specific spot.

RE: CLIENTSIDE alternative?

Posted: Wed Mar 04, 2015 1:26 am
by ZzZombo
Can't help without the ACS code...

RE: CLIENTSIDE alternative?

Posted: Wed Mar 04, 2015 5:19 pm
by ibm5155
I think you 'll need the same solution on zm09 abandoned mines script.
Clientside scripts when called is executed by everyone, to avoid that everyone execute that script called and just the activator do, you must do right before your code on the script a

Code: Select all

if(ConsolePlayerNumber() != PlayerNumber()) Terminate;
----now I remember the right name :p
On my map, there's a room with a table, and sometimes when someone enters on it, that guy will see the walls with blood, the light flickering, a white face laughting about you and a "scary music", after some seconds, the map went back to normal, but only the activator will see all that crazy stuff...

Extra info, I think you'll need to update your acc compiler since consoleplayer was an exclusive zandronum function

EDIT: ConsolePlayer() => ConsolePlayerNumber()

EDIT2: Resuming what's clientside
It's a script that will not change some gameplay thing, like spawn a monster, change a floor height...
Also, they're good to avoid data traffic, like, instead of creating a serverside timer, make it clientside, so you'll free alot the internet (hudmessage is a internet fat packet D:).

But then, we have a problem, all global integers/strings are server side, so if you want to use them on a clientside script, you'll need to transfer they to the client...

Well, if you need some clientside question, try to ask me, I did like 2 years of research on it for many things on my map ;--;

Still, I want a getplayercameraposx/y/z to may me clientside rainfall perfect :(

RE: CLIENTSIDE alternative?

Posted: Wed Mar 04, 2015 7:34 pm
by Vincent(PDP)
@ibm5155, some notes for you:

First:
ActivatorTID() is not the same as PlayerNumber(), ActivatorTID() returns the tid of the activator. If the player has got tid 843, and 3 is the player's number, then ConsolePlayerNumber() will be 3 and ActivatorTID() will be 843. Which means the script will never work.

Secondly:
ConsolePlayer() is not defined by the way, but if you use "ConsolePlayerNumber() => PlayerNumber()" the script will work if PlayerNumber() is 3 and ConsolePlayerNumber() is everything from 3 and above. Which means that the script will apply to all players that has playernumber 3-63.

Third:
Break only works in switch statements or loops. :)

To avoid everyone from activating the CLIENTSIDE script
The correct statement to check the current player's number with the activator's playernumber is actually:

Code: Select all

If(ConsolePlayerNumber() != PlayerNumber()) { Terminate; }

RE: CLIENTSIDE alternative?

Posted: Wed Mar 04, 2015 8:44 pm
by ibm5155
yeah, it was terminate; I was just lazzy to remember how to finish it on my job :p

EDIT: indeed, it was wrong, I checked now and it's
if(ConsolePlayerNumber() != PlayerNumber()) Terminate;
that I used, well, it's almost the same name, but I was lazzy to find the right name :p

AND finally, you dont need a { terminate; } on that case, only if you have two or more things inside of it
so

Code: Select all

if(wadda)  terminate;
equals

Code: Select all

if(wadda) {terminate;}

RE: CLIENTSIDE alternative?

Posted: Wed Mar 04, 2015 9:07 pm
by Vincent(PDP)
ibm5155 wrote: AND finally, you dont need a { terminate; } on that case, only if you have two or more things inside of it
I know. :p
But I think it looks better with the brackets. They're not necessary but it's the way statements normally are defined. I guess I'm a bit of a perfectionist, note how I use the correct casing on every method/variable too. (:

Code: Select all

ConsolePlayerNumber()

RE: CLIENTSIDE alternative?

Posted: Fri Mar 06, 2015 12:00 am
by Watermelon
Konda wrote: http://wiki.zandronum.com/Clientside_Scripting
Even that you should take with a grain of salt, though. I tried some of the things the wiki page says it works, and it just didn't work as expected (like making an actor execute a clientside ACS script which would supposedly make all clients executing its code do the dame thing - that just didn't work for me). My take is that clientside scripts are very buggy and should be avoided. Hope the wiki page will be helpful, though. It provides some insight on how the thing actually works (or how it is expected to work :lol: ).
To expand on this (since I'm the one who wrote that article but it's getting sadly out of date and growing hairs):
- Clientside stuff is incomplete
- Clientside stuff can be buggy
- Clientside stuff breaks between releases

My recommendation to the OP is to report any anomalous behaviour on the tracker. Its highly possible that some hacky workaround for stuff will break in other implementations. If you can magically get the thing to work in one version, it's possible in future versions it wont work.


EDIT: I do wish Clientside stuff was more standardized/implemented nicer without the gaping holes we have.
One interesting bug is Clientside input grabbing fails randomly for some people (small minority) with no known reason to date.