Reforger v1.8.13
Using the provided modded script:
Spawning a vehicle via a non-conflict vehicle depot makes the gas level be 30%, not 100% as scripted.
Spawning a vehicle via GM makes the gas level be 100%.
Give the provided code a try with GM and player spawning vehicles (non-conflict vehicle depot) in WB's HQC_Arland.
Found via my mod Limited Fuel Depot 1.3.2, also tested with a skeleton WB project. Something changed in 1.8.13 because it worked fine before. Watch the attached video. No other scripts, overrides, settings, or ghosts...just this one script. Given the use of this widely used component, this should not be an issue that lingers.
Root cause: MmaKagon found SCR_GameModeCampaign.OnEntityRequested() was overwriting the logic below. SCR_FuelManagerComponenet/SCR_FuelNode logic should only be hit once, but it looks like player-spawned vehicles it's done twice?
modded class SRC_FuelNode
{
override void OnInit(IEntity owner)
{
super.OnInit(owner);
SCR_FuelManagerComponent FuelManager = SCR_FuelManagerComponent.Cast(owner.FindComponent(SCR_FuelManagerComponent));
if (owner.IsInherited(Vehicle))
{
float setVehLevel = 100.0;
FuelManager.SetTotalFuelPercentage(setVehLevel / FuelManager.GetTotalMaxFuel());
Print("Vehicle fuel should have 100 gallons/liters (GM or non-Conflict vehicle depot), 30% otherwise.");
return;
}
}
}