BeamNG自动挡两驱车,给另外一组车轮加入带变速箱电机实现混动的教程。

本方法只适用于两驱自动挡车型!
先决条件:下载以下文件
链接:https://pan.baidu.com/s/1pAoSr4P5-szye05HaDUcqw?pwd=stx3
提取码:stx3
在steam的BeamNG界面,找到如下按钮

跳转到“BeamNG.drive”文件夹,找到BeamNG.drive\lua\vehicle\controller,并将上述文件放入其中。
以Automation导入BeamNG的自动挡前驱车为例,首先我们准备一台前驱的自动挡车,导入进BeamNG中。


启动BeamNG,点击“管理用户文件”,再点击“在资源管理器中打开”。



先找到eng_xxxxx文件夹下需要改装的车的发动机文件“camso_engine_xxxxx.jbeam”,例如我的是“camso_engine_fe694.jbeam”。

在"Camso_Engine_xxxxx"下的"slots"中插入一条["Camso_Rear_Engine","Camso_Engine_Electric","Rear Engine"],

如果想给前轮加上电机,改为
["Camso_Front_Engine","Camso_Engine_Electric","Front Engine"],
即可。
然后在最后一个右大括号前插入以下内容
"Camso_battery": {
"information":{
"authors":"BeamNG",
"name":"10kWh Battery Pack",
"value":2000,
},
"slotType" : "Camso_battery",
"energyStorage": [
["type", "name"],
["electricBattery", "mainBattery"],
],
"variables": [
["name", "type", "unit", "category", "default", "min", "max", "title", "description"],
["$Efuel", "range", "kWh", "Chassis", 100, 0, 100, "Battery Level", "Initial battery charge", {"stepDis":0.5}],
],
"mainBattery": {
"energyType":"electricEnergy",
"batteryCapacity": 100,
"startingCapacity": "$Efuel",
},
},
"Camso_Engine_Electric": {
"information":{
"authors":"Camshaft Software",
"name":"Rear EV",
}
"slotType" : "Camso_Rear_Engine",
"slots": [
["type", "default", "description"]
["Camso_battery","Camso_battery","Battery"],
["Camso_EV_Transmission", "Camso_EV_Transmission_4f5b2", "EV_Transmission"],
],
"powertrain" : [
["type", "name", "inputName", "inputIndex"],
["electricMotor", "rearMotor", "dummy", 0],
],
"controller": [
["type", "name", "inputName", "inputIndex"],
["twoStepLaunch", {"rpmLimit":3800}],
],
"rearMotor": {
"torque":[
["rpm", "torque"]
[0, 256],
[500, 255],
[1000, 254],
[1500, 252],
[2000, 250],
[2500, 248],
[3000, 246],
[3500, 244],
[4000, 242],
[4500, 240],
[5000, 239],
[5500, 214],
[6000, 189],
[6500, 164],
[7000, 139],
[7500, 114],
[8000, 88],
],
"revLimiterType":"soft",
"revLimiterSmoothOvershootRPM":10,
//engine performance
"maxRPM":8000, //Max RPM before overrev damage is likely
"inertia":0.20,
"friction":0,
"dynamicFriction":0.05,
"waterDamage": {"[engineGroup]:":["engine_intake"]}, //Engine hydrolocks when nodes in this group go under water
"engineBlock": {"[engineGroup]:":["engine_block"]}, //Engine thermal mass is taken from nodes in this group
"fuel": {"[engineGroup]:":["battery"]},
"breakTriggerBeam":"engine", //Engine breaks if beam with this name is broken
"soundConfig": "soundConfigMotor", //What section name to look for for engine sound information
"thermalsEnabled":false,
"engineBlockMaterial":"aluminum", //"aluminum", "aluminium", "iron"
"energyStorage": "mainBattery", //Name of the fuel tank
"requiredEnergyType":"electricity", //Type of fuel required
"electricalEfficiency": 0.98,
},
"vehicleController": {
//"shiftLogicName":"automaticGearbox",
"topSpeedLimitReverse": 15,
"topSpeedLimit": 200,
"motorNames": ["mainEngine", "rearMotor"],
},
//"vehicleController": {
// "shiftLogicName":"electricMotor",
// "motorNames": ["rearMotor", "frontMotor"],
// "topSpeedLimitReverse": 15,
// //"defaultRegen": 0.5,
// //"brakeRegenCoef": 1,
// "onePedalRegenCoef": 0.85
},
"soundConfigMotor": {
"sampleName": "ElectricMotor",
"mainGain": 0,
//"maxLoadMix": 0.65,
//"minLoadMix": 0,
//"onLoadGain":1,
//"offLoadGain":0.65,
//"eqLowGain": -15,
//"eqLowFreq": 100,
//"eqLowWidth": 0.05,
//"eqHighGain": -5,
//"eqHighFreq": 6000,
//"eqHighWidth": 0.1,
//"eqFundamentalGain": 2,
},
},

若是后驱车加前电机,将其中的rear改为front,Rear改为Front即可。"torque"中的数列中,前一个数为转速,后一个数为该转速下对应的电机扭矩,可以根据需要修改。保存该文件并关闭。
下一步,在须要更改的车型的文件夹里找到“camso_transmission_xxxxx”以及“camso_differential_x_xxxxx”两个文件,例如,我要修改的车型是5683c,即要找到“camso_transmission_5683c”及“camso_differential_f_5683c”,如果是后驱车,后一个文件则是“camso_differential_r_xxxxx”



复制"Camso_Transmission_xxxxx"下"gearbox"及"torqueConverter"的内容。并粘贴在"torqueConverter"下方。注意不要操作到"Camso_Transmission_Sequential_xxxxx"下。

在复制出来的gearbox及torqueConverter前增加“EV_”。

更改"EV_gearbox"下"gearRatios"中的内容,更改为三个挡位,数字为变速箱齿比,可根据需要自行修改。负数为倒挡,放在第一个,0为空挡,放在第二个,正数为前进挡,放在第三个。

在"Camso_Transmission_xxxxx"中的"vehicleController"下插入内容
"shiftLogicName":"automaticevGearbox",

在"Camso_Transmission_xxxxx"中的"powertrain"下增添内容
["torqueConverter", "EV_torqueConverter", "rearMotor", 1],
["automaticGearbox", "EV_gearbox", "EV_torqueConverter", 1],

翻到最下面,在"Camso_TransferCase_FWD_xxxxx"(如是后驱车,则是"Camso_TransferCase_RWD_xxxxx")中的"powertrain"下增添内容
["shaft", "rearDriveShaft", "EV_gearbox", 1],

保存文件,关闭。
下一步,打开“camso_differential_x_xxxxx”文件,在其中的"powertrain"下复制第一条内容,粘贴在其下方,并修改front为rear,Front改为Rear。如
["differential", "rearDiff", "rearDriveShaft", 1, {"diffType":"open", "uiName":"Rear Differential", "defaultVirtualInertia":0.25}],
增填内容
["shaft", "halfshaftRL", "rearDiff", 1, {"breakTriggerBeam":"halfshaft_RL", "uiName":"Rear Left Halfshaft" "friction":0}],
["shaft", "halfshaftRR", "rearDiff", 2, {"breakTriggerBeam":"halfshaft_RR", "uiName":"Rear Right Halfshaft" "friction":0}],
如增加前轮电机,则将rear改为front,Rear改为Front,RL改为FL,RR改为FR即可。

保存文件,关闭。打开游戏,找到改动的车。



此时电机已具备倒挡功能。
DCT文件已在优化中,CVT在计划中(不一定弄得出来)。
另以笔者能力,可能无法解决bug,如发现bug欢迎反馈,不包修复。感谢大家!