Jump to content
Sign in to follow this  
Trip Hazzard

Change GlobalFuelConsumptionScale default to x1

Recommended Posts

As per the title I'm trying to work out how to change the default for GlobalFuelConsumptionScale default to x1 rather than x8

 

I've identified the protected static float s_fGlobalFuelConsumptionScale = 8 in class SCR_FuelConsumptionComponent : ScriptGameComponent where the default value is currently set.

 

I've also identified method SetGlobalFuelConsumptionScale(float globalFuelConsumptionScale, int playerThatChangedValue = -1) that is used to change the GlobalFuelConsumptionScale attribute.

 

What I can't work out is how best to change the default value?

 

Is it best to override the current default or call the SetGlobalFuelConsumptionScale() method somewhere to change the default when a game is started?

 

If the former, do I need to replicate the entire SCR_FuelConsumptionComponent class in my override class or can I just override the attribute  

protected static float s_fGlobalFuelConsumptionScale = 1 ;

If the latter, where would be best to call the method so that it resets the default value on when a new game starts?

 

Trip

Share this post


Link to post
Share on other sites

UPDATE : I worked out one method at least. I'm not sure if this is the 'best' way to do it, but it seems to work...

 

I watched the second Arma Reforger Modding Bootcamp video and that just happened to provide me with exactly what I needed to accomplish the task. I threw together this wee little script based on that bootcamp and it appears to do exactly what I wanted, setting the default fuel consumption to 1x rather than the normal default of 8x. It hasn't been tested much beyond a hasty check on a local listen server. I will test it more thoroughly on a dedicated server as soon as I can arrange for a restart.

modded class ArmaReforgerScripted
{
	override event void OnWorldPostProcess(World world)
	{
		super.OnWorldPostProcess(world);
		SCR_FuelConsumptionComponent.SetGlobalFuelConsumptionScale(1);
	}
}

Trip

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×