Jump to content
×
×
  • Create New...
  • 0

Disable collision everywhere besides duel


dumita123

Question

Hi!

 

How can I disable collision everywhere with players but enable it while in a duel?

I have tried it myself in TestCollision but I can only disable the collision, while in duel I don't know how to enable it only while you are in duel.

Edited by dumita123
Link to comment
Share on other sites

  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

4 answers to this question

Recommended Posts

  • 0

I have tried like this but it isn't compiling because of some external issues, I tried adapting @VegaS™ 's code for disabling auto attack in duel into disabling collision everywhere besides duel but I failed.

BOOL CInstanceBase::CheckAdvancing()
{
    DWORD dwVID;
    CInstanceBase* NEW_GetMainActorPtr();
        static auto& rkChrMgr2 = CPythonCharacterManager::Instance();
        const auto& pkInstMain = NEW_GetMainActorPtr();
        const auto& pkInstVictim = rkChrMgr2.GetInstancePtr(dwVID);
        if (pkInstMain && pkInstVictim)
        {
            if (CInstanceBase::__FindPVPKey(pkInstMain->GetVirtualID(), pkInstVictim->GetVirtualID()))
            {
                return TRUE;
            }
            else
            {
                return FALSE;
            }
        }

#ifdef __MOVIE_MODE__
    if (IsMovieMode())
        return FALSE;
#endif
    if (!__IsMainInstance() && !IsAttacking())
    {
        if (IsPC() && IsWalking())
        {
            CPythonCharacterManager& rkChrMgr=CPythonCharacterManager::Instance();
            for(CPythonCharacterManager::CharacterIterator i = rkChrMgr.CharacterInstanceBegin(); i!=rkChrMgr.CharacterInstanceEnd();++i)
            {
                CInstanceBase* pkInstEach=*i;
                if (pkInstEach==this)
                    continue;
                if (!pkInstEach->IsDoor())
                    continue;

                if (m_GraphicThingInstance.TestActorCollision(pkInstEach->GetGraphicThingInstanceRef()))
                {
                    BlockMovement();
                    return true;
                }
            }                
        }
        return FALSE;
    }

    if (m_GraphicThingInstance.CanSkipCollision())
    {
        return FALSE;
    }

    BOOL bUsingSkill = m_GraphicThingInstance.IsUsingSkill();

    m_dwAdvActorVID = 0;
    UINT uCollisionCount=0;

    CPythonCharacterManager& rkChrMgr=CPythonCharacterManager::Instance();
    for(CPythonCharacterManager::CharacterIterator i = rkChrMgr.CharacterInstanceBegin(); i!=rkChrMgr.CharacterInstanceEnd();++i)
    {
        CInstanceBase* pkInstEach=*i;
        if (pkInstEach==this)
            continue;

        CActorInstance& rkActorSelf=m_GraphicThingInstance;
        CActorInstance& rkActorEach=pkInstEach->GetGraphicThingInstanceRef();

        //NOTE : SkilÀ» ¾²´õ¶óµµ Door Type°ú´Â Collisionüũ ÇÑ´Ù.
        if( bUsingSkill && !rkActorEach.IsDoor() )
            continue;
            
        // ¾ÕÀ¸·Î ÀüÁøÇÒ¼ö Àִ°¡?
        if (rkActorSelf.TestActorCollision(rkActorEach))
        {
            uCollisionCount++;
            if (uCollisionCount==2)
            {
                rkActorSelf.BlockMovement();
                return TRUE;
            }
            rkActorSelf.AdjustDynamicCollisionMovement(&rkActorEach);

            if (rkActorSelf.TestActorCollision(rkActorEach))
            {
                rkActorSelf.BlockMovement();
                return TRUE;
            }
            else
            {
                NEW_MoveToDestPixelPositionDirection(NEW_GetDstPixelPositionRef());
            }
        }
    }

    // ¸Ê¼Ó¼º üũ
    CPythonBackground& rkBG=CPythonBackground::Instance();
    const D3DXVECTOR3 & rv3Position = m_GraphicThingInstance.GetPosition();
    const D3DXVECTOR3 & rv3MoveDirection = m_GraphicThingInstance.GetMovementVectorRef();

    // NOTE : ¸¸¾à À̵¿ °Å¸®°¡ Å©´Ù¸é ÂÉ°³¼­ ±¸°£ º°·Î ¼Ó¼ºÀ» üũÇØ º»´Ù
    //        ÇöÀç ¼³Á¤ÇØ ³õÀº 10.0f´Â ÀÓÀÇÀÇ °Å¸® - [levites]
    int iStep = int(D3DXVec3Length(&rv3MoveDirection) / 10.0f);
    D3DXVECTOR3 v3CheckStep = rv3MoveDirection / float(iStep);
    D3DXVECTOR3 v3CheckPosition = rv3Position;
    for (int j = 0; j < iStep; ++j)
    {
        v3CheckPosition += v3CheckStep;

        // Check
        if (rkBG.isAttrOn(v3CheckPosition.x, -v3CheckPosition.y, CTerrainImpl::ATTRIBUTE_BLOCK))
        {
            BlockMovement();
            //return TRUE;
        }
    }

    // Check
    D3DXVECTOR3 v3NextPosition = rv3Position + rv3MoveDirection;
    if (rkBG.isAttrOn(v3NextPosition.x, -v3NextPosition.y, CTerrainImpl::ATTRIBUTE_BLOCK))
    {
        BlockMovement();
        return TRUE;
    }

    return FALSE;
}

 

Edited by dumita123
Link to comment
Share on other sites

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.