Configuring the resource

Smart Tyre is highly configurable, allowing you to change all elements of the resource.

To begin configuring the resource, open the config.lua file.

Controls

useKey = {0, 38}, -- The key that will be used to interact with Smart Tyre
pumpJackUp = {0, 44}, -- The key that will be used to pump the jack up 
pumpJackDown = {0, 20}, -- The key that will be used to pump the jack down

The controls used in the resource can be changed in this section. For a full list of controls, see the list here. You should only need to change the number of the second value.

Wheel Damage Chances

wheelDamageChances = {
        onCrash = 0.1, -- The chance of the wheel being damaged when the vehicle crashes. This is a number between 0 and 1 - 0 means it will never happen, 1 means it will always happen.
        onBurnout = 0.05, -- The chance of the wheel being damaged when the vehicle does a burnout. This is a number between 0 and 1 - 0 means it will never happen, 1 means it will always happen.
        onRandom = 0.05, -- The chance of the wheel being damaged randomly. This is a number between 0 and 1 - 0 means it will never happen, 1 means it will always happen.
    },

This section allows you to set the chance of a wheel becoming damaged (punctured) on a crash, burnout or random chance. These have been set to low values by default.

These values must be a number between 0.0 and 1.0. 0.0 means it will never happen and 1.0 means it will be guaranteed to happen every time.

Wheel Puncture Types

wheelPunctureTypes = {
        onCrash = {
            gradual = true,     -- Start with slow deflation
            time = 30.0,         -- Seconds until fully flat or rim
            goToRim = true,    -- Stop at flat instead of rim
            damage = 300.0
        },
        onBurnout = {
            gradual = true,    -- Instantly destroy the tyre
            time = 60.0,
            goToRim = true,     -- Go straight to rim
            damage = 500.0
        },
        onRandom = {
            gradual = true,
            time = 60.0,
            goToRim = true,
            damage = 500.0
        }
    },

This section allows you to set the type of damage that will be incurred to a tyre on a specific event, such as a crash, burnout or randomly caused puncture.

By default, we have set all three actions to gradually deflate the tyre. By setting gradual to true, you are activating the gradual deflation mode. Tyres will initially be set to the damage property in terms of the amount of air in them, with this being a value between 0.0 and 1000.0.

The goToRim property allows you to determine whether you want the tyre to eventually go to the rim. The time property determines the speed at which the tyre will go to the rim if the player continues to driver whilst on a puncture, rather than changing it for the spare tyre.

By disabling the gradual property, tyres will go straight to the rim. If you do not want tyres to go to the rim at all, you can disable goToRim.

For example, based on the current configuration options above, the following will happen for a crash:

  • The tyre will deflate down to 300.0 out of 1000.0 soon after a crash.

  • If the player continues to drive, this will go down to the rim over the next 30 seconds.

Tyre Effects

tyreEffects = {
        deflationTime = 10.0,           -- Default fallback deflation time if not specified per-type
        reducePower = true,             -- Optional: cut power to wheel when deflated
        reduceSteering = true,          -- Optional: restrict steering
        gradualHandlingEffect = false   -- Gradual handling changes (optional)
    },

The deflationTime is a default fallback option if the wheelPunctureTypes was not specified above.

The reducePower option allows you to cut power to the wheel when a tyre is deflated.

The reduceSteering option allows you to restrict steering when a tyre is deflated.

The gradualHandlingEffect option allows you to implement gradual changes to handling when a tyre is deflated.

Spare Tyre Options

maxSpareSpeed = 50.0, -- (MPH) - The maximum speed the player can drive with a spare wheel on the vehicle. This is in mph. If the player exceeds this speed, the spare wheel will come off. The texture will not be updated, so you will need to do this manually.
wheelFlyOffChance = 0.05, -- The chance of the wheel flying off while the vehicle is on a spare wheel and driven at excessive speeds. This is a number between 0 and 1 - 0 means it will never happen, 1 means it will always happen.
setWheelOnFire = true, -- Set to true to set the vehicle on fire after the spare wheel has come off.
setWheelOnFireAfter = 30, -- The time in seconds the player must be driving after the spare wheel has come off to set the vehicle on fire. Will only work if setWheelOnFire is true.

The maxSpareSpeed property allows you to set the maximum speed at which a player can drive with a spare tyre, before there is a chance that the wheel can fly off.

The wheelFlyOffChance property is a value between 0.0 and 1.0. This is the chance that the wheel will fly off the vehicle is the maximum spare speed is exceeded above. This is set to a low value by default.

The setWheelOnFire property allows you to determine whether the vehicle will be set on fire if a player continues to drive the vehicle after a spare wheel has flown off.

The setWheelOnFireAfter property allows you to determine the amount of time (in seconds) that the vehicle will be set on fire if a player continues to drive after a spare wheel has flown off.

Last updated

Was this helpful?