• 4
Bones51

[SOLVED] Vehicles Disappearing or loading on their side

Question

So just found out something interesting, and a temporary work around the devs might want to apply.

Certain Surfaces do not seem to play well with the vectorup command. Invariably when a vehicle is on one of these surfaces the z element of vectorup is saved to the database as 0. On server restart, when vehicles are loaded from the database it picks up this 0 and spawns the vehicle on it's side.

Not sure if its an arma issue or something about the database. I tried to change the "Exileserver_object_vehicle_database_update" file to check if the z element of vectorup result was 0 and set it to 1 before updating the db, but it seemed to have no effect.

However, and this will help everyone with issues of disappearing or exploding vehicles, if you modify "ExileServer_object_vehicle_database_load" to include: 

if ((_vectorUp select 2) == 0) then {_vectorUp set [2,1]};

immediately after the line containing:

_vectorUp = [_data select 14, _data select 15, _data select 16];

Whenever the vehicle is loaded from the database with this error, the line above will put the vehicle back on it's wheels when loading it from the DB.

PROBLEM SOLVED! And no need to use a vehicle invulnerability script.

Since the problem ALWAYS sets the vectorup z axis to 0, and i can't barely even imagine a situation where a vehicle would be saved to the DB exactly on its side, this only addresses the specific issue without creating other problems.

I found a way to consistently reproduce the problem, if a dev wants details let me know and i'll provide.

6 people like this

Share this post


Link to post
Share on other sites

6 answers to this question

  • 0
try 
{
	if !((vectorMagnitude _vectorUp) isEqualTo 1) then 
	{
		throw true;
	};

	if ((_vectorUp select 0) > 0.95) then 
	{
		throw true;
	};

	if ((_vectorUp select 1) > 0.95) then 
	{
		throw true;
	};

	if ((_vectorUp select 2) isEqualTo 0) then 
	{
		throw true;
	};
}
catch
{
	_vectorUp = [0, 0, 1];
};

This will go into the next version. It based on two different problems that are due to floating point precision / string conversion issues.

4 people like this

Share this post


Link to post
Share on other sites
  • 0

Just an additional update, tried it on the same surface in another location. Didn't get the same problem. Could be the specific location, or a combination of factors. I suspect that it has something to do with the combination of surface and nearby buildables. Had a look through all the database update code and can't see anything specific that might be causing it.

Having said that the solution still works like a charm!

If anyone tries the fix, please read up on how to replace exile standard code with custom code using the config.cpp first. 

Share this post


Link to post
Share on other sites
Advertisement
  • 0

Big thanks! Fixed the vehicle problem - and with a bit of common sense i also fixed supply crate containers ( i guess they flipped for the same reason ) - now no longer half of my server is on its side! :P

Share this post


Link to post
Share on other sites
  • 0
On 7/31/2016 at 9:47 AM, Fidycent said:

Big thanks! Fixed the vehicle problem - and with a bit of common sense i also fixed supply crate containers ( i guess they flipped for the same reason ) - now no longer half of my server is on its side! :P

What was your fix for the crates? Was it the same line pasted into ExileServer_object_container_database_load ?

Share this post


Link to post
Share on other sites
  • 0

We have closed this thread and marked it as solved.

Share this post


Link to post
Share on other sites
Advertisement
Guest
This topic is now closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.