Checking which player spectating player is spectating.
- ZZYZX
- Posts a lot
- Posts: 742
- Joined: Thu Jun 07, 2012 5:56 pm
- Location: Ukraine
- Clan: A3
- Clan Tag: [A3]
Re: Checking which player spectating player is spectating.
You can query spectator's nickname serverside. You can query spectator's GetUserCVar serverside. With additional scripting you can even have their position dynamically updated on the server so you can interact with things while being a spectator. (to a limited extent of course).
They are players. This is important. Randcaps work because of this. Don't say "spectators aren't players". Things such as this are important to distinguish for advanced ACS. Blurry humanitarian terminology isn't applicable in programming, it only causes confusion.
This is what ZzZombo was trying to say. Not "look at me I know the engine better".
They are players. This is important. Randcaps work because of this. Don't say "spectators aren't players". Things such as this are important to distinguish for advanced ACS. Blurry humanitarian terminology isn't applicable in programming, it only causes confusion.
This is what ZzZombo was trying to say. Not "look at me I know the engine better".
quality DoomExplorer hackeringFilystyn wrote:Do you know what windows.h is? It's D, DWORD.
overcomplicated ZDoom grenade
random Doom things
GZDoomBuilder-Bugfix
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: Checking which player spectating player is spectating.
They're obviously players and have their own variables since they are running zandronum.exe and joined a server. Does that change the fact they can't interact with the physical game world? They aren't a doomguy in-game, they're an invisible camera that can do nothing but fly around, even if they're a doomguy with a spectator flag in the source code. By coding spectator position updating on the server you are literally going against the entire concept of a spectator in Skulltag/Zandronum that is to cause as little network traffic as possible.ZZYZX wrote:You can query spectator's nickname serverside. You can query spectator's GetUserCVar serverside. With additional scripting you can even have their position dynamically updated on the server so you can interact with things while being a spectator. (to a limited extent of course).
They are players. This is important. Randcaps work because of this. Don't say "spectators aren't players". Things such as this are important to distinguish for advanced ACS. Blurry humanitarian terminology isn't applicable in programming, it only causes confusion.
This is what ZzZombo was trying to say. Not "look at me I know the engine better".
I think everything was made pretty damn clear to people who could be interested in knowing so there's no point in dragging this out any further.
- ibm5155
- Addicted to Zandronum
- Posts: 1641
- Joined: Tue Jun 05, 2012 9:32 pm
- Location: Somewhere, over the rainbow
Re: Checking which player spectating player is spectating.
Code: Select all
script 10 enter{// show who's spectating you
int mypos;
int otherpos;
int i=0;
int x,y,z;
while(true){
x = GetActorX(1000+playernumber());
y = GetActorY(1000+playernumber());
z = +GetActorZ(1000+playernumber());
for(i=0;i<64;i++){
if(i!=playernumber()){
if(abs(abs(x) -abs(PX[i])) <= 10.0){
if(abs(abs(y)-abs(PY[i])) <= 10.0){
if(abs(abs(z)-abs(PZ[i])) <= 10.0){
acs_executealways(11,0,i,i);
}
}
}
}
}
delay(1);
}
}
script 11 (int name,int i) clientside{
if(activatortid()-1000!=consoleplayernumber())
terminate;
hudMessage(n:i,s:" is spectating you";HUDMSG_PLAIN,0,CR_WhiTE,0.5,0.5+(i*0.01),1.0);
}
Here's the code that I used to get the player's câmera pos
Code: Select all
script 7 open clientside{//Update Spectators position to the server
int ox,oy,oz;
int x,y,z;
ox = GetCameraX();
oy = GetCameraY();
oz = GetCameraZ();
x = ox;
y = oy;
z = oz;
while(true){
x = GetCameraX();
y = GetCameraY();
z = GetCameraZ();
if(x != ox || y != oy || z != oz){ // don't update the server if the position doesn't have changed
ox = x;
oy = y;
oz = z;
RequestScriptPuke(8,consoleplayeRnumber(),x,y);
RequestScriptPuke(88,consoleplayeRnumber(),z,GetCameraAngle());
RequestScriptPuke(89,consoleplayeRnumber(),GetCameraPitch(),0);
}
delay(1);
}
}
script 8 (int activator,int x,int y) NET{// receive spectators position
// printbold(s:"activator 8:",d:activator, s:" X:",f:x,s:" y:",f:y);
PX[activator] = x;
PY[activator] = y;
}
script 88 (int activator,int z,int angle) NET{// receive spectators position
// printbold(s:"activator 88:",d:activator,s:" Z:", f:z);
PZ[activator] = z;
PAngle[activator] = angle;
}
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!
<this post is proof of "Decline">
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!
<this post is proof of "Decline">
Re: Checking which player spectating player is spectating.
I can create actors that also can't react with the game world. Hell, puffs, particle fountains, map spots and trails already don't. Does it make them non-actors?
Re: Checking which player spectating player is spectating.
r u guys still splitting hairs over this
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: Checking which player spectating player is spectating.
It's just a typical 13 year old that wants to have the last word at all costs, I already let him have it so hopefully no more time will be wasted hereÆnima wrote:r u guys still splitting hairs over this
Re: Checking which player spectating player is spectating.
he was right though ...SwordGrunt wrote:It's just a typical 13 year old that wants to have the last word at all costs, I already let him have it so hopefully no more time will be wasted hereÆnima wrote:r u guys still splitting hairs over this
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: Checking which player spectating player is spectating.
Yeah usually when you ignore everything someone says except the part you wish to correct, you end up being "right"Ænima wrote:he was right though ...SwordGrunt wrote:It's just a typical 13 year old that wants to have the last word at all costs, I already let him have it so hopefully no more time will be wasted hereÆnima wrote:r u guys still splitting hairs over this
Re: Checking which player spectating player is spectating.
I re-read both yours and his first posts in this thread and I can't find anything fundamentally "wrong" about what he said.SwordGrunt wrote:Yeah usually when you ignore everything someone says except the part you wish to correct, you end up being "right"Ænima wrote:he was right though ...SwordGrunt wrote:It's just a typical 13 year old that wants to have the last word at all costs, I already let him have it so hopefully no more time will be wasted hereÆnima wrote:r u guys still splitting hairs over this
Spectators do have a physical actor ... It exists in the level whether it's significant or not.SwordGrunt wrote:Technically, spectators do not have a physical game world actor like players do. So that is entirely correct, as spectators are potential players in the server but not for the game engine.ZzZombo wrote:as spectators aren't technically players.as spectators aren't technically players.as spectators aren't technically players.uw0tm8?technically
It seems like you guys are just disagreeing for the sake of disagreeing. I'm not sure what kind of "technicality" totally negates the existence of a spectator's body. It either exists or it doesn't.
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Doom64: Unabsolved: New weapons, monsters, and gameplay features for coop !
ZandroSkins: a pack made by our community
Re: Checking which player spectating player is spectating.
My favorite part is this is still going on even though the author already got his question answered.
- SwordGrunt
- Forum Regular
- Posts: 377
- Joined: Thu Jun 07, 2012 8:43 pm
Re: Checking which player spectating player is spectating.
Same, I actually find it hard to believe none of this was split yetRu5tK1ng wrote:My favorite part is this is still going on even though the author already got his question answered.
But now that I mentioned it, this very post is probably gonna bite the dust soon