CTF Different Berserker Effect

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

    CTF Different Berserker Effect

    Ok, so I have the default berserker (ef_berserker) and a custom berserker (ef_berserk02).
    I fixed the elu's and added it to .xml. That's not a problem but just information.

    It's in the source. I thought it was something I (a C++ newb) could fix, but it was more complicated than I thought.

    I want the CTF berserker effect to be ef_berserk02 but I can't seem to fix this. Any help where to look? (ZEffectManager / ZEffectAniMesh)

    ~Patrick


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

    Re: CTF Different Berserker Effect

    This is the original code for CTF.
    Code:
            if(nTeam == MMT_BLUE)
            {
                ZGetEffectManager()->AddBerserkerIcon(pFlagChar);
                ZGetEffectManager()->AddRedFlagIcon(pFlagChar);
                pFlagChar->SetTagger(true);
            }        
            else if(nTeam == MMT_RED)
            {
                ZGetEffectManager()->AddBerserkerIcon(pFlagChar);
                ZGetEffectManager()->AddBlueFlagIcon(pFlagChar);
                pFlagChar->SetTagger(true);
            }
    Follow the AddBerserkerIcon until you find ef_berserker and then add a new definition or replace it.

    EDIT: ef_berserker is in ZEffectManager.cpp

    m_pBerserkerEffect = m_pEffectMeshMgr->Get("ef_berserker");

  3. #3
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: CTF Different Berserker Effect

    RMesh* m_pBerserkerEffect[1];

    m_pBerserkerEffect[0] = m_pEffectMeshMgr->Get("ef_berserker");
    m_pBerserkerEffect[1] = m_pEffectMeshMgr->Get("ef_berserker02");



    void ZEffectManager::AddBerserkerIcon(ZObject* pObj, int nType)

    pNew = new ZEffectBerserkerIconLoop(m_pBerserkerEffect[nType],pObj);

    ezpz

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

    Re: CTF Different Berserker Effect

    Ok fixed it, it was easy yeah I forgot to look at ZRuleDeathMatch.cpp... -__- stupid me.
    Anyways, for people who'd like this too:

    ZRuleDeathMatch.cpp:
    Search for:
    Code:
    ZGetEffectManager()->AddBerserkerIcon(pFlagChar);
    Replace with:
    Code:
    ZGetEffectManager()->AddBerserkerCTFIcon(pFlagChar);
    ^ Do this step 3 times.

    ZEffectManager.h:
    Search for:
    Code:
    void AddBerserkerIcon(ZObject* pObj);
    Add under:
    Code:
    void AddBerserkerCTFIcon(ZObject* pObj);
    ZEffectManager.cpp:
    Search for:
    Code:
    m_pBerserkerEffect    = m_pEffectMeshMgr->Get("ef_berserker");
    Add under:
    Code:
    m_pBerserkerCTFEffect    = m_pEffectMeshMgr->Get("ef_berserk02");
    --------------------------------------------------

    Search for:
    Code:
    void ZEffectManager::AddBerserkerIcon(ZObject* pObj){
        ZEffect* pNew;
    
    
        for (int i = 0; i < eq_parts_pos_info_end; i++)
        {
            if (
                (i == eq_parts_pos_info_RFoot) || 
                (i == eq_parts_pos_info_LFoot) ||
                (i == eq_parts_pos_info_RToe0) || 
                (i == eq_parts_pos_info_LToe0) ||
                (i == eq_parts_pos_info_RToe0Nub) || 
                (i == eq_parts_pos_info_LToe0Nub) ||
                (i == eq_parts_pos_info_LFingerNub) ||
                (i == eq_parts_pos_info_RFingerNub) ||
                (i == eq_parts_pos_info_etc) ||
                (i == eq_parts_pos_info_LClavicle) ||
                (i == eq_parts_pos_info_RClavicle) ||
                (i == eq_parts_pos_info_Effect)) continue;
    
    
    
    
            pNew = new ZEffectBerserkerIconLoop(m_pBerserkerEffect,pObj);
            ((ZEffectBerserkerIconLoop*)pNew)->SetAlignType(2);
            ((ZEffectBerserkerIconLoop*)pNew)->m_type = _RMeshPartsPosInfoType(i);
            Add(pNew);
        }
    }
    Add under:
    Code:
    void ZEffectManager::AddBerserkerCTFIcon(ZObject* pObj){
        ZEffect* pNew;
    
    
        for (int i = 0; i < eq_parts_pos_info_end; i++)
        {
            if (
                (i == eq_parts_pos_info_RFoot) || 
                (i == eq_parts_pos_info_LFoot) ||
                (i == eq_parts_pos_info_RToe0) || 
                (i == eq_parts_pos_info_LToe0) ||
                (i == eq_parts_pos_info_RToe0Nub) || 
                (i == eq_parts_pos_info_LToe0Nub) ||
                (i == eq_parts_pos_info_LFingerNub) ||
                (i == eq_parts_pos_info_RFingerNub) ||
                (i == eq_parts_pos_info_etc) ||
                (i == eq_parts_pos_info_LClavicle) ||
                (i == eq_parts_pos_info_RClavicle) ||
                (i == eq_parts_pos_info_Effect)) continue;
    
    
    
    
            pNew = new ZEffectBerserkerIconLoop(m_pBerserkerCTFEffect,pObj);
            ((ZEffectBerserkerIconLoop*)pNew)->SetAlignType(2);
            ((ZEffectBerserkerIconLoop*)pNew)->m_type = _RMeshPartsPosInfoType(i);
            Add(pNew);
        }
    }
    I'll put it in the tutorial section too. Thanks.

  5. #5
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: CTF Different Berserker Effect

    if you do mate shorten it down using my ways :) thanks for the like.

    sec ill shortern it even more

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

    Re: CTF Different Berserker Effect

    Yeah i agree ^^ It should be shortened but anyhow it works. Good job.

  7. #7
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: CTF Different Berserker Effect

    declarations:
    #define BEffectSize 1
    RMesh* m_pBerserkerEffect[BEffectSize];
    void AddBerserkerIcon(ZObject* pObj,int nType=0);

    Loading(make sure to rename ef_berserker.elu to ef_berserker0.elu and u can add more easilly ef_berserker1.elu and increase BEffectSize):
    char name[40];
    for(int i = 0; i < BEffectSize; i++)
    {
    sprintf(name, "ef_berserker%d", i);
    m_pBerserkerEffect[i] = m_pEffectMeshMgr->Get(name);
    }

    method:
    void ZEffectManager::AddBerserkerIcon(ZObject* pObj, int nType)
    {
    ZEffect* pNew;

    for (int i = 0; i < eq_parts_pos_info_end; i++)
    {
    if (
    (i == eq_parts_pos_info_RFoot) ||
    (i == eq_parts_pos_info_LFoot) ||
    (i == eq_parts_pos_info_RToe0) ||
    (i == eq_parts_pos_info_LToe0) ||
    (i == eq_parts_pos_info_RToe0Nub) ||
    (i == eq_parts_pos_info_LToe0Nub) ||
    (i == eq_parts_pos_info_LFingerNub) ||
    (i == eq_parts_pos_info_RFingerNub) ||
    (i == eq_parts_pos_info_etc) ||
    (i == eq_parts_pos_info_LClavicle) ||
    (i == eq_parts_pos_info_RClavicle) ||
    (i == eq_parts_pos_info_Effect)) continue;


    pNew = new ZEffectBerserkerIconLoop(m_pBerserkerEffect[nType],pObj);
    ((ZEffectBerserkerIconLoop*)pNew)->SetAlignType(2);
    ((ZEffectBerserkerIconLoop*)pNew)->m_type = _RMeshPartsPosInfoType(i);
    Add(pNew);
    }
    }

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

    Re: CTF Different Berserker Effect

    Quote Originally Posted by own_prox View Post
    declarations:
    #define BEffectSize 1
    RMesh* m_pBerserkerEffect[BEffectSize];
    void AddBerserkerIcon(ZObject* pObj,int nType=0);

    Loading(make sure to rename ef_berserker.elu to ef_berserker0.elu and u can add more easilly ef_berserker1.elu and increase BEffectSize):
    char name[40];
    for(int i = 0; i < BEffectSize; i++)
    {
    sprintf(name, "ef_berserker%d", i);
    m_pBerserkerEffect[i] = m_pEffectMeshMgr->Get(name);
    }

    method:
    void ZEffectManager::AddBerserkerIcon(ZObject* pObj, int nType)
    {
    ZEffect* pNew;

    for (int i = 0; i < eq_parts_pos_info_end; i++)
    {
    if (
    (i == eq_parts_pos_info_RFoot) ||
    (i == eq_parts_pos_info_LFoot) ||
    (i == eq_parts_pos_info_RToe0) ||
    (i == eq_parts_pos_info_LToe0) ||
    (i == eq_parts_pos_info_RToe0Nub) ||
    (i == eq_parts_pos_info_LToe0Nub) ||
    (i == eq_parts_pos_info_LFingerNub) ||
    (i == eq_parts_pos_info_RFingerNub) ||
    (i == eq_parts_pos_info_etc) ||
    (i == eq_parts_pos_info_LClavicle) ||
    (i == eq_parts_pos_info_RClavicle) ||
    (i == eq_parts_pos_info_Effect)) continue;


    pNew = new ZEffectBerserkerIconLoop(m_pBerserkerEffect[nType],pObj);
    ((ZEffectBerserkerIconLoop*)pNew)->SetAlignType(2);
    ((ZEffectBerserkerIconLoop*)pNew)->m_type = _RMeshPartsPosInfoType(i);
    Add(pNew);
    }
    }
    I'll add this to the tut but where do I need to put this:
    Code:
    char name[40];
    for(int i = 0; i < BEffectSize; i++)
    {
    sprintf(name, "ef_berserker%d", i);
    m_pBerserkerEffect[i] = m_pEffectMeshMgr->Get(name); 
    }

  9. #9
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: CTF Different Berserker Effect

    delete m_pBerserkerEffect = m_pEffectMeshMgr->Get("ef_berserker"); and place it there

    also give me some credits in the tut :) <3

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

    Re: CTF Different Berserker Effect

    Yeah for sure. I added the lines from your comment, but how does the CTF mode know which one to pick?

  11. #11
    Rival Gamers Owner own_prox is offline
    MemberRank
    Jul 2007 Join Date
    HellLocation
    1,077Posts

    Re: CTF Different Berserker Effect

    AddBerserkerIcon(pObj, 0) for berserker
    AddBerserkerIcon(pObj, 1) for ctf



Advertisement