Jump to content
JB47394

[SOLVED] Spawned vehicle engine won't start.

Recommended Posts

I'd appreciate some help with a problem that has vexed me intermittently for months.

 

I'm running vanilla ARMA 3 through the editor in multiplayer with my own scripts.  I'm spawning vehicles for a variety of purposes.  Spawn one up, give it a waypoint and off it goes.

 

But not always.  I have one staring at me right now that has the problem of never moving from its spawn location (a road).  My scripts ran to spawn it, give it a crew and doMove it.  It didn't move.  I've relocated it via Zeus, removed the AI crew and have been poking and prodding it via Zeus and the console, trying to figure out how to get it to move, but with no success.

 

The vehicle in question is the Tempest (Device), but it really doesn't matter which vehicle I spawn.  Ifrits seem to be the worst for this problem, and Marids almost never have a problem.

The real problem is that the engine refuses to start.

 

It has fuel.

It is undamaged. (getAllHitPointsDamage and damage)

 

I checked the rpt file and there are no messages from ARMA at the point where I spawn the vehicle.

What works:

 

I can get in as driver or passenger.
I can change seats while in the vehicle
I can look at the vehicle inventory both when in or out of the vehicle
I can Get out and Eject

I can see the Device fans turning.

 

I can get the Engine on option, but it does not start the engine and no Engine off option ever appears.  cursortarget engineon true also does not start the engine.

 

I've done each of the following, subsequently trying to start the engine.  None have had an effect.

 

I've lifted the vehicle off the ground a meter and dropped it
I've used Zeus to damage it to half health
I've used Zeus to restore it to full health
I've manually shot out the engine such that it was at damage level 1 (via getAllHitPointsDamage)
I've used the console to restore the engine to full health (via setDamage)

I've used the console to run a little script that keeps turning the engine on every 0.1 seconds (engineOn), while kicking out a systemchat message showing the isEngineOn state of the vehicle.  Checking immediately after the engineOn call shows that the engine is on.  Sleeping 0.1 second and checking it again shows that the engine is off.

What other things can I look at on a vanilla ARMA vehicle using Zeus and the console?  Any suggestions would be appreciated because I'd really like to nail this while I've got the malfunctioning vehicle.

 

One more data point is that while I've been doing all this testing and what-not, an AI decided to walk the 10km from the mission site, get in the vehicle and try to drive it off.  He couldn't get it started either.

Share this post


Link to post
Share on other sites

Where are you spawning your vehicles?

 

If you spawn at [0,0,0], which is sometimes underwater, then the game engine assumes that the vehicle engine has been flooded and will not let it start up again.

 

If that is the case, then try spawning at [0,0,1000] or something definitely above sea-level

 

Quote

 Ifrits seem to be the worst for this problem, and Marids almost never have a problem.

 

That would fit the bill as Ifrits aren't amphibious and Marids are.

 

If you are not sure, then post all of your spawn code up and we can have a look.

  • Like 2

Share this post


Link to post
Share on other sites

Super colossal awesome.  Thanks.  That's exactly what it was.

 

I'd never spawn at the origin because of the fear of spawn collisions.  I used to spawn at large negative coordinates (random) that were well above sea level, relying on probabilities to avoid spawn collisions.  I don't recall my reason, but I switched to spawning at the target location at -10km Z.  So I guess the new scheme had the problem that when the spawn script was interrupted between spawning and repositioning, ARMA would see where the vehicle was and consider its engine flooded.

 

I went back to the large random negative coordinates and the vehicles reliably get moving.

 

Unfortunately, there was a reason that I ditched that approach - but I don't recall what they were.  Are there problems with large negative spawn coordinates for ground vehicles, or spawning high in the air?  My old approach would spawn vehicles up to 10km up the air.  I've reduced that to be no higher than 2km, but I'm still curious about whether ARMA will react to vehicle engine oxygen starvation.

 

Thanks again.

  • Like 1

Share this post


Link to post
Share on other sites

Hey, glad that's sorted for you.

 

I don't think Arma has any simulation about oxygen starvation at altitude so you're okay there.

 

If you're really worried about spawning vehicles on top of each other, then you could use a line like this:

 

_spawnPos = ([0,0,0] getPos [300,random 360]) vectorAdd [0,0,900 + (random 200)];

 

So your vehicles will spawn within 300 metres of [0,0,0] at a height of between 900 and 1100 metres.

 

Obv feel free to modify the values.  :)

Share this post


Link to post
Share on other sites

[-10000 - random 10000, -10000 - random 10000, 1000 + random 1000]

 

I don't worry about collisions.

Share this post


Link to post
Share on other sites

Ha ha - fair play  :)

 

Just out of interest, if you're in the editor one day, do [9999999,9999999,0] and see how messy Arma is when it fails to cope with big numbers!

 

Quote

[-10000 - random 10000, -10000 - random 10000, 1000 + random 1000]

 

I don't worry about collisions.

 

Oh, and you should have used that code in the first place - then no engine washouts  ;)

Share this post


Link to post
Share on other sites
17 hours ago, das attorney said:

Oh, and you should have used that code in the first place - then no engine washouts  ;)

 

As I mentioned above, I did.  I switched away from it because of some kind of problem - which I don't recall now.  So I guess I'll have to re-encounter that problem or find out that it was a red herring that caused me to switch.  It would be nice if Bohemia would just let us specify an initial transformation matrix for the spawned vehicle...

 

17 hours ago, das attorney said:

[9999999,9999999,0] and see how messy Arma is when it fails to cope with big numbers!

 

Clearly the fractal wave stuff doesn't try to keep its calculations in the middle of the single precision range.  Not that there's any need for it to do so.

  • Like 1

Share this post


Link to post
Share on other sites

I was having "vehicle engine won't start" issue too.  Found this thread and discovered my problem was indeed flooded engines.  (Thanks das attorney!)  Adjusted my spawn points to ensure 100% they were above water.  Low and behold, shocked to discover I was still getting flooded engines.  Turns out selecting the right spawn point (above water factoring in AGL vs ASL, etc), is only half the battle.

 

You must also use the correct form of the createVehicle command.  The original createVehicle syntax will ignore the Z component of your spawn position and place the newly created vehicle on the surface of the land at that position (... even if that's under water!):

_vehic = "B_G_Offroad_01_F" createVehicle _spawnPos;

 

Using the extended syntax with "CAN_COLLIDE" overcomes this phenomenon, placing the vehicle exactly at your provided spawn position:

_vehic = createVehicle ["B_G_Offroad_01_F", _spawnPos, [], 0, "CAN_COLLIDE"];

Once I made this syntax switch, no more flooded engines. :z:

 

 

(Btw - Also wanted to point out that the flooded engine thing happens instantaneously.  Even if you create the vehicle underwater and teleport it to land all inside called code so that literally ZERO time elapses, it will still flood your engine.)

 

Share this post


Link to post
Share on other sites

instant flooded engines should be considered as a BUG!

One workaround more...

And Bis_fnc_spawnGroup is not adapted for vehicles. You can't spawn them at [0,0,0] (sea) prior to choose a convenient place (if you don't want see them exploding in a house).

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

×