Page MenuHomeFeedback Tracker

Fuel usage coefficient
Closed, ResolvedPublic

Description

I'd like to request a way to affect engine fuel usage with a scripting command. It is sort of possible right now but requires per frame handling as well as accounting for HitFuel damage, figuring out the formula, multiplying by time delta, etc., a lot of headache, borderline impossible for novice scripters yet very useful as a gameplay tool.

This coefficient should only affect usual engine fuel usage without taking leaking into account.

Suggested syntax:
ENTITY setFuelUsageCoef NUMBER;
NUMBER = getFuelUsageCoef ENTITY;

Network sync: No sync needed for simplicity of implementation, I'd leave it fully local.

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

SaMatra created this task.May 4 2023, 5:19 PM
_SLIN_ added a subscriber: _SLIN_.May 4 2023, 7:10 PM
honger added a subscriber: honger.May 4 2023, 8:22 PM
TRAGER added a subscriber: TRAGER.May 5 2023, 12:49 AM
Leopard20 set Ref Ticket to AIII-56018.
Leopard20 changed the task status from New to Feedback.EditedOct 30 2023, 4:38 PM

Revision: 151117
set/getFuelConsumptionCoef

Incredibly useful, finally those scripted workarounds can be discarded and performance can improve as a result ;) Gonna be testing this asap

Did some testing, works great. Doesn't sync as expected but also doesn't save in a save file, might be worth mentioning that on biki.

Leopard20 added a comment.EditedNov 12 2023, 12:38 AM

Sync issue has already been fixed. Will look into the saving issue

Sync issue has already been fixed. Will look into the saving issue

I hope command doesn't broadcast and its just synced in generic update message. Personally I'd preferred if it wasn't synced at all, but I'm fine with either.

@SaMatra can you please test the latest dev branch? both issues should be fixed now

@SaMatra can you please test the latest dev branch? both issues should be fixed now

Tested, both network sync and save-load work properly now.

For those curious and reading this, the update arrives in generic message and setFuelUsageCoef doesn't broadcast anything right away.

Guess the ticket can be marked as resolved now.

Leopard20 closed this task as Resolved.Nov 25 2023, 5:43 PM