Garry's Mod

Garry's Mod

116 个评价
Glide // Blackterio's Glide Extra Functions
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 载具
插件标签: 角色扮演, 风景, 写实
文件大小
发表于
更新日期
220.717 KB
7 月 19 日 下午 9:30
9 月 20 日 下午 8:36
6 项改动说明 ( 查看 )

订阅以下载
Glide // Blackterio's Glide Extra Functions

在 Blackterio 的 4 个合集中
Blackterio's Vehicles
92 件物品
Vehiculos Argentinos
52 件物品
Vehiculos Argentinos (GLIDE)
19 件物品
Blackterio's Glide Vehicles
28 件物品
描述
This adds extra functions for developers to use in Glide vehicles:

- 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 条留言
madval26 7 月 20 日 上午 2:18 
Wait a second, you're the person that made a Simfphys Polaris V8
Hana 7 月 19 日 下午 11:07 
dale