Jump to content

Changing Vehicle Wheel Size Independently


sporkflips

Recommended Posts

I created a mod a while back probably a year ago or so to add my own car into the game, and I had it working fine but then I didn't play for a while and now I tried adding it again in the current PZ version, with the same mod folder I created back then, and now the wheels are huge and when I change the wheel size, radius, and width settings in my vehicle script it does nothing. I also tried changing the model size in blender and replacing the fbx file but it still didn't make a difference. It's confusing because the wheel model is proportional to the car model when I exported them as fbx files but then in PZ it's like monster truck wheels.
The only thing that I can figure out that changes the wheel size is reducing the scale of the model reference in the vehicle creation (line 47), which then also makes the doors access disappear into the body of the car.

Additionally, I had to set the scale of the model itself kind of wacky to get it right in game, if I set the scale inside ScionxBBase to 1 (line 7) and the scale inside the model reference in the ScionxB vehicle to 1 (line 47) the model of the car itself is way bigger than the game object/ScionxB vehicle that gets placed into the game, and then the model is off center for some reason (it definitely was not off center when I exported the fbx file)

As it is right now, the car is the correct size and the doors work and everything, it's just that the wheels appear to be huge and stick through the body and I can't figure out how to change the size of them anymore. Additionally I am having an issue where the sound of the engine revving when upshifting while turning doesn't properly line up with the acceleration and I think it might have something to do with the gear ratio settings but I can't figure that out either so if anyone has any suggestion about that I'd appreciate it.
Code below

EDIT: somehow now changing the wheel scale to 0.45 works after I moved the mod folder from zomboid/workshop/mods to zomboid/mods... I don't understand I tried changing it so many times before and it did literally nothing.

Thanks

 

 
module Base
{
    model ScionxBBase
    {
        mesh = vehicles/Vehicles_ScionxB,
        shader = vehicle/*_multiuv*/,
        invertX = FALSE,
        scale = 0.45,
    }
    model ScionxBfrontwheelleft
    {
        mesh = vehicles/Vehicles_ScionxB_Wheel,
        texture = Vehicles/Vehicles_ScionxB_Wheel3,
        shader = vehiclewheel,
        scale = 1,
    }
    model ScionxBfrontwheelright
    {
        mesh = vehicles/Vehicles_ScionxB_Wheel,
        texture = Vehicles/Vehicles_ScionxB_Wheel3,
        shader = vehiclewheel,
        scale = 1,
    }
    model ScionxBrearwheelleft
    {
        mesh = vehicles/Vehicles_ScionxB_Wheel,
        texture = Vehicles/Vehicles_ScionxB_Wheel2,
        shader = vehiclewheel,
        scale = 1,
    }
    model ScionxBrearwheelright
    {
        mesh = vehicles/Vehicles_ScionxB_Wheel,
        texture = Vehicles/Vehicles_ScionxB_Wheel2,
        shader = vehiclewheel,
        scale = 1,
    }
    vehicle ScionxB
    {
        mechanicType = 1,
        offRoadEfficiency = 0.9,
        engineRepairLevel = 4,
        playerDamageProtection = 1.2,
        engineRPMType = generic,

        model
        {
            file = ScionxBBase,
            scale = 1.75,
            offset = 0.0000 0.0000 0.0000,
        }

        skin
        {
            texture = Vehicles/Vehicles_ScionxB_Shell,
        }
        skin
        {
            texture = Vehicles/Vehicles_ScionxB_Black,
        }
        skin
        {
            texture = Vehicles/Vehicles_ScionxB_Blue,
        }
        skin
        {
            texture = Vehicles/Vehicles_ScionxB_Green,
        }
        skin
        {
            texture = Vehicles/Vehicles_ScionxB_Purple,
        }
        skin
        {
            texture = Vehicles/Vehicles_ScionxB_Red,
        }
        skin
        {
            texture = Vehicles/Vehicles_ScionxB_White,
        }
        skin
        {
            texture = Vehicles/Vehicles_ScionxB_Yellow,
        }


        textureRust = Vehicles/Vehicles_ScionxB_Rust,
        textureMask = Vehicles/Vehicles_ScionxB_Mask,
        textureLights = Vehicles/Vehicles_ScionxB_Lights,
        textureDamage1Overlay = Vehicles/Vehicles_ScionxB_Overlays_Damaged01,
        textureDamage1Shell = Vehicles/Vehicles_ScionxB_Shell_Damaged01,
        textureDamage2Overlay = Vehicles/Vehicles_ScionxB_Overlays_Damaged02,
        textureDamage2Shell = Vehicles/Vehicles_ScionxB_Shell_Damaged02,

        sound
        {
            engine = VehicleEngineSmallCar,
            engineStart = VehicleEngineSmallCar,
            engineTurnOff = VehicleEngineSmallCar,
            horn = VehicleHornStandard,
            ignitionFail = VehicleIgnitionFailSmallCar,
        }

        extents = 1.0000 0.5934 2.0000,
        mass = 665,
        physicsChassisShape = 1.0000 0.5934 2.0000,
        centerOfMassOffset = 0.0000 0.0500 0.0000,
        shadowExtents = 0.9 1.9,
        shadowOffset = 0.0 0.0,
        engineForce = 3700,
/*        gearRatioCount = 5,
        gearRatioR = 4.84,
        gearRatio1 = 4.84,
        gearRatio2 = 2.64,
        gearRatio3 = 1.54,
        gearRatio4 = 1.00,
        gearRatio5 = 0.84,    */
        maxSpeed = 75f,
        engineLoudness = 60,
        engineQuality = 60,
        brakingForce = 60,
        stoppingMovementForce = 2.0f,
        rollInfluence = 0.2f,
        steeringIncrement = 0.03,
        steeringClamp = 0.3,
        suspensionStiffness = 30,
        suspensionCompression = 2.83,
        suspensionDamping = 2.88,
        maxSuspensionTravelCm = 10,
        suspensionRestLength = 0.2,
        wheelFriction = 1.8f,
        frontEndHealth = 150,
        rearEndHealth = 150,
        seats = 4,

        wheel FrontLeft
        {
            front = true,
            offset = 0.3500 -0.2747 0.6000,
            radius = 0.15f,
            width = 0.2f,
        }

        wheel FrontRight
        {
            front = true,
            offset = -0.3500 -0.2747 0.6000,
            radius = 0.15f,
            width = 0.2f,
        }

        wheel RearLeft
        {
            front = false,
            offset = 0.3500 -0.2747 -0.6600,
            radius = 0.15f,
            width = 0.2f,
        }

        wheel RearRight
        {
            front = false,
            offset = -0.3500 -0.2747 -0.6600,
            radius = 0.15f,
            width = 0.2f,
        }

        template = PassengerSeat4,

        passenger FrontLeft
        {
            position inside
            {
                offset = 0.1593 -0.1044 -0.1099,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = 0.5714 -0.4121 -0.0110,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontLeft,
            }
        }

        passenger FrontRight
        {
            position inside
            {
                offset = -0.1538 -0.1044 -0.1099,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = -0.5714 -0.4121 -0.0110,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatFrontRight,
            }
        }

        passenger RearLeft
        {
            position inside
            {
                offset = 0.1813 -0.1044 -0.4835,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = 0.6209 -0.4121 -0.3352,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatRearLeft,
            }
        }

        passenger RearRight
        {
            position inside
            {
                offset = -0.1813 -0.1044 -0.4835,
                rotate = 0.0000 0.0000 0.0000,
            }

            position outside
            {
                offset = -0.6209 -0.4121 -0.3352,
                rotate = 0.0000 0.0000 0.0000,
                area = SeatRearRight,
            }
        }

        area Engine
        {
            xywh = 0.0000 1.1374 0.7692 0.4176,
        }

        area TruckBed
        {
            xywh = 0.0000 -1.1374 0.7692 0.4176,
        }

        area SeatFrontLeft
        {
            xywh = 0.5989 -0.0110 0.4286 0.6593,
        }

        area SeatFrontRight
        {
            xywh = -0.5989 -0.0110 0.4286 0.6593,
        }

        area SeatRearLeft
        {
            xywh = 0.6813 -0.3352 0.4725 0.4725,
        }

        area SeatRearRight
        {
            xywh = -0.6813 -0.3352 0.4725 0.4725,
        }

        area GasTank
        {
            xywh = 0.5989 -0.6703 0.4286 0.4725,
        }

        area TireFrontLeft
        {
            xywh = 0.5989 0.5989 0.4286 0.4725,
        }

        area TireFrontRight
        {
            xywh = -0.5989 0.5989 0.4286 0.4725,
        }

        area TireRearLeft
        {
            xywh = 0.5989 -0.6703 0.4286 0.4725,
        }

        area TireRearRight
        {
            xywh = -0.5989 -0.6703 0.4286 0.4725,
        }

        template = Trunk/part/TruckBed,

        part TruckBed
        {
            container
            {
                capacity = 60,
            }
        }

        template = TrunkDoor,

        part TrunkDoor
        {
            table install
            {
                recipes = Basic Mechanics,
            }

            table uninstall
            {
                recipes = Basic Mechanics,
            }
        }

        template = Seat/part/SeatFrontLeft,
        template = Seat/part/SeatFrontRight,
        template = Seat/part/SeatRearLeft,
        template = Seat/part/SeatRearRight,

        part Seat*
        {

            container
            {
                capacity = 20,
            }
            table install
            {
                skills = Mechanics:2,
                recipes = Basic Mechanics,
            }

            table uninstall
            {
                skills = Mechanics:2,
                recipes = Basic Mechanics,
            }
        }

        part GloveBox
        {
            area = SeatFrontRight,
            itemType = Base.GloveBox,
            mechanicRequireKey = true,

            container
            {
                capacity = 7,
                test = Vehicles.ContainerAccess.GloveBox,
            }

            lua
            {
                create = Vehicles.Create.Default,
            }
        }

        template = GasTank,

        part GasTank
        {
            install
            {
                skills = Mechanics:7,
                recipes = Basic Mechanics,
            }

            uninstall
            {
                skills = Mechanics:7,
                recipes = Basic Mechanics,
            }
        }

        template = Battery,
        template = Engine,
        template = Muffler,

        part Muffler
        {
            table install
            {
                recipes = Basic Mechanics,
            }

            table uninstall
            {
                recipes = Basic Mechanics,
            }
        }

        template = EngineDoor,

        part EngineDoor
        {
            mechanicRequireKey = false,

            table install
            {
                recipes = Basic Mechanics,
            }

            table uninstall
            {
                recipes = Basic Mechanics,
            }
        }

        part Heater
        {
            category = engine,

            lua
            {
                update = Vehicles.Update.Heater,
            }
        }

        part PassengerCompartment
        {
            category = nodisplay,

            lua
            {
                update = Vehicles.Update.PassengerCompartment,
            }
        }

        template = Windshield/part/Windshield,
        template = Windshield/part/WindshieldRear,
        template = Window/part/WindowFrontLeft,
        template = Window/part/WindowFrontRight,
        template = Window/part/WindowRearRight,
        template = Window/part/WindowRearLeft,
        template = Door/part/DoorFrontLeft,
        template = Door/part/DoorFrontRight,
        template = Door/part/DoorRearLeft,
        template = Door/part/DoorRearRight,

        part Door*
        {
            table install
            {
                recipes = Basic Mechanics,
            }

            table uninstall
            {
                recipes = Basic Mechanics,
            }
        }

        template = Tire,

        part TireFrontLeft
        {
            model InflatedTirePlusWheel
            {
                file = ScionxBfrontwheelleft,
            }
        }

        part TireFrontRight
        {
            model InflatedTirePlusWheel
            {
                file = ScionxBfrontwheelright,
            }
        }

        part TireRearLeft
        {
            model InflatedTirePlusWheel
            {
                file = ScionxBrearwheelleft,
            }
        }

        part TireRearRight
        {
            model InflatedTirePlusWheel
            {
                file = ScionxBrearwheelright,
            }
        }

        template = Brake,

        part Brake*
        {
            table install
            {
                skills = Mechanics:3,
                recipes = Basic Mechanics,
            }

            table uninstall
            {
                skills = Mechanics:3,
                recipes = Basic Mechanics,
            }
        }

        template = Suspension,

        part Suspension*
        {
            table install
            {
                skills = Mechanics:4,
                recipes = Basic Mechanics,
            }

            table uninstall
            {
                skills = Mechanics:4,
                recipes = Basic Mechanics,
            }
        }

        template = Radio,
        template = Headlight,

        attachment trailer
        {
            offset = 0.0000 -0.2747 -0.9341,
            rotate = 0.0000 0.0000 0.0000,
            zoffset = -1.0000,
        }

        attachment trailerfront
        {
            offset = 0.0000 -0.2747 0.9286,
            rotate = 0.0000 0.0000 0.0000,
            zoffset = 1.0000,
        }
    }
}
Edited by sporkflips
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...