BetterDeadThanZed

Added on buildings sinking?

36 posts in this topic

On 4/9/2016 at 3:23 PM, Hell Raiser said:

Does this happen in the same direction and same distance from objects on every part of the map? Or is it just in certain areas?

Yeah same distance and same direction across the whole map... but some objects don't do it, It seems but most of them do.

Share this post


Link to post
Share on other sites

Just a shot but can you check the position of the item on M3Editor, compare that with the location it puts the item at when it outputs it as a SQF, then check it in game using Shift+I (infistar). Compare all the coords and see if you can see at which stage it is going wrong. Maybe it could be too many decimal places out putted from M3Editor so Exile is rounding them up or down incorrectly?

 

Just a thought :)

Edited by Hell Raiser

Share this post


Link to post
Share on other sites
Advertisement

@Hell Raiser

Ok, Infistar says:

WorldSpace: [58.9944,[19886,14914.2,0.901154]], @198149

But In my file it says :

["Land_Pier_wall_F",[19886.2,14914.5,1.34878],[[0.857088,0.515171,0],[0,0,1]],[false,false]],

In Editor:

X= 19886.213  Y=14914.506  Z=0.802 and Z Rotation= 58.991

So something Is wrong xD

 

Here let me try a diagram of my objects...

][  <how its meant to be...

]    [ <How it Is...

How can one make it look like ][ xD

Edited by [DZW] ☠Real-Killer☠

Share this post


Link to post
Share on other sites

heres it all explained i believe:

http://killzonekid.com/arma-scripting-tutorials-float-to-string-position-to-string/

it has to do with when position get converted to strings (to get the export) it looses precision. Higher numbers get even less precision. for instance your Z coord will be precise (3.38621) but your X and Y's will get less precise depending on how far away they are from map origin [0,0,0]. X coords at 10722.2 could have been 10722.2202923 in the editor.  basically your coords get limited to 6 digits. 

Am I on the right track @maca134?

Share this post


Link to post
Share on other sites
2 hours ago, Fivenine said:

heres it all explained i believe:

http://killzonekid.com/arma-scripting-tutorials-float-to-string-position-to-string/

it has to do with when position get converted to strings (to get the export) it looses precision. Higher numbers get even less precision. for instance your Z coord will be precise (3.38621) but your X and Y's will get less precise depending on how far away they are from map origin [0,0,0]. X coords at 10722.2 could have been 10722.2202923 in the editor.  basically your coords get limited to 6 digits. 

Am I on the right track @maca134?

tested now, M3editor collects the data from 3den (objects, position etc) and converts it to string to export. I have modified killzones function to suit the function to export objects in M3E.

 

M3E_KK_fnc_positionToString = { 
    private "_fnc"; 
    _fnc = { 
        if (_this < 0) then { 
            str ceil _this + (str (_this - ceil _this) select [2]) 
        } else { 
            str floor _this + (str (_this - floor _this) select [1]) 
        }; 
    }; 
    format [ 
        "[""%1"",[%2,%3,%4],%5,%6]", 
         _this select 0, 
        _this select 1 select 0 call _fnc, 
        _this select 1 select 1 call _fnc, 
        _this select 1 select 2 call _fnc, 
        _this select 2, 
        _this select 3 
    ]; 
};


//example object:
_row = ["Land_Metal_rack_F",[12345.678,1234.45678,12.345678],[[0.955592,-0.294692,0],[0,0,1]],[false,false]];


// lets se what a stringed version of _row returns:
_string = str _row; 
diag_log _string; // returns: "["Land_Metal_rack_F",[12345.7,1234.46,12.3457],[[0.955592,-0.294692,0],[0,0,1]],[false,false]]"



//now lets use a modified version of killzonekids function and see what that returns:
_precisestring = _row call M3E_KK_fnc_positionToString;
diag_log _precisestring; // returns: "["Land_Metal_rack_F",[12345.677734,1234.456787,12.345678],[[0.955592,-0.294692,0],[0,0,1]],[false,false]]"

im not sure why KK's function dont return the exact coords given in _row, but its much more precise than before atleast

 

edit: Also, ive done some more testing. defining vector and dir before setting position seems to help as well

{
	private _object = (_x select 0) createVehicle [0,0,0];
	_object setVectorDirAndUp (_x select 2); 
	_object setPosASL (_x select 1);
	_object enableSimulationGlobal ((_x select 3) select 0);
	_object allowDamage ((_x select 3) select 1);
} forEach _objects;

 

Edited by Fivenine

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.