[Tutorial] Rotation 180º Char [FrontEnd]

Results 1 to 4 of 4
  1. #1
    My Status --> LukasCCB is offline
    MemberRank
    Apr 2013 Join Date
    CracolandiaLocation
    1,190Posts

    note [Tutorial] Rotation 180º Char [FrontEnd]

    Demo:

    Find

    Code:
    static int LoginMenuExitFlag = 0;
    and add code below!
    Code:
    static float playerRot = 0;
    Find

    Code:
    m_Player->SetPosition(playerPosCreate);
    and add code below!
    In red text you can edit and put other key.
    Code:
     int mMX=Mouse->m_MouseMoveX;    float glb_MouseSensAdj = 1.0f;  // in range (0.1 - 1.0)    float mmoveX = float(-mMX) * glb_MouseSensAdj;    if( Mouse->IsPressed(r3dMouse::mRightButton) )    {        playerRot += mmoveX;         if(playerRot > 180)  playerRot = 180;        if(playerRot < -180) playerRot = -180;    }
    Find

    Code:
    m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = 0;
    and replace this code
    Code:
    m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = playerRot;

    Credits: I do not remember, call me for real credit


  2. #2
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,040Posts

    Re: [Tutorial] Rotation 180º Char [FrontEnd]

    Nothing to do I did this fucking code like this a two or three years ago with mouse position manipulation and with object manipulation only rotates if the mouse is over the area or over the object

    Here is only with the mouse position manipulation

    Search for:
    Code:
    m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = 0;
    Modify to:
    Code:
    if(Mouse->IsPressed(r3dMouse::mLeftButton)) // Rotação do Personagem By Yuri-BR
        {
            extern     PlayerStateVars_s CurrentRig;
            float  glb_MouseSensAdj = CurrentRig.MouseSensetivity * g_mouse_sensitivity->GetFloat();    
    
    
            int mmX = Mouse->m_MouseMoveX;
            int mmY = Mouse->m_MouseMoveY;
    
    
            float moveX = float(-mmX) * glb_MouseSensAdj;
            float moveY = float(-mmY) * glb_MouseSensAdj;
    
    
            int mx, my;
            Mouse->GetXY(mx, my);
    
    
            if(mx >= 400 && mx <= 900 && my >= 100 && my <= 700)
                m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation += moveX;
    
    
            if(m_Player->m_fPlayerRotationTarget > 180)  
                m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = 180;
            if(m_Player->m_fPlayerRotationTarget < -180)  
                m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = -180;
    
    
        }
    With object manipulation I can not find...
    Last edited by Yuri-BR; 24-07-17 at 02:40 AM.

  3. #3
    Account Upgraded | Title Enabled! IKaruzI15 is offline
    MemberRank
    May 2017 Join Date
    197Posts

    Re: [Tutorial] Rotation 180º Char [FrontEnd]

    lul thats my code...

    Code:
    if (Mouse->IsPressed(r3dMouse::mRightButton))
        {
            save = 1;
    
            r3dVector CamPos(0,0,0);
            int mMX=Mouse->m_MouseMoveX;
            float  glb_MouseSensAdj = g_mouse_sensitivity->GetFloat();
    
            static float camangle = 0;
                        
            camangle += float(-mMX) * glb_MouseSensAdj;
    
            if(m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation > 360.0f ) m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = 0.0f;
            if(m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation < -0.0f )   m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = -0.0f;
    
            m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = -camangle;
        }

  4. #4
    TruCore ES3N1N is offline
    MemberRank
    Nov 2018 Join Date
    UkraineLocation
    221Posts
    Quote Originally Posted by IKaruzI15 View Post
    lul thats my code...

    Code:
    if (Mouse->IsPressed(r3dMouse::mRightButton))
        {
            save = 1;
    
            r3dVector CamPos(0,0,0);
            int mMX=Mouse->m_MouseMoveX;
            float  glb_MouseSensAdj = g_mouse_sensitivity->GetFloat();
    
            static float camangle = 0;
                        
            camangle += float(-mMX) * glb_MouseSensAdj;
    
            if(m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation > 360.0f ) m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = 0.0f;
            if(m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation < -0.0f )   m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = -0.0f;
    
            m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = -camangle;
        }
    change it



    code:
    m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = -camangle;
    }

    add after:

    else
    m_Player->m_fPlayerRotationTarget = m_Player->m_fPlayerRotation = 0;



Advertisement