[SOLVED]Custom effects when a player leave the game

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

[SOLVED]Custom effects when a player leave the game

#1

Post by fr blood » Fri Jun 26, 2015 12:27 pm

Hellow everyone, I would like to know what is the name of the actor that spawn red particles when a player disconnect or join spectator because I would like to replace him in my project, thanks for the help.
Last edited by fr blood on Sat Jun 27, 2015 7:37 am, edited 1 time in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: Looking for an actor's name

#2

Post by Ænima » Fri Jun 26, 2015 12:31 pm

Might be hard coded, I've never seen an actor name for it.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

RE: Looking for an actor's name

#3

Post by fr blood » Fri Jun 26, 2015 12:50 pm

I see, maybe that there is way with the scripts, actually I tried that:

Code: Select all

Script XXX (int none) DISCONNECT 
{
int x = GetActorX(0);
int y = GetActorY(0); 
int z = GetActorZ(0);
Spawn("LeavingTeleportFog",x,y,z,0,0);
}
It's suppose to spawn the custom teleport fog at the place where the play disconnect, but it doesn't work, the teleport fog spawn at the player's start spot.

Anyone go an idea to fix that ? ???
Last edited by fr blood on Fri Jun 26, 2015 12:51 pm, edited 1 time in total.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: Looking for an actor's name

#4

Post by Ænima » Fri Jun 26, 2015 2:09 pm

Once a player disconnects, their xyz resets, I'm assuming. You'd have to run an Enter script on every player that updates 64-sized global arrays with each player's last XYZ every 6 tics or so. Then on disconnect, just pull that players's X Y and Z from those arrays and reset their values.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Watermelon
Zandrone
Posts: 1244
Joined: Thu Jun 28, 2012 9:07 pm
Location: Rwanda

RE: Looking for an actor's name

#5

Post by Watermelon » Fri Jun 26, 2015 2:16 pm

To confirm: Yes it's natively done, this is the function that is run:

https://bitbucket.org/Torr_Samaho/zandr ... ult#cl-962

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

RE: Looking for an actor's name

#6

Post by fr blood » Fri Jun 26, 2015 3:04 pm

Ok thanks for the help, Aenima's option is the best I have.

EDIT:
Well I wanted to have the effect to spawn when player disconnect and join spect, so I tried that script but it doesn't work at all.

Code: Select all

bool InGame[64];

Script XXX ENTER
{
while(InGame[PlayerNumber()] == TRUE)
{
	int x = GetActorX(0);
	int y = GetActorY(0); 
	int z = GetActorZ(0);
	delay(2);
}
Spawn("LeavingTeleportFog",x,y,z,0,0);
}

Script XXX (int id) DISCONNECT 
{
InGame[PlayerNumber()] = FALSE;
}
So I tried another script, more simple, but this one make the effect only if the player leave the game, and not when he joins spectators.

Code: Select all

Script XXX ENTER
{
while(PlayerInGame(PlayerNumber()))
{
	int x = GetActorX(0);
	int y = GetActorY(0); 
	int z = GetActorZ(0);
	delay(2);
}
Spawn("LeavingTeleportFog",x,y,z,0,0);
}
Any idea to make this works also when the player joins spectators ?
Last edited by fr blood on Fri Jun 26, 2015 3:44 pm, edited 1 time in total.

User avatar
Kaminsky
Developer
Posts: 204
Joined: Sun Apr 14, 2013 7:17 pm
Location: Canada

RE: Custom effects when a player leave the game

#7

Post by Kaminsky » Fri Jun 26, 2015 3:58 pm

I believe that the function PlayerInGame() only applies for whether the player is in a multiplayer game or not, but doesn't account for spectators. You should go back to your original code and have it so that in the DISCONNECT script, the LeavingTeleportFog is spawned at whatever coordinates stored in an array correspond to the player's TID. Otherwise, the ENTER script is terminated when the player leaves.

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

RE: Custom effects when a player leave the game

#8

Post by fr blood » Fri Jun 26, 2015 5:44 pm

I managed to make it works with the 1st script, but it makes the same problem, it works when a player leave the game, but not when he spects, I noticed that all in the disconnect script works but the change of the bool.

Code: Select all

bool InGame[64];

Script XX ENTER
{
InGame[PlayerNumber()] = TRUE;
while(InGame[PlayerNumber()] == TRUE)
{
    int x = GetActorX(0);
    int y = GetActorY(0);
    int z = GetActorZ(0);
    delay(2);
}
Spawn("LeavingTeleportFog",x,y,z,0,0);
}

Script XXX (int id) DISCONNECT
{
InGame[PlayerNumber()] = FALSE;
}
I guess that the problem is from Zandronum, because when I add something else in the disconnect script it works well when I spect, but the changing of the bool value doesn't.

Cruduxy
Zandrone
Posts: 1059
Joined: Fri Jun 08, 2012 4:24 pm

RE: Custom effects when a player leave the game

#9

Post by Cruduxy » Sat Jun 27, 2015 12:01 am

http://wiki.zandronum.com/PlayerIsSpectator
Pretty sure there is more info here http://wiki.zandronum.com/ACS_Functions . And useful commands :P.
[][][][][][][][][][][][][][][]
Nothing to see here
[][][][][][][][][][][][][][][]

User avatar
fr blood
Frequent Poster Miles card holder
Posts: 995
Joined: Wed Mar 06, 2013 4:04 pm
Location: France

RE: Custom effects when a player leave the game

#10

Post by fr blood » Sat Jun 27, 2015 7:37 am

Cruduxy wrote: http://wiki.zandronum.com/PlayerIsSpectator
Pretty sure there is more info here http://wiki.zandronum.com/ACS_Functions . And useful commands :P.
Thanks, I totally forgot these commands from Zandronum, it works nice when I use Zandronum's compiler.

Code: Select all

Script XXX ENTER
{
while(PlayerInGame(PlayerNumber()) && PlayerIsSpectator(PlayerNumber()) == 0)
{
    int x = GetActorX(0);
    int y = GetActorY(0);
    int z = GetActorZ(0);
    delay(2);
}
Spawn("LeavingTeleportFog",x,y,z,0,0);
}
But, now I can say that I'll have to wait, because I'm using Zdoom compiler for a Zandronum mode, yeah suprisely it works but it will ignore Zand's funtion like "PlayerIsSpectator", so I guess that I'll have to wait for the update of Zandronum compiler, anyway the problem is solved.

Post Reply