Sound on 60 seconds and color (Dead) Tags
Ok so I want to add a sound to the game when the room has 60 seconds left when the server displays "60 Seconds Remaining".
The 60 Secs remaining part is in the MMatchRule.cpp . How do I get it working when I define the sound to the ZSoundEngine.h? Or do I need to do something else.
---
Second, I'm busy with the dead tags. I'd like the (Dead) tag to be red.
This is how it was:
Code:
(Dead)Administrator: Hello
(Dead)Developer: Hello
This is how I keep ending up:
Code:
(Dead)Administrator: Hello
(Dead)Developer: Hello
or
(Dead)Administrator: Hello
(Dead)Developer: Hello
This is how I want it:
Code:
(Dead)Administrator: Hello
(Dead)Developer: Hello
---
Can someone help me with these 2 things?
Thanks.
~Patrick
Re: Sound on 60 seconds and color (Dead) Tags
Re: Sound on 60 seconds and color (Dead) Tags
ZGetGameInterface()->PlayVoiceSound( VOICE_SIXTY_SECOND, 1600);
declare VOICE_SIXTY_SECOND in ZSoundEngine.h
Re: Sound on 60 seconds and color (Dead) Tags
Quote:
Originally Posted by
Ronny786
ZGetGameInterface()->PlayVoiceSound( VOICE_SIXTY_SECOND, 1600);
declare VOICE_SIXTY_SECOND in ZSoundEngine.h
Yeah I tried that... This is what I get:
Code:
\CSCommon\Source\MMatchRule.cpp(142): error C2065: 'VOICE_SIXTY_SECOND' : undeclared identifier
\CSCommon\Source\MMatchRule.cpp(142): error C2227: left of '->PlayVoiceSound' must point to class/struct/union
\CSCommon\Source\MMatchRule.cpp(142): error C3861: 'ZGetGameInterface': identifier not found, even with argument-dependent lookup
I declared this in ZSoundEngine.h:
Code:
#define VOICE_SIXTYSEC_REMAIN "nar/NAR37"
This is the code in MMatchRule.cpp:
Code:
else if ((GetLastTimeLimitAnnounce() > 60) && (nTimeRemain < 60*1000)) {
MCommand* pCmd = MMatchServer::GetInstance()->CreateCommand(MC_MATCH_ANNOUNCE, MUID(0,0));
pCmd->AddParameter(new MCmdParamUInt(0));
sprintf(szMsg, "%s%d", MTOK_ANNOUNCE_PARAMSTR, MERR_TIME_60REMAINING);
pCmd->AddParameter(new MCmdParamStr( szMsg));
ZGetGameInterface()->PlayVoiceSound( VOICE_SIXTYSEC_REMAIN, 1600);
MMatchServer::GetInstance()->RouteToStage(GetStage()->GetUID(), pCmd);
SetLastTimeLimitAnnounce(60);
return false;
And another question, where does the 1600 stand for? I see that after every sound, is it volume or something?
Re: Sound on 60 seconds and color (Dead) Tags
Quote:
Originally Posted by
Patrick2607
Yeah I tried that... This is what I get:
Code:
\CSCommon\Source\MMatchRule.cpp(142): error C2065: 'VOICE_SIXTY_SECOND' : undeclared identifier
\CSCommon\Source\MMatchRule.cpp(142): error C2227: left of '->PlayVoiceSound' must point to class/struct/union
\CSCommon\Source\MMatchRule.cpp(142): error C3861: 'ZGetGameInterface': identifier not found, even with argument-dependent lookup
I declared this in ZSoundEngine.h:
Code:
#define VOICE_SIXTYSEC_REMAIN "nar/NAR37"
Did you add the header file?
Sound on 60 seconds and color (Dead) Tags
Code:
#include ZSoundEngine.h
sadly does not work :(
Re: Sound on 60 seconds and color (Dead) Tags
Quote:
Originally Posted by
Patrick2607
Code:
#include ZSoundEngine.h
sadly does not work :(
#include "ZSoundEngine.h"
As for multiple colours, simply look at what MAIET did with their ^ tags.
Re: Sound on 60 seconds and color (Dead) Tags
Quote:
Originally Posted by
Wizkidje
#include "ZSoundEngine.h"
As for multiple colours, simply look at what MAIET did with their ^ tags.
Yeah sorry, was on mobile, that's what I have in MMatchRule.
I added this so far:
MMatchRule.cpp:
#include "ZSoundEngine.h"
And this (red) line:
Code:
else if ((GetLastTimeLimitAnnounce() > 60) && (nTimeRemain < 60*1000)) {
MCommand* pCmd = MMatchServer::GetInstance()->CreateCommand(MC_MATCH_ANNOUNCE, MUID(0,0));
pCmd->AddParameter(new MCmdParamUInt(0));
sprintf(szMsg, "%s%d", MTOK_ANNOUNCE_PARAMSTR, MERR_TIME_60REMAINING);
pCmd->AddParameter(new MCmdParamStr( szMsg));
ZGetGameInterface()->PlayVoiceSound( VOICE_60SEC, 1500);
MMatchServer::GetInstance()->RouteToStage(GetStage()->GetUID(), pCmd);
SetLastTimeLimitAnnounce(60);
return false;
ZSoundEngine.h:
#define VOICE_60SEC "nar/NAR80"
Error:
\CSCommon\Source\MMatchRule.cpp(10): fatal error C1083: Cannot open include file: 'ZSoundEngine.h': No such file or directory
Re: Sound on 60 seconds and color (Dead) Tags
Do not add that to CSCommon (Common code of GunZ). Instead,
./Gunz/ZGameClient.cpp - ZGameClient::OnAnnounce()...
Code:
void ZGameClient::OnAnnounce(unsigned int nType, char* szMsg)
{
ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
if (strncmp(szMsg, MTOK_ANNOUNCE_PARAMSTR, strlen(MTOK_ANNOUNCE_PARAMSTR)) == 0)
{
const char* szId = szMsg + strlen(MTOK_ANNOUNCE_PARAMSTR);
int idErrMsg = 0;
if (1 == sscanf(szId, "%d", &idErrMsg)) {
char szTranslated[256];
const char* szErrStr = ZErrStr(idErrMsg);
const char* szArg = "";
// タホタレ ニトスフ : ア゙ヌマエマ タマエワ タホタレ 0ーウ カヌエツ 1 ーウサモタフカ・ー。チ、ヌマー・アクヌ・
const char* pSeperator = strchr(szMsg, '\a');
if (pSeperator) {
szArg = pSeperator + 1;
}
sprintf(szTranslated, szErrStr, szArg);
ZChatOutput(szTranslated, ZChat::CMT_SYSTEM);
if(idErrMsg == MERR_TIME_60REMAINING)
{
ZGetGameInterface()->PlayVoiceSound(VOICE_60SEC, 1500);
}
return;
}
}
ZChatOutput(szMsg, ZChat::CMT_SYSTEM);
}
Re: Sound on 60 seconds and color (Dead) Tags
Dude get on Skype, ill help u there.
Sound on 60 seconds and color (Dead) Tags
Re: Sound on 60 seconds and color (Dead) Tags
Re: Sound on 60 seconds and color (Dead) Tags
Quote:
Originally Posted by
Ronny786
disgusting !
May i ask why you needed to write this and also what you wrote it about?
Re: Sound on 60 seconds and color (Dead) Tags
Quote:
Originally Posted by
aV3PQmCJjM9L
Do not add that to CSCommon (Common code of GunZ). Instead,
./Gunz/ZGameClient.cpp - ZGameClient::OnAnnounce()...
Code:
void ZGameClient::OnAnnounce(unsigned int nType, char* szMsg)
{
ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
if (strncmp(szMsg, MTOK_ANNOUNCE_PARAMSTR, strlen(MTOK_ANNOUNCE_PARAMSTR)) == 0)
{
const char* szId = szMsg + strlen(MTOK_ANNOUNCE_PARAMSTR);
int idErrMsg = 0;
if (1 == sscanf(szId, "%d", &idErrMsg)) {
char szTranslated[256];
const char* szErrStr = ZErrStr(idErrMsg);
const char* szArg = "";
// タホタレ ニトスフ : ア゙ヌマエマ タマエワ タホタレ 0ーウ カヌエツ 1 ーウサモタフカ・ー。チ、ヌマー・アクヌ・
const char* pSeperator = strchr(szMsg, '\a');
if (pSeperator) {
szArg = pSeperator + 1;
}
sprintf(szTranslated, szErrStr, szArg);
ZChatOutput(szTranslated, ZChat::CMT_SYSTEM);
if(idErrMsg == MERR_TIME_60REMAINING)
{
ZGetGameInterface()->PlayVoiceSound(VOICE_60SEC, 1500);
}
return;
}
}
ZChatOutput(szMsg, ZChat::CMT_SYSTEM);
}
Thank you sir, that works :) Any idea where the 1500 number stands for?
Edit: I think the number means the amount of miliseconds the next sound can be played.
Example: VOICE_HEADSHOT,1500
Lets say you got a headshot and fantastic icon above your head. First you'll hear the "Headshot" sound. The headshot sound will take up to 1500 miliseconds before the "Fantastic" sound is played.
But, that's just a guess...
Re: Sound on 60 seconds and color (Dead) Tags
Quote:
Originally Posted by
Patrick2607
Thank you sir, that works :) Any idea where the 1500 number stands for?
Edit: I think the number means the amount of miliseconds the next sound can be played.
Example: VOICE_HEADSHOT,1500
Lets say you got a headshot and fantastic icon above your head. First you'll hear the "Headshot" sound. The headshot sound will take up to 1500 miliseconds before the "Fantastic" sound is played.
But, that's just a guess...
It seems.