"cd play XX" when you die
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
"cd play XX" when you die
Hey there,
I want my MOD playing an MP3 when you die in the singleplayer, not in multiplayer...
Can i do this via QuakeC or do i need to mod the engine (PSP ProQuake)?
The only music thing i have done so far is via "trigger_command" brushes on my map, and it changes the music
when you enter a different area.
I want my MOD playing an MP3 when you die in the singleplayer, not in multiplayer...
Can i do this via QuakeC or do i need to mod the engine (PSP ProQuake)?
The only music thing i have done so far is via "trigger_command" brushes on my map, and it changes the music
when you enter a different area.
-

dr_mabuse - Posts: 80
- Joined: Sat Sep 03, 2011 6:07 pm
Re: "cd play XX" when you die
Should be easy. In player.qc's PlayerDie() (or elsewhere?) check if you are in a multiplayer game and if not, stuffcmd the "cd play XX".
edit:
If that works I shall from now on be called Spirit of QC.
edit:
- Code: Select all
if (!(deathmatch || coop))
stuffcmd (self, "cd play 123\n");
If that works I shall from now on be called Spirit of QC.
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
- Spirit
- Posts: 1031
- Joined: Sat Nov 20, 2004 9:00 pm
Re: "cd play XX" when you die
thanks i will try it and tell you if it works 
-

dr_mabuse - Posts: 80
- Joined: Sat Sep 03, 2011 6:07 pm
Re: "cd play XX" when you die
mmm without cd
- Code: Select all
void() DeathSound =
{
local float rs;
// water death sounds
if (self.waterlevel == 3)
{
DeathBubbles(20);
sound (self, CHAN_VOICE, "player/h2odeath.wav", 1, ATTN_NORM);
return;
}
if (self.invisible_finished > time)
return;
rs = rint ((random() * 4) + 1);
if (rs == 1)
self.noise = "player/death1.wav";
if (rs == 2)
self.noise = "player/death2.wav";
if (rs == 3)
self.noise = "player/death3.wav";
if (rs == 4)
self.noise = "player/death4.wav";
if (rs == 5)
self.noise = "player/death5.wav";
sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM);
AttractNoise(400); // Attract monsters
return;
};
Sorry for my english 
- Max_Salivan
- Posts: 93
- Joined: Thu Dec 15, 2011 1:00 pm
Re: "cd play XX" when you die
As far as I know, the "correct" way is
Yes that WriteByte message needs to occur twice. According to the docs ...
http://www.gamers.org/dEngine/quake/Qc/qc-net.htm
The SVC_CDTRACK message takes 2 bytes so two WriteBytes must be sent. Otherwise the client will probably get some sort of fail to console with a "bad network message" of some sort.
- Code: Select all
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, 2); // 2 is track number
WriteByte (MSG_ALL, 2); // 2 is track number
Yes that WriteByte message needs to occur twice. According to the docs ...
http://www.gamers.org/dEngine/quake/Qc/qc-net.htm
- Code: Select all
Message: Set CD Track
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, val1); // CD start track
WriteByte (MSG_ALL, val2); // CD end track
The SVC_CDTRACK message takes 2 bytes so two WriteBytes must be sent. Otherwise the client will probably get some sort of fail to console with a "bad network message" of some sort.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest