Sound on 60 seconds and color (Dead) Tags

Page 1 of 2 12 LastLast
Results 1 to 25 of 38
  1. #1
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    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


  2. #2
    Fuck Army. sahar042 is offline
    MemberRank
    Jul 2009 Join Date
    833Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    delete

  3. #3
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    ZGetGameInterface()->PlayVoiceSound( VOICE_SIXTY_SECOND, 1600);

    declare VOICE_SIXTY_SECOND in ZSoundEngine.h

  4. #4
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    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?

  5. #5
    Alpha Member Chrisss is offline
    MemberRank
    Feb 2012 Join Date
    Ask the Fox!Location
    1,660Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Patrick2607 View Post
    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?

  6. #6
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Sound on 60 seconds and color (Dead) Tags

    Code:
    #include ZSoundEngine.h
    sadly does not work :(

  7. #7
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Patrick2607 View Post
    Code:
    #include ZSoundEngine.h
    sadly does not work :(
    #include "ZSoundEngine.h"

    As for multiple colours, simply look at what MAIET did with their ^ tags.

  8. #8
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Wizkidje View Post
    #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

  9. #9
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    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);
    }
    Last edited by aV3PQmCJjM9L; 17-06-13 at 07:00 PM. Reason: Fix messed code tags.

  10. #10
    Alpha Member Chrisss is offline
    MemberRank
    Feb 2012 Join Date
    Ask the Fox!Location
    1,660Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Dude get on Skype, ill help u there.

  11. #11
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Sound on 60 seconds and color (Dead) Tags

    PM me your skype ;)

  12. #12
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    disgusting !

  13. #13
    Alpha Member Chrisss is offline
    MemberRank
    Feb 2012 Join Date
    Ask the Fox!Location
    1,660Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    disgusting !
    May i ask why you needed to write this and also what you wrote it about?

  14. #14
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by aV3PQmCJjM9L View Post
    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...
    Last edited by Patrick2607; 17-06-13 at 10:48 PM.

  15. #15
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Patrick2607 View Post
    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.
    Last edited by aV3PQmCJjM9L; 17-06-13 at 11:02 PM. Reason: Removed useless explanation.

  16. #16
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Sensor View Post
    May i ask why you needed to write this and also what you wrote it about?
    why do you care lol. :mindownbusiness:

    OT: Dont even try to do something like this if you cannot even use pointers

  17. #17
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    why do you care lol. :mindownbusiness:

    OT: Dont even try to do something like this if you cannot even use pointers
    So is there any problems with my coding style?

  18. #18
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by aV3PQmCJjM9L View Post
    So is there any problems with my coding style?
    i didnt see. its just disgusting because adding a sound effect became a spam thread. its like OMFG

  19. #19
    Account Upgraded | Title Enabled! Patrick2607 is offline
    MemberRank
    May 2013 Join Date
    The NetherlandsLocation
    345Posts

    Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    why do you care lol. :mindownbusiness:

    OT: Dont even try to do something like this if you cannot even use pointers
    I am trying to learn by understanding the code, but yeah, I need the code. I am trying to understand how things work. If that is a problem to you well sorry. A month ago I knew nothing about C++, did not even know how to compile, now I know a little bit more. Every day I work on this I'm learning new things. If you learned C++ in 1 month, congrats. I don't, so don't hate.

  20. #20
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    i didnt see. its just disgusting because adding a sound effect became a spam thread. its like OMFG
    It will not be big problem. Rather I love multi-threading applications. It makes good efficiency.

  21. #21
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    why do you care lol. :mindownbusiness:

    OT: Dont even try to do something like this if you cannot even use pointers
    Please do give me proper usage of a pointer.

  22. #22
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags


  23. #23
    Praise the Sun! Solaire is offline
    MemberRank
    Dec 2007 Join Date
    Undead BurgLocation
    2,862Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    I asked you to give me a proper usage, not to google "pointers" and link me to some MSDN article.

    So, again, can you please give me proper usage of a pointer.

  24. #24
    Currently Stoned ! Ronny786 is offline
    MemberRank
    Dec 2011 Join Date
    Lost WorldLocation
    984Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Wizkidje View Post
    I asked you to give me a proper usage, not to google "pointers" and link me to some MSDN article.

    So, again, can you please give me proper usage of a pointer.
    ahh, its like adressing one variable to other.. if I'm not wrong.
    Like Testme is value of Dont.

    Dont * Testme

    where variable (testme) is pointed to (dont) .
    Now stop !

  25. #25
    Valued Member aV3PQmCJjM9L is offline
    MemberRank
    Jun 2013 Join Date
    100Posts

    Re: Sound on 60 seconds and color (Dead) Tags

    Quote Originally Posted by Ronny786 View Post
    ahh, its like adressing one variable to other.. if I'm not wrong.
    Like Testme is value of Dont.

    Dont * Testme

    where variable (testme) is pointed to (dont) .
    Now stop !
    Nope, the (Dont) class's (also struct or typedef) pointer variable (Testme) is pointed to invalid location.
    Last edited by aV3PQmCJjM9L; 20-06-13 at 07:57 AM. Reason: Minor edit.



Page 1 of 2 12 LastLast

Advertisement