tbox1911 / Liberation-RX

ArmA 3 - Liberation RX - Mission
GNU General Public License v3.0
64 stars 62 forks source link

Problems with the “Z” coordinate datum in the <classnames_transport> file. #169

Open Affliction-TK opened 5 days ago

Affliction-TK commented 5 days ago

I am trying to create a preset on RHSUSAF in the /mod_template folder, using the files in /A3_BLU as a sample. I noticed that the classnames_transport.sqf file is used to hold the relevant code parameters for loading cargo:

box_transport_config = box_transport_config + [
[ “B_G_Offroad_01_F”, -5, [0, -1.55, 0.2] ]
];

The composition of this parameter is easily understood by the code comment:

[“classname” , unload Dist. , [x1,y1,z1],[x2,y2,z2], ......]

Obviously, the load position coordinates are relative coordinates in terms of vehicle coordinates.

I calculated the coordinates of the cargo using the eden editor without any problems, but the carriers placed in the eden editor's VR scene all have a z coordinate of 0, which leads to:

I moved the cargo to the appropriate position, recorded its corresponding coordinates, and subtracted it from the carrier's coordinates to get the relative coordinates. The x,y relative coordinates obtained by doing this work fine, but the z coordinates are too high, causing the cargo to float.

I've tried various methods but can never get an accurate base value for the z-coordinate. Can you please tell me how to calculate the z coordinate relative position? (I really want the cargo to fit perfectly in the plane :>)

PS: This mission is really great, I last played it in version 0.9x, which was almost 2~3 years ago, I recently returned to play Arma3, and I was surprised to find that this mission has been updated to 2.5x, I can't wait to experience it, and it's even better. Thank you and support the author for his efforts!

tbox1911 commented 5 days ago

hi buddy,

first of all, thank you for kind words!, I'll appreciate :)

the placement of object work as:

1) from _box_transportconfig list you have the minimal position for all objects (like "B_supplyCrate_F")

2) from _box_transportoffset list you can set fine tuned position for a specific object (like "Land_BarrelWater_F")

that why some object (like "B_supplyCrate_F") have 0,0,0 offset, that mean they use the default place in the vehicle


how to find the right object's position (try and error):

let's say for vehicle “B_G_Offroad_01_F” and object "Box_NATO_Wps_F":

load LRX, start the mission, create the vehicle and one arsenal/ammobox object and the object you want "Box_NATO_Wps_F"

in console, execute:

box_transport_config = [
         [ “B_G_Offroad_01_F”, -5, [0, 0, 0] ]
];

first, search for global position, that concern object "B_supplyCrate_F", "Box_NATO_AmmoVeh_F", etc ... only edit _box_transportconfig list to find the right position.

(better be in god mode to avoid explosive side effect!) in game, "Load" object on the vehicle, note the difference from [0,0,0] and offset, unload object

edit offset value in _box_transportconfig for “B_G_Offroad_01_F”, and execute again

(loop on this process until you found the perfect position for the global object)

you should end with value close to: [ “B_G_Offroad_01_F”, -5, [0, -1.55, 0.2] ]

once it's done, you can search (fine tuned position) for objects that can't use global position (like "Box_NATO_Wps_F")

add "Box_NATO_Wps_F" to _box_transportoffset,

box_transport_offset = [
    ["Box_NATO_Wps_F", [0, 0, 0] ]
];

again, "Load" object on the vehicle, note the difference from [0,0,0] and offset, unload object edit offset value in box_transport_offset for object “Box_NATO_Wps_F”, and execute again

you should end with value close to: ["Box_East_Wps_F", [0, 0, -0.6] ]

when you are done, report the value you found in file "classnames_transport.sqf"

feel free to come on our Discord to discuss about this: https://discord.gg/hzGemsZ4

many preset already exist for RHS, take a look in: https://github.com/tbox1911/LRX_MOD/tree/main/LRX_Template/mod_template

if you add missing entry (vehicle or object) please let's me know and send me the edition, so I can update the template.

see you!

tbox1911 commented 4 days ago

note: to have the "Load" action, the mission must have the vehicle and object defined (even if the offset is wrong) in box_transport_config and box_transport_offset