Garry's Mod

Garry's Mod

120 beoordelingen
Glide // Blackterio's Glide Extra Functions
   
Prijs
Toevoegen aan favorieten
Toegevoegd aan favorieten
Verwijderen uit favorieten
Content Type: Addon
Addon Type: Vehicle
Addon Tags: Roleplay, Scenic, Realism
Bestandsgrootte
Geplaatst op
Bijgewerkt op
220.717 KB
19 jul om 21:30
20 sep om 20:36
6 wijzigingsnotities (weergeven)

Abonneren om te downloaden
Glide // Blackterio's Glide Extra Functions

In 4 verzamelingen van Blackterio
Blackterio's Vehicles
93 items
Vehiculos Argentinos
53 items
Vehiculos Argentinos (GLIDE)
20 items
Blackterio's Glide Vehicles
29 items
Omschrijving
This adds extra functions for developers to use in Glide vehicles:

Official Group and commission info

Support me on Ko-Fi [ko-fi.com]

- Pedals (throttle, brake and a simulated clutch)
- Speedometer
- Tachometer
- Fuel gauge (only visual for now)
- Temp gauge (only visual for now)
- Oil pressure gauge (works with the engine's RPM)
- Wipers ( Stormfox , Stormfox 2 or GWeather is needed )
- Wipers and light switches
- Ignition key
- Support for 9 doors/animations with customizable keys (more documentation soon)



All my vehicles have support for this.



Users need to subscribe to this addon if they want to see these extra functions, in case they don't choose to do it, they simply won't see anything of these animations.




THIS NEXT SECTION DOESN'T INCLUDE DOORS/ANIMATIONS, MORE DOCUMENTATION SOON


This next code needs to be written at the start of your LUA file:

AddCSLuaFile() AddCSLuaFile() -- Load Blackterio's Glide Extra Functions LUA file local function LoadExtraFunctions() local paths = { "autorun/shared/blackterio_extra_functions.lua", "lua/autorun/shared/blackterio_extra_functions.lua", "blackterio_extra_functions.lua" } for _, path in ipairs(paths) do if file.Exists(path, "LUA") then if SERVER then AddCSLuaFile(path) end include(path) return true end end return false end local extraFunctionsLoaded = LoadExtraFunctions() local ItHasExtraFunctions = true -- with this you can activate the custom extra functions on this vehicle (pedals, gauges, etc)

After this, you need to define the base class of your vehicle. This is an example with a vehicle of the type "car":

DEFINE_BASECLASS( "base_glide_car" ) -- strictly necessary if you wanna make support for custom anims (for example speedometers or tachometers) Check Glide's Github [github.com] to check all the base types

These next codes need to be written in the CLIENT section of your LUA file:

function ENT:Initialize() BaseClass.Initialize(self) -- Extra functions activator self.HasExtraFunctions = ItHasExtraFunctions end

-- Extra functions (animations) function ENT:OnUpdateAnimations() if BlackterioExtraFunctions and extraFunctionsLoaded then if self.HasExtraFunctions then -- Use a custom configuration for this vehicle in particular, or use the default configuration -- I highly recommend using a custom one BlackterioExtraFunctions:UpdateAnimations(self, self.AnimationConfig) -- Optional: Configure special parameters for this vehicle self.AnimationConfig = BlackterioExtraFunctions:CreateConfig({ -- Activate/deactivate functions pedals = true, clutch = true, speedo = true, fuel = true, tacho = true, oil = true, temp = true, battery = true, wipers = true, ignitionKey = true, lightSwitch = true, wiperSwitch = true, -- Pedals lerp pedalLerpRate = 0.2, -- Clutch duration (lerp) clutchDuration = 0.4, -- RPM calibration rpmCalibration = -0.04, -- Speedometer calibration and multiplier speedCalibration = 50, speedMultiplier = 0.4, -- Fuel lerp fuelLerpRate = 0.09, -- Oil lerp and max value oilLerpRate = 0.5, oilMaxValue = 0.9, oilMinValue = 0.5, -- Temperature lerp and max value tempLerpRate = 0.0005, tempMaxValue = 0.7, -- Battery lerp and max value batteryLerpRate = 0.09, batteryMaxValue = 0.5, -- Wipers Speed wiperSpeed = 0.3, -- Switch lerp rates ignitionLerpRate = 0.2, lightSwitchLerpRate = 0.2, wiperSwitchLerpRate = 0.2, --[[ Pose parameters names. You can change them if they're different than these ones poseParameters = { gas = "gas", brake = "brake", clutch = "clutch", speedo = "speedo", tacho = "tacho", fuel = "fuel", oil = "oil", temp = "temp", battery = "battery", wipers1 = "wipers1", wipers2 = "wipers2", wipers3 = "wipers3", wipers4 = "wipers4", ignitionKey = "ignitionkey", lightSwitch = "lightswitch", wiperSwitch = "wiperswitch" } ]] }) else BaseClass.OnUpdateAnimations(self) end else BaseClass.OnUpdateAnimations(self) end end



You can activate or deactivate functions as you wish. You can also choose to not specify any custom lerp or calibration values, but it's not really recommended.



The recommended names for the pose parameters of your animations are the ones that are specified by default, but if you want, you can assign a different name for them if that's needed.



I also recommend making animations with a maximum of 3 frames. You can make them with more, but it will need a more precise assignment of the lerp values. Except with the wipers animation, it's better if you make it with 10 frames

2 opmerkingen
madval26 20 jul om 2:18 
Wait a second, you're the person that made a Simfphys Polaris V8
Hana 19 jul om 23:07 
dale