Closed JakobTischler closed 10 years ago
power consumption base on chopper state is already taken into base "mr engine". Use the "self.chopperActivated" variable of the default game engine. We will see when I start converting on of the axial flow.
@quadural: can I simply use realWorkingPowerConsumption
with the combines, or do they need a different variable?
@JakobTischler : I don't get what you are trying to do => "different power based on chopper state" ? or exhaust / flap ?
regarding the "chopper state", it seems to work "naturally" as with the base game "mr" combine. (when I engage the chopper, the power consumption is raised, even for wheat)
I don't get what you are trying to do => "different power based on chopper state" ? or exhaust / flap ?
In this case I was talking about the chopper state. But if what you say is correct, then apparently we don't need a script for that at all :).
i checked it, and it is fine as far as i am concerned
Concerning the exhaust amount: I think the easiest to handle this is to just set the self.motor.lastMotorRpm
variable and let the default scripts handle the rest:
-- load():
self.exhaustParticleSystems.maxRpm = 1;
-- update()
self.motor.lastMotorRpm = RealisticUtils.linearFx(self.realLastMotorFx^0.5, 0.1, 1);
Would there be any problems with MR if self.motor.lastMotorRpm
actually existed?
I don't think this is a problem for the "mr engine". The exhaust and the flap should depends on the engine load. (IRL, exhaust would depend on the engine rpm and load, but we only have "on" variable in our case) And so, we can adjust the "lastMotorRpm" using the "self.realSoundMotorFx" parameter (available client side) => self.motor.lastMotorRpm = Utils.clamp(self.realSoundMotorFx, 0.1, 1);
I'm a bit confused about the three different variables, all of which are viable lerp variables for the motor load in my opinion:
self.realMotorLoadS
self.realLastMotorFx
self.realSoundMotorFx
Could you maybe explain what the exact difference between all those is? I even see in mrDynamicExhaustingSystem.lua
(which I'm gonna use for the Ursus tractors) that you use realSoundMotorFx
for the cap, but realMotorLoadS
for the exhaust system.
only the "self.realSoundMotorFx" is available "client side". ("how much" of the engine sound we want to play => take into account the cuurent engine load and vehicle speed)
Hm, didn't even see your reply until now. So does that mean that realSoundMotorFx
is based on realMotorLoadS
? And also, that I should use realSoundMotorFx
on all occasions?
on server side, you can use the "motorLoad" on client side, you can't, and so, you have to rely on the "realSoundMotorFx"
little example of the "getrpm" script for the JD S650 combine : (headache ?)
--DURAL : mr value
--local lastRpm = math.max(0, self.motor.lastMotorRpm);
local lastRpm = 850;
if self.realManualGearSet then
lastRpm = RealisticUtils.linearFx(self.realSoundEngineRevFx, 850, 2300);
else
local engineRpmFx = 0.9*self.realSoundMotorFx;
if self.realSoundSpdFx>1.05 then
--engine braking power => high rpm
engineRpmFx = math.max(engineRpmFx, self.realSoundSpdFx);
elseif self.realSoundMotorFx>1.1 then
--engine braking power => high rpm
engineRpmFx = math.max(engineRpmFx, 0.2*self.realSoundSpdFx + self.realSoundMotorFx);
end;
lastRpm = RealisticUtils.linearFx(engineRpmFx, 850, 2100);
end;
Exemple of a "get smoke alpha" script :
-- alpha function of engine load on moreRealistic vehicles
local alpha = 1;
if self.realManualGearSet then
alpha = (self.exhaustingSystem.maxAlpha-self.exhaustingSystem.minAlpha) * math.max(0, self.realSoundMotorFx - self.realSoundEngineRevFx^2)+self.exhaustingSystem.minAlpha;
elseif self.isServer then
alpha = ((self.exhaustingSystem.maxAlpha-self.exhaustingSystem.minAlpha) * self.realMotorLoadS)+self.exhaustingSystem.minAlpha;
else -- client side, default CVT gearbox
alpha = ((self.exhaustingSystem.maxAlpha-self.exhaustingSystem.minAlpha) * self.realSoundMotorFx)+self.exhaustingSystem.minAlpha;
end;
Concerning all the extra specs, do they need any MP adaptation? Like, for example, a broadcast for realCurrentPowerConsumption
?
"realCurrentPowerConsumption" is a server side variable. no need to broadcast it since this variable is not set (or used) client side.
Since, as I mentioned, I have almost no clue concerning MP, I'll ask about the other specs.
RealisticBaleWrapper
we set the bale's fill level - and this is not restricted to isServer
. Do we need an MP event for that?VariableSprayUsage
we set sprayLitersPerSecond
- and this is not restricted to isServer
. Do we need an MP event for that?DynamicExhaustingSystem
already has readUpdateStream
/ writeUpdateStream
where realMotorLoadS
is streamed. If the vehicle has a exhaust cap / flap, it will get a random rotation based on realSoundMotorFx
. Would that one need to be streamed as well?Change uploaded, but it needs mp testing to be validated
This will basically be a TODO list for certain vehicles where we need some extra script stuff. Will be updated.
Titanium Case combines: probably needs different power consumption based on chopper active/inactive (self.chopperState
: 0 = transport, 1 = straw, 2 = chopper)Note: a bit difficult with the Titanium Case tractors, as the script is coupled with the digital speed display. Maybe only overwrite SteerableExtension.update?Ursus bale loader: when any animation is playing, increase rpm// TODO: userealAutoStackerWorkingPowerConsumption
instead