I'm trying to get car energy readings (i.e. the amount of fuel), but I get weird results, namely player.vehicle.energy seems to contain only three possible values depending on the driving direction - when not moving it always contains the value 2666.666, when going forward it's 166.666 and when going backwards it's 1416.666
Is this a bug? Could I be doing something wrong? (I only print the value of energy every 60 ticks, nothing else) Is there an alternative way of reading the energy buffer of a car?
Car energy readings?
Re: Car energy readings?
Burner energy sources don't store the full buffer of energy in the property you're reading. There's a "remaining part of fuel being burnt" that gets transferred into the main energy buffer each tick. That's the progress bar you see when you open the car up.
I added LuaBurner for 0.15 that lets you read/write those properties in addition to the normal energy value.
I added LuaBurner for 0.15 that lets you read/write those properties in addition to the normal energy value.
If you want to get ahold of me I'm almost always on Discord.
Re: Car energy readings?
Thanks.
So if I understand correctly, the values I was seeing were energy consumed per tick? Why would it be larger when standing still or going backwards?
So if I understand correctly, the values I was seeing were energy consumed per tick? Why would it be larger when standing still or going backwards?
Re: Car energy readings?
Cars only consume power when moving based off how fast they're trying to move. Cars move slowly going backwards and not at all when not moving.sillyfly wrote:Thanks.
So if I understand correctly, the values I was seeing were energy consumed per tick? Why would it be larger when standing still or going backwards?
If you want to get ahold of me I'm almost always on Discord.
Re: Car energy readings?
Ok, makes sense.