[Tutorial] Enabling vehicles, Only work on Studio.exe by now

Page 1 of 13 12345678911 ... LastLast
Results 1 to 25 of 319
  1. #1
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    This tutorial only work on Studio.exe, not is finised, not work on server, need many fix more, if you want help, please write here

    Only tested on DNC Education emulator

    To drive the vehicles use the arrows

    is recommended to use Phyxs 3.2.3 and Apex 1.2.3 for Phyxs 3.2.3

    Phyxs 3.2.3: https://mega.co.nz/#!col10I4Y!PDND-D...3TNkbPXfB4QBGM
    Apex 1.2.3 for Phyxs 3.2.3: https://mega.co.nz/#!x4URAKCQ!EmPeqn...79FddXbHLG52w4

    Search on r3dPCH.h

    Replace:

    Code:
    #define APEX_ENABLED 0
    #ifdef FINAL_BUILD
        #define VEHICLES_ENABLED 0
    #else 
    #ifndef WO_SERVER
        #define VEHICLES_ENABLED 0 // temp disabled due to new PhysX API changes
    #else
        #define VEHICLES_ENABLED 0
    #endif
    To:

    Code:
    #define APEX_ENABLED 0
    #ifdef FINAL_BUILD
        #define VEHICLES_ENABLED 1
    #else 
    #ifndef WO_SERVER
        #define VEHICLES_ENABLED 1 // temp disabled due to new PhysX API changes
    #else
        #define VEHICLES_ENABLED 1
    #endif
    if you have problems with d_drive_vehicles then search:

    Code:
    #if VEHICLES_ENABLED
    REG_VAR( d_drive_vehicles,            false,            0 );
    #endif // VEHICLES_ENABLED
    #endif // FINAL BUILD
    Replace to:

    Code:
    #endif // FINAL BUILD
    #if VEHICLES_ENABLED
    REG_VAR( d_drive_vehicles,            false,            0 );
    #endif // VEHICLES_ENABLED

    Search on VehicleManager.cpp

    PxInitVehicleSDK(*g_pPhysicsWorld->PhysXSDK);

    Replace:

    Code:
        const PxMaterial *mats[] = {g_pPhysicsWorld->defaultMaterial};
        surfaceTypePairs = PxVehicleDrivableSurfaceToTireFrictionPairs::create(MAX_NUM_TYRE_TYPES, MAX_NUM_SURFACE_TYPES, mats, &drivableSurfaceType);
    To:

    Code:
        surfaceTypePairs = PxVehicleDrivableSurfaceToTireFrictionPairs::allocate(MAX_NUM_TYRE_TYPES,MAX_NUM_SURFACE_TYPES);
        const PxMaterial *mats[] = {g_pPhysicsWorld->defaultMaterial};
        surfaceTypePairs->setup(MAX_NUM_TYRE_TYPES, MAX_NUM_SURFACE_TYPES, mats, &drivableSurfaceType);
    Search for (uint32_t i = 0; i < wheelMeshes.Count(); ++i


    Code:
        for (uint32_t i = 0; i < wheelMeshes.Count(); ++i)
        {
            Vertices &v = wheelMeshes[i];
            wheels[i] = CreateWheelConvexMesh(&v[0], v.Count());
        }
    
        PxVehicleWheelsSimData *wheelsData = PxVehicleWheelsSimData::allocate(vd->numWheels);
        PxVehicleDriveSimData4W driveData;
    
        bool result = CreateVehicleSimData(*vd, *hull, const_cast<const PxConvexMesh**>(wheels), *wheelsData, driveData); result;
        r3d_assert(result);
    
        PxRigidDynamic *vehActor = CreateVehicleActor(*vd, *hull, wheels);
        r3d_assert(vehActor);
    
        vd->vehicle = PxVehicleDrive4W::allocate(vd->numWheels);
        vd->vehicle->setup(g_pPhysicsWorld->PhysXSDK, vehActor, *wheelsData, driveData, std::max<int>(vd->numWheels - 4, 0));
    TO:

    Code:
        for (uint32_t i = 0; i < wheelMeshes.Count(); ++i)
        {
            Vertices &v = wheelMeshes[i];
            wheels[i] = CreateWheelConvexMesh(&v[0], v.Count());
        }
    
        PxVehicleWheelsSimData *wheelsData = PxVehicleWheelsSimData::allocate(vd->numWheels);
        PxVehicleDriveSimData4W driveData;
    
        bool result = CreateVehicleSimData(*vd, *hull, const_cast<const PxConvexMesh**>(wheels), *wheelsData, driveData); result;
        r3d_assert(result);
    
        PxRigidDynamic *vehActor = CreateVehicleActor(*vd, *hull, wheels);
        r3d_assert(vehActor);
    
        vd->vehicle = PxVehicleDrive4W::allocate(vd->numWheels);
    
        vd->vehicle->setup(g_pPhysicsWorld->PhysXSDK, vehActor, *wheelsData, driveData, std::max<int>(vd->numWheels-4, 0));
    
        if (m->FileName == "data/objectsdepot/vehicles/drivable_stryker.sco") {
            vd->vehicle->setWheelShapeMapping(0, 0);
            vd->vehicle->setWheelShapeMapping(1, 1);
            vd->vehicle->setWheelShapeMapping(2, 2);
            vd->vehicle->setWheelShapeMapping(3, 3);
            vd->vehicle->setWheelShapeMapping(4, 4);
            vd->vehicle->setWheelShapeMapping(5, 5);
            vd->vehicle->setWheelShapeMapping(6, 6);
            vd->vehicle->setWheelShapeMapping(7, 7);
    
        }
        else {
            vd->vehicle->setWheelShapeMapping(0, 0);
            vd->vehicle->setWheelShapeMapping(1, 1);
            vd->vehicle->setWheelShapeMapping(2, 2);
            vd->vehicle->setWheelShapeMapping(3, 3);
        }
    Now go to \ Data \ ObjectsDepot \ GAMEPLAY \ Objects.dat and edit

    Replace:

    Code:
    9
    PlayerSpawnPoint obj_PlayerSpawnPoint
    ItemSpawnPoint obj_ItemSpawnPoint
    PostBox obj_PostBox
    AmbientSound obj_AmbientSound
    MusicTriggerArea obj_MusicTriggerArea
    ReverbZone obj_ReverbZone
    ReverbZoneBox obj_ReverbZoneBox
    ZombieSpawn obj_ZombieSpawn
    PermanentNote obj_PermanentNote
    TO:

    Code:
    10PlayerSpawnPoint obj_PlayerSpawnPoint
    ItemSpawnPoint obj_ItemSpawnPoint
    PostBox obj_PostBox
    AmbientSound obj_AmbientSound
    MusicTriggerArea obj_MusicTriggerArea
    ReverbZone obj_ReverbZone
    ReverbZoneBox obj_ReverbZoneBox
    ZombieSpawn obj_ZombieSpawn
    PermanentNote obj_PermanentNote
    VehicleSpawn obj_VehicleSpawn
    Search on HUD_TPSGame.cpp

    Code:
    wasDrivenByPlayer = true;
    replace with this

    Code:
                if(Keyboard->WasPressed(kbsE))
                   wasDrivenByPlayer = true;
    Now Search
    Code:
            // vehicles        if(InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_INTERACT) )
            {
    #if VEHICLES_ENABLED
                obj_Vehicle* target_Vehicle = pl->canEnterVehicle();
            
                if( pl->isInVehicle() ) {
                    pl->exitVehicle();
                }
                else if ( target_Vehicle  ) // now we're going to try to use vehicles (otherwise UAV characters can't use vehicles).
                {
                    pl->enterVehicle( target_Vehicle );
                }
    #endif
            }
    Replace To:

    Code:
            // vehicles
            if(InputMappingMngr->wasPressed(r3dInputMappingMngr::KS_INTERACT) )
            {
    #if VEHICLES_ENABLED
                if( pl->isInVehicle() )
                {
                    pl->exitVehicle();
                }
                else
                {
                    obj_Vehicle* target_Vehicle = pl->canEnterVehicle();
    
    
                    if ( target_Vehicle  ) // now we're going to try to use vehicles (otherwise UAV characters can't use vehicles).
                        pl->enterVehicle( target_Vehicle );
                        g_pPhysicsWorld->m_VehicleManager->DriveCar(target_Vehicle->vd);
                }
    #endif
            }
    Search on AI_Player.cpp

    Code:
    static const float gDist_To_Allow_Vehicle_Entry = 5;
    Replace to:

    Code:
    static const float gDist_To_Allow_Vehicle_Entry = 3.1;
    and

    Code:
    if( distSq < gDist_To_Allow_Vehicle_Entry * gDist_To_Allow_Vehicle_Entry )
    replace:

    Code:
    if( distSq < gDist_To_Allow_Vehicle_Entry )
    now this:

    Code:
    void obj_Player::exitVehicle()
    {
    
    
        // first let's look for a good location
        obj_Vehicle* currentCar = g_pPhysicsWorld->m_VehicleManager->getRealDrivenVehicle();
        r3d_assert(currentCar);
    
    
    
    
        r3dVector rotationVector = currentCar->GetRotationVector();
        r3dMatrix Matrix;
        // NOTE: We might want to take out rotation in the x or z direction and only focus on the Y direction... 
        r3dBuildRotationMatrix(Matrix, rotationVector );
    
    
        bool success = false;
        for ( int exitIndex = 0; exitIndex < 4; exitIndex++  )
        {
            r3dVector exitPosition;
            bool returnValue = currentCar->getExitSpace( exitPosition, exitIndex );
            r3d_assert( returnValue );
    
    
            exitPosition *= Matrix;
            r3dVector targetPosition = currentCar->GetPosition() + exitPosition; 
    
    
            if ( TestExitPosition( targetPosition) )
            {
                TeleportPlayer( targetPosition, "Exiting vehicle");
                success = true;
                break;
            }
        }
    Replace To:

    Code:
    void obj_Player::exitVehicle()
    {
        // first let's look for a good location
        obj_Vehicle* currentCar = g_pPhysicsWorld->m_VehicleManager->getRealDrivenVehicle();
        r3d_assert(currentCar);
    
    
        r3dVector rotationVector = currentCar->GetRotationVector();
        r3dMatrix Matrix;
        // NOTE: We might want to take out rotation in the x or z direction and only focus on the Y direction... 
        r3dBuildRotationMatrix(Matrix, rotationVector );
    
    
        bool success = false;
        for ( int exitIndex = 0; exitIndex < 4; exitIndex++  )
        {
            r3dVector exitPosition;
            bool returnValue = currentCar->getExitSpace( exitPosition, exitIndex );
            // r3d_assert( returnValue );
    
    
            if( !returnValue )
                continue;
    
    
            exitPosition *= Matrix;
            r3dVector targetPosition = currentCar->GetPosition() + exitPosition; 
    
    
            if ( TestExitPosition( targetPosition) )
            {
                TeleportPlayer( targetPosition, "Exiting vehicle");
                success = true;
                break;
            }
        }
    Now go to obj_VehicleSpawn.cpp

    Code:
    void obj_VehicleSpawn::DoDraw()
    {
    #ifndef FINAL_BUILD
    #if VEHICLES_ENABLED
        if( g_Manipulator3d.IsSelected(this) || ( spawnedVehicle != NULL && g_Manipulator3d.IsSelected(spawnedVehicle)) )
    #else
        if( g_Manipulator3d.IsSelected(this) )
    #endif
        {
            r3dColor clr = r3dColor::blue;
            r3dRenderer->SetRenderingMode( R3D_BLEND_ALPHA | R3D_BLEND_ZC );
    
            clr.A = 196;
            r3dBoundBox localBBox = GetBBoxLocal();
            r3dBoundBox bbox;
            bbox.Org = GetPosition();// - 0.5f * m_bboxSize;
            bbox.Org.y += .5f * localBBox.Size.y ;
            bbox.Size = localBBox.Size;
    
            r3dVector rotation = GetRotationVector();
            // there's a bug with rotation so I've to swap the axis.
            float temp;
            temp = rotation.y;
            rotation.y = rotation.x;
            rotation.x = temp;
    
            r3dDrawOrientedBoundBox( bbox, rotation, gCam, clr );
    
            // r3dDrawUniformSphere ( GetPosition(), m_maxDist, gCam, clr );
            r3dRenderer->Flush();
        }
    #endif
    }
    Replace To:

    Code:
    void obj_VehicleSpawn::DoDraw()
    {
    //#ifndef FINAL_BUILD
    #if VEHICLES_ENABLED
    /*    if( g_Manipulator3d.IsSelected(this) || ( spawnedVehicle != NULL && g_Manipulator3d.IsSelected(spawnedVehicle)) )
    #else
        if( g_Manipulator3d.IsSelected(this) )
    #endif
        {*/
            r3dColor clr = r3dColor::blue;
            r3dRenderer->SetRenderingMode( R3D_BLEND_ALPHA | R3D_BLEND_ZC );
    
            clr.A = 196;
            r3dBoundBox localBBox = GetBBoxLocal();
            r3dBoundBox bbox;
            bbox.Org = GetPosition();// - 0.5f * m_bboxSize;
            bbox.Org.y += .5f * localBBox.Size.y ;
            bbox.Size = localBBox.Size;
    
            r3dVector rotation = GetRotationVector();
            // there's a bug with rotation so I've to swap the axis.
            float temp;
            temp = rotation.y;
            rotation.y = rotation.x;
            rotation.x = temp;
    
            r3dDrawLine3D(GetPosition(), GetPosition() + r3dPoint3D(0, 20.0f, 0), gCam, 0.4f, r3dColor(242, 64, 0));
            r3dDrawCircle3D(GetPosition(), 2.0f, gCam, 0.4f, r3dColor(242, 255, 0));
            r3dRenderer->Flush();
    /*    }*/
    #endif
    }
    Now go to HUD_TPSGame.cpp

    Code:
    #if    VEHICLE_CINEMATIC_MODE
                r3dVector CamPos = vehicle->GetPosition();
                CamPos += r3dPoint3D( 0, ( 5 ), 0 );
    
                int mMX=Mouse->m_MouseMoveX, mMY=Mouse->m_MouseMoveY;
                float  glb_MouseSensAdj = CurrentRig.MouseSensetivity * g_mouse_sensitivity->GetFloat();
    
                static float camangle = 0;
    
                camangle += float(-mMX) * glb_MouseSensAdj;
    
                if(camangle > 360.0f ) camangle = camangle - 360.0f;
                if(camangle < 0.0f )   camangle = camangle + 360.0f;
    
    
                D3DXMATRIX mr;
                D3DXMatrixRotationYawPitchRoll(&mr, R3D_DEG2RAD(-camangle), 0.0f, 0);
                r3dVector vehicleForwardVector = r3dVector(mr ._31, mr ._32, mr ._33);
    
                CamPos += -vehicleForwardVector * 8 ;
    
                Cam.SetPosition(CamPos);
                Cam.PointTo( CamPos + vehicleForwardVector * 3 + r3dVector ( 0, -1, 0) );
                Cam.vUP = r3dPoint3D(0, 1, 0);
    #else
                g_pPhysicsWorld->m_VehicleManager->ConfigureCamera(Cam);
    #endif

    New Camera, is manual with Mouse

    Code:
    //#if    VEHICLE_CINEMATIC_MODE
                r3dVector CamPos = vehicle->GetPosition();
                CamPos += r3dPoint3D( 0, ( 5 ), 0 );
    
                int mMX=Mouse->m_MouseMoveX, mMY=Mouse->m_MouseMoveY;
                float  glb_MouseSensAdj = CurrentRig.MouseSensetivity * g_mouse_sensitivity->GetFloat();
    
                static float camangle = 0;
                static float camangle2 = 0;
                camangle += float(-mMX) * glb_MouseSensAdj;
                camangle2 += float(-mMY) * glb_MouseSensAdj;
    
                if(camangle > 360.0f ) camangle = camangle - 360.0f;
                if(camangle < 0.0f )   camangle = camangle + 360.0f;
    
                if(camangle2 > 30.0f ) camangle2 = 30.0f;
                if(camangle2 < -25.0f )   camangle2 = -25.0f;
    
    
                D3DXMATRIX mr;
                D3DXMatrixRotationYawPitchRoll(&mr, R3D_DEG2RAD(-camangle), R3D_DEG2RAD(-camangle2), 0);
                r3dVector vehicleForwardVector = r3dVector(mr ._31, mr ._32, mr ._33);
    
                CamPos += -vehicleForwardVector * 8 ;
    
                Cam.SetPosition(CamPos);
                Cam.PointTo( CamPos + vehicleForwardVector * 3 + r3dVector ( 0, -1, 0) );
                Cam.vUP = r3dPoint3D(0, 1, 0);
    //#else
    //            g_pPhysicsWorld->m_VehicleManager->ConfigureCamera(Cam);
    //#endif
    Search on Main.cpp

    Search switch( r_shadows_quality->GetInt() )

    replace this:
    Code:
            case 1:
                r_transp_shadows->SetInt( 0 ) ;
                r_terra_shadows->SetInt( 0 );
                r_shadow_blur->SetInt( 0 );
                r_dir_sm_size->SetInt( MAX_DIR_TEX_SIZE );
                r_shared_sm_size->SetInt( 1024 );
                r_shared_sm_cube_size->SetInt( 1024 );
                r_active_shadow_slices->SetInt( NumShadowSlices - 2 );
                r3d_assert( r_active_shadow_slices->GetInt() ) ;
                r_shadows->SetInt( 1 );
                r_dd_pointlight_shadows->SetInt( 0 );
                ShadowSplitDistancesOpaque = &ShadowSplitDistancesOpaqueLow[0];
                break;
    for this
    Code:
        
            case 1:
                r_transp_shadows->SetInt( 0 ) ;
                r_terra_shadows->SetInt( 0 );
                r_shadow_blur->SetInt( 1 );
                r_dir_sm_size->SetInt( MAX_DIR_TEX_SIZE );
                r_shared_sm_size->SetInt( 1024 );
                r_shared_sm_cube_size->SetInt( 1024 );
                r_active_shadow_slices->SetInt( NumShadowSlices - 1 );
                r_shadows->SetInt( 1 );
                r_dd_pointlight_shadows->SetInt( 0 );
                ShadowSplitDistancesOpaque = &ShadowSplitDistancesOpaqueLow[0];
                break;
    And now need this files

    for install this fix go to Data\ObjectsDepot and delete this folders

    WZ_CityBuildings
    WZ_CityDecay
    WZ_CityProps
    WZ_CityStreets
    WZ_InteriorProps
    WZ_Military
    WZ_Nature
    WZ_NatureAmbient
    WZ_RoadObjects
    WZ_Settlement
    WZ_Signs
    WZ_Terrain
    WZ_TownBuildings
    WZ_TownProps
    WZ_Walls

    and put this folder of the zip, remember no replace

    https://mega.co.nz/#!E4tlWIbb!AlOKND...ExZStAe7Y4qHgY


    fixed driving power reversing giving equal selected graphic quality.

    VehicleManager.cpp

    Search this:

    Code:
    void VehicleManager::DoUserCarControl(float timeStep)
    {
        if (!drivableCar)
            return;
    
        PxVehicleDrive4W &car = *drivableCar->vehicle;
    
        //Work out if the car is to flip from reverse to forward gear or from forward gear to reverse.
        bool toggleAutoReverse = false;
        if (car.mDriveDynData.getUseAutoGears())
        {
            toggleAutoReverse = ProcessAutoReverse(timeStep);
        }
    
        //If the car is to flip gear direction then switch gear as appropriate.
        if(toggleAutoReverse)
        {
            mInReverseMode = !mInReverseMode;
    
            if(mInReverseMode)
            {
                car.mDriveDynData.forceGearChange(PxVehicleGearsData::eREVERSE);
            }
            else
            {
                car.mDriveDynData.forceGearChange(PxVehicleGearsData::eFIRST);
            }
        }
    
        //If in reverse mode then swap the accel and brake.
        if(mInReverseMode)
        {
            const bool accel = carControlData.getDigitalAccel();
            const bool brake = carControlData.getDigitalBrake();
            carControlData.setDigitalAccel(brake);
            carControlData.setDigitalBrake(accel);
        }
    
          PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs(gKeySmoothingData,  gSteerVsForwardSpeedTable, carControlData, timeStep, car);
        clearInputData = true;
    }
    To this:

    Code:
    void VehicleManager::DoUserCarControl(float timeStep)
    {
        if (!drivableCar)
            return;
    
        PxVehicleDrive4W &car = *drivableCar->vehicle;
    
        //Work out if the car is to flip from reverse to forward gear or from forward gear to reverse.
        bool toggleAutoReverse = false;
        if (car.mDriveDynData.getUseAutoGears())
        {
            toggleAutoReverse = ProcessAutoReverse(timeStep);
        }
    
        //If the car is to flip gear direction then switch gear as appropriate.
        if(toggleAutoReverse)
        {
            mInReverseMode = !mInReverseMode;
    
        }
    
        //If in reverse mode then swap the accel and brake.
        if(mInReverseMode)
        {
            carControlData.setDigitalAccel(false);
            carControlData.setDigitalBrake(false);
            carControlData.setDigitalAccel(carControlData.getDigitalAccel() || Keyboard->IsPressed(kbsUp));
            carControlData.setDigitalBrake(carControlData.getDigitalBrake() || Keyboard->IsPressed(kbsDown));
    
            car.mDriveDynData.forceGearChange(PxVehicleGearsData::eREVERSE);
            const bool accel = carControlData.getDigitalAccel();
            const bool brake = carControlData.getDigitalBrake();
            carControlData.setDigitalAccel(brake);
            carControlData.setDigitalBrake(accel);
        }
        else {
            carControlData.setDigitalAccel(false);
            carControlData.setDigitalBrake(false);
            carControlData.setDigitalAccel(carControlData.getDigitalAccel() || Keyboard->IsPressed(kbsUp));
            carControlData.setDigitalBrake(carControlData.getDigitalBrake() || Keyboard->IsPressed(kbsDown));
    
            car.mDriveDynData.forceGearChange(PxVehicleGearsData::eFIRST);
            const bool accel = carControlData.getDigitalAccel();
            const bool brake = carControlData.getDigitalBrake();
            carControlData.setDigitalAccel(accel);
            carControlData.setDigitalBrake(brake);
        }
    
          PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs(gKeySmoothingData,  gSteerVsForwardSpeedTable, carControlData, timeStep, car);
        clearInputData = true;
    }
    try to make it work with the keys A W S D but conflicts with the S key and does not work

    Some videos







    Thx to:
    billyolak7
    Leandro Lima
    jonnybravo
    Novoc
    Kratos147
    CoDexPo (Me haha)

    I will not forget anything or anyone, I created this tutorial but there is another that is very confusing and not update the main post.

    To drive, use arrows

    for when the buggy tipping and its background is not transparent CR_Buggy_01.mat edit the file doublesided = 0 to DoubleSided = 1 and save

    to avoid the mistake of "VehicleSetupDrivableShapeQueryFilterData not found" when compiling the server, install this patch, does not mean you run the vehicles on the server but will avoid the error when you VEHICLES_ENABLED to 1

    Compilation only for the server, for install C:\WarZ\
    Only Check on DNC Education
    Replace files

    The file is Patch2.7z

    and:

    PLEASE HELP!!!
    Attached Files Attached Files
    Last edited by CodexPo; 27-09-13 at 11:14 PM.


  2. #2
    Valued Member DarkAngelBR is offline
    MemberRank
    Mar 2013 Join Date
    My HouseLocation
    140Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    I tested in alpha source and its working too.

  3. #3
    Enthusiast kyllersoul is offline
    MemberRank
    Nov 2009 Join Date
    30Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Did not quite understand the location of these files ... Apex and Physx

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

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Quote Originally Posted by kyllersoul View Post
    Did not quite understand the location of these files ... Apex and Physx

    WarZ\src\External

  5. #5
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Apex: src\External\Apex
    PhysX: src\External\PhysX

  6. #6
    Enthusiast kasami2620 is offline
    MemberRank
    Aug 2013 Join Date
    27Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    what is hotkey use vehicles ??

  7. #7
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Thanks Codex)))

  8. #8
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    to avoid the mistake of "VehicleSetupDrivableShapeQueryFilterData not found" when compiling the server, install this patch, does not mean you run the vehicles on the server but will avoid the error when you VEHICLES_ENABLED to 1

    Compilation only for the server, for install C:\WarZ\
    Only Check on DNC Education
    Replace files

    now yes, sorry by the bug
    Attached Files Attached Files
    Last edited by CodexPo; 22-09-13 at 05:14 PM.

  9. #9
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    fixed driving power reversing giving equal selected graphic quality.

    VehicleManager.cpp

    Search this:

    Code:
    void VehicleManager::DoUserCarControl(float timeStep)
    {
        if (!drivableCar)
            return;
    
        PxVehicleDrive4W &car = *drivableCar->vehicle;
    
        //Work out if the car is to flip from reverse to forward gear or from forward gear to reverse.
        bool toggleAutoReverse = false;
        if (car.mDriveDynData.getUseAutoGears())
        {
            toggleAutoReverse = ProcessAutoReverse(timeStep);
        }
    
        //If the car is to flip gear direction then switch gear as appropriate.
        if(toggleAutoReverse)
        {
            mInReverseMode = !mInReverseMode;
    
            if(mInReverseMode)
            {
                car.mDriveDynData.forceGearChange(PxVehicleGearsData::eREVERSE);
            }
            else
            {
                car.mDriveDynData.forceGearChange(PxVehicleGearsData::eFIRST);
            }
        }
    
        //If in reverse mode then swap the accel and brake.
        if(mInReverseMode)
        {
            const bool accel = carControlData.getDigitalAccel();
            const bool brake = carControlData.getDigitalBrake();
            carControlData.setDigitalAccel(brake);
            carControlData.setDigitalBrake(accel);
        }
    
        PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs(gKeySmoothingData, gSteerVsForwardSpeedTable, carControlData, timeStep, car);
        clearInputData = true;
    }
    To this:

    Code:
    void VehicleManager::DoUserCarControl(float timeStep)
    {
        if (!drivableCar)
            return;
    
        PxVehicleDrive4W &car = *drivableCar->vehicle;
    
        //Work out if the car is to flip from reverse to forward gear or from forward gear to reverse.
        bool toggleAutoReverse = false;
        if (car.mDriveDynData.getUseAutoGears())
        {
            toggleAutoReverse = ProcessAutoReverse(timeStep);
        }
    
        //If the car is to flip gear direction then switch gear as appropriate.
        if(toggleAutoReverse)
        {
            mInReverseMode = !mInReverseMode;
    
        }
    
        //If in reverse mode then swap the accel and brake.
        if(mInReverseMode)
        {
            carControlData.setDigitalAccel(false);
            carControlData.setDigitalBrake(false);
            carControlData.setDigitalAccel(carControlData.getDigitalAccel() || Keyboard->IsPressed(kbsUp));
            carControlData.setDigitalBrake(carControlData.getDigitalBrake() || Keyboard->IsPressed(kbsDown));
    
            car.mDriveDynData.forceGearChange(PxVehicleGearsData::eREVERSE);
            const bool accel = carControlData.getDigitalAccel();
            const bool brake = carControlData.getDigitalBrake();
            carControlData.setDigitalAccel(brake);
            carControlData.setDigitalBrake(accel);
        }
        else {
            carControlData.setDigitalAccel(false);
            carControlData.setDigitalBrake(false);
            carControlData.setDigitalAccel(carControlData.getDigitalAccel() || Keyboard->IsPressed(kbsUp));
            carControlData.setDigitalBrake(carControlData.getDigitalBrake() || Keyboard->IsPressed(kbsDown));
    
            car.mDriveDynData.forceGearChange(PxVehicleGearsData::eFIRST);
            const bool accel = carControlData.getDigitalAccel();
            const bool brake = carControlData.getDigitalBrake();
            carControlData.setDigitalAccel(accel);
            carControlData.setDigitalBrake(brake);
        }
    
        PxVehicleDrive4WSmoothDigitalRawInputsAndSetAnalogInputs(gKeySmoothingData, gSteerVsForwardSpeedTable, carControlData, timeStep, car);
        clearInputData = true;
    }
    try to make it work with the keys A W S D but conflicts with the S key and does not work



    To Drive, use arrows

  10. #10
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    This fixed almost able to choose the car you want, so far only one single car could drive more than two would not let you, when it finished I will post an example.


  11. #11
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Quote Originally Posted by CodexPo View Post
    This fixed almost able to choose the car you want, so far only one single car could drive more than two would not let you, when it finished I will post an example.

    Nice work))))) Very Very Nice))

  12. #12
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    search on HUD_TSPGame.cpp

    Code:
    if ( target_Vehicle  ) // now we're going to try to use vehicles (otherwise UAV characters can't use vehicles).
    replace with

    Code:
    if ( target_Vehicle  ) // now we're going to try to use vehicles (otherwise UAV characters can't use vehicles).
    {
         pl->enterVehicle( target_Vehicle );
         g_pPhysicsWorld->m_VehicleManager->DriveCar(target_Vehicle->vd);
    
    }


    Search on AI_Player.cpp

    Code:
    static const float gDist_To_Allow_Vehicle_Entry = 5;
    Replace to:

    Code:
    static const float gDist_To_Allow_Vehicle_Entry = 3.1;
    and

    Code:
    if( distSq < gDist_To_Allow_Vehicle_Entry * gDist_To_Allow_Vehicle_Entry )
    replace:

    Code:
    if( distSq < gDist_To_Allow_Vehicle_Entry )

  13. #13
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    for when the buggy tipping and its background is not transparent CR_Buggy_01.mat edit the file doublesided = 0 to DoubleSided = 1 and save

  14. #14
    Account Upgraded | Title Enabled! jonnybravo is offline
    MemberRank
    Sep 2006 Join Date
    773Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    ill post some more once i can fix a few bugs.. (server side)

    @CodexPo you know that this is still just client side when 2 ppl are on the same map and you go inside the vechile he will just see you standing there. have to update the player AI so that both clients upate each other.

  15. #15
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Quote Originally Posted by jonnybravo View Post
    ill post some more once i can fix a few bugs.. (server side)

    @CodexPo you know that this is still just client side when 2 ppl are on the same map and you go inside the vechile he will just see you standing there. have to update the player AI so that both clients upate each other.
    this is only for the client what I've done so far, need server-side support, server does not know how to do

  16. #16
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Zomie killer in action!!!! :P


    For install, un zip on Data\ObjectsDepot\Vehicles

    https://mega.co.nz/#!l4FxRIBZ!PZ55DH...4lXbWCL64VXkJc

  17. #17
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Quote Originally Posted by CodexPo View Post
    Zomie killer in action!!!! :P


    For install, un zip on Data\ObjectsDepot\Vehicles

    https://mega.co.nz/#!l4FxRIBZ!PZ55DH...4lXbWCL64VXkJc
    O my God!!! THIS IS AAAAAAAAAAAAAAAAAA

  18. #18
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    screen_28082013_024906.jpg

  19. #19
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    the tutotial have one bug found by Gigatoni, thx for fix

    change this

    Code:
        if (m->FileName == "data/objectsdepot/vehicles/drivable_stryker.sco") {
            vd->vehicle->setup(g_pPhysicsWorld->PhysXSDK, vehActor,  *wheelsData, driveData, std::max<int>(vd->numWheels-4, 0));
            vd->vehicle->setWheelShapeMapping(0, 0);
            vd->vehicle->setWheelShapeMapping(1, 1);
            vd->vehicle->setWheelShapeMapping(2, 2);
            vd->vehicle->setWheelShapeMapping(3, 3);
            vd->vehicle->setWheelShapeMapping(4, 4);
            vd->vehicle->setWheelShapeMapping(5, 5);
            vd->vehicle->setWheelShapeMapping(6, 6);
            vd->vehicle->setWheelShapeMapping(7, 7);
    
        }
        else {
            vd->vehicle->setup(g_pPhysicsWorld->PhysXSDK, vehActor,  *wheelsData, driveData, std::max<int>(vd->numWheels, 0));
            vd->vehicle->setWheelShapeMapping(0, 0);
            vd->vehicle->setWheelShapeMapping(1, 1);
            vd->vehicle->setWheelShapeMapping(2, 2);
            vd->vehicle->setWheelShapeMapping(3, 3);
        }
    To this:

    Code:
        vd->vehicle->setup(g_pPhysicsWorld->PhysXSDK, vehActor, *wheelsData, driveData, std::max<int>(vd->numWheels-4, 0));
    
        if (m->FileName == "data/objectsdepot/vehicles/drivable_stryker.sco") {
            vd->vehicle->setWheelShapeMapping(0, 0);
            vd->vehicle->setWheelShapeMapping(1, 1);
            vd->vehicle->setWheelShapeMapping(2, 2);
            vd->vehicle->setWheelShapeMapping(3, 3);
            vd->vehicle->setWheelShapeMapping(4, 4);
            vd->vehicle->setWheelShapeMapping(5, 5);
            vd->vehicle->setWheelShapeMapping(6, 6);
            vd->vehicle->setWheelShapeMapping(7, 7);
    
        }
        else {
            vd->vehicle->setWheelShapeMapping(0, 0);
            vd->vehicle->setWheelShapeMapping(1, 1);
            vd->vehicle->setWheelShapeMapping(2, 2);
            vd->vehicle->setWheelShapeMapping(3, 3);
        }
    Sorry for the bug :(
    Last edited by CodexPo; 27-09-13 at 11:13 PM.

  20. #20
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Cars TEsting + SuperZombie Dummy

  21. #21
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    lol nice video Poster13, i like your character man hahah and need make damage for kill zombies with cars

    how you add zombie?

    mmm with this "ZombieDummy obj_ZombieDummy Zombie"

  22. #22
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    All this is thanks to you) You really did a lot) Thank you)

  23. #23
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    hehe thanks, also thanks to all who have helped, but still needs to be done and we need help

  24. #24
    Account Upgraded | Title Enabled! Poster13 is offline
    MemberRank
    Jun 2013 Join Date
    395Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    Quote Originally Posted by CodexPo View Post
    hehe thanks, also thanks to all who have helped, but still needs to be done and we need help
    Have you tried to launch a website WarZED TEmplate?

  25. #25
    Account Upgraded | Title Enabled! CodexPo is offline
    MemberRank
    May 2013 Join Date
    BilbaoLocation
    574Posts

    Re: [Tutorial] Enabling vehicles, Only work on Studio.exe by now

    and i have the same bus, you can drive but have one bug on skl file

    no i not have warz website then no need this template hehe



Page 1 of 13 12345678911 ... LastLast

Advertisement