Well, it looks like there is no (good) chance to calculate "RPM-ish" value.
We can get Angular velocity from wheel(s), we can get current gear, but what is needed is Gear optimal angular velocity. And that is defined in truck's XML. And because it is "starting point" for game's calculation, it wasn't needed check that value on this side - it is not passed to LUA.
Unless I think up some way, how to "find proper file, find value in that file based on current gear" I am in dead end...
@TemplarGFX said in truck lua object:
Some info that may be handy
Contents of the 'truck' input to functions :
airHissInterval | 0 chassisPrevAngVel | table: 3A4AB490 chassisPrevLinVel | table: 3A4AB670 elapsedDropletsTime | 0 elapsedStartTime | 4.6509867571294 engineHeavyVolume | 1 engineStartDelay | 1.6499999761581 engineTension | 0.12244302619981 exhaustCoolFactor | 3.6316114464784 exhaustLargeSmokeCooldown | 0.30169040337205 exhaustSmokeFogTensionSumm | 0.19766143224991 exhaustSmokeFogTimer | 0.64636128768325 exhaustStartFactor | 2 exhaustStartTime | 0 heavy | 0 intakeSubmergedTime | table: 0B353638 isBreakPulled | false isSteaming | false linVelPrev | 0 prevGear | 1 prevPedalAccelerate | 0 prevPedalBrake | -0 prevSteeringAngle | -0.070868775248528 revving | 0 soundAbruptStop | userdata: 1DBE39A8 soundBrakesSqueal | userdata: 1DBE4668 soundChassisStress | userdata: 1DBE4188 soundDiffLock | userdata: 1DBE4068 soundEngineHeavy | userdata: 1DBE4008 soundEngineHigh | userdata: 1DBE3948 soundEngineIdle | userdata: 1DBE3828 soundEngineLow | userdata: 1DBE3768 soundEngineRev | userdata: 1DBE3EE8 soundEngineStart | userdata: 1DBE3708 soundEngineStop | userdata: 1DBE3F48 soundEngineTrans | userdata: 1DBE4128 soundExhaustShot | userdata: 1DBE3E88 soundHandbrake | userdata: 1DBE3DC8 soundHeadLight | userdata: 1DBE3D08 soundWaterDropping | userdata: 1DBE4DE8 soundWaterGurgle | userdata: 1DBE4368 soundWheelExtrude | userdata: 1DBE43C8 soundWheelGrass | userdata: 1DBE4D28 soundWheelMud | userdata: 1DBE44E8 soundWheelSkid | userdata: 1DBE4D88 soundWheelSpinning | userdata: 1DBE4848 soundWheelSteer | userdata: 1DBE4788 soundWheelWater | userdata: 1DBE4C68 steamFactor | 0.049124785291675 suspStressFactors | table: 0B353228 this | userdata: 13861F98 trans | 0.029329785162929 transReverse | 0 turbo | 0 wasAllWheelDrive | false wasDifferentialLocked | false wasHandbrake | false wasHeadLight | false wheelsHeatFactors | table: 0B353318 wheelsSteamFactors | table: 0B353250 wheelsSteaming | table: 0B3536D8
contents of the 'truckInput' input to functions :
pedalAccelerate | 0 pedalBrake | -0 damageFactor | 0.031640626490116 torqueFactor | 0 isDifferentialLocked | false angVelVector | table: 3A3CFA58 hissOrg | table: 3A3CF9E0 gear | 1 isInWorld | true isAllWheelDrive | false isHandbrake | false hissScale | 0.53741586208344 linVelVector | table: 3A3CFB98 waterColor | table: 3A3CF990 steeringAngle | 0.082679130136967 isHeadLight | false isEngineIgnited | true
These are taken from a truck in motion for an example of the data. where it says table, it is either a vector (x,y,z) a color (r,g,b,a) or wheel data table (wheel1,wheel2,....)
mostly
Thanks, it helped. As for writing functions and loops, it is still very difficult for me. I started to learn JavaScript and in parallel, I'm preparing for my graduation from college. Now I'm writing a course project, and it takes a lot of time. I turned to this service for help https://www.rush-my-essay.com/ but still, my presence is also required. I hope that I'll finish everything soon and start studying what is really interesting to me.
@skipper_is said in truck lua object:
[0_1519040481839_truck.lua](Uploading 100%) Ah nice! Yea, interim method of getting RPM, like you mentioned on Discord, would be a lookup table for each truck..
Would be easier if we pass the data to Python - then we could have a little GUI allowing for easy truck selection
The fact that the game passes some details from the xmls through to the lua script (like the wheel radius), there must be other parts of the xmls that can be accessed.
I wonder whether wheel radii are different enough to be used as a "fingerprint" for the different trucks...Probably not:Edit:
Some of the trucks have reasonably unique radii, the K700 for example, but most share wheels with other vehicles, for example, the D535 has the same wheels as the E7310:Edit 2:
Figured out how to get AWD, diff lock and handbrake status to file. Was trying to write a boolean to file, and it wasn't having it, so converted to string and its all good.Here is my modified lua file if you're interested
Headings for the CSV would be:
Tension, Ground Speed, Wheel Speed, Gear, Wheel Radius, Revving/Clutch?, Class, All Wheel Drive, Diff Lock, Handbrake
Hi,
Sorry, this is going to be a bit of a stupid question, to access the data where do I need to place this file?
Many Thanks,