Arma 3
Setpos Wreck ?
I want to move a chopper wreck to players position but not have it on top of him.

Below is taken from wiki and the +10 refers to the z axis

Wreck1 setPos [getPos player select 0, getPos player select 1, (getPos player select 2) +10];

How do i modify this so the z axis is normal but have the thing 10 metres away from the player?
Zuletzt bearbeitet von DazaKiwi; 9. Dez. 2016 um 23:23
< >
Beiträge 15 von 5
I managed to find a line of code to get it working

Wreck1 setPos [(getPos player select 0),((getPos player select 1)+20),0];
realoksi 11. Dez. 2016 um 21:38 
Assuming you want the wreck on ground level, you can use setPosATL[community.bistudio.com] to set the objects Z position and rotation oriented with the below terrain. Here would be an example basing from your already provided code.

FYI, getPosWorld is the fastest method of getting an object position.

//Not tested Wreck1 setPosATL[((getPosWorld player) select 0), ((getPosWorld player) select 1), 0];

Using the ATL[community.bistudio.com] tranform type, we keep Z at 0 because Z is relative to the positions terrain height.

Now, there are a couple ways that I know of moving the object X amount of meters from the player. In this type of situation, you could certainly make use of the BIS_fnc_findSafePos[community.bistudio.com] function. With this function, you define a center point, a space of distance you want the object to spawn within, and a quite useful set of remaining parameters. This will also prevent the object from unwantedly clipping through objects that are too close, unlike manually setting its position.

//Also not tested //Please take a look at the provided link regarding the function for proper syntax safePos = [(position player), 10, 25, 5, 0, 20, 0] call BIS_fnc_findSafePos; //We use regular setPos here because the function already finds the correct height Wreck1 setPos safePos;

The other way is exactly as you provided above, but using setPosATL. You can manually add or subtract the amount to the players current position along the X and Y plane.

//Not tested either Wreck1 setPosATL[((getPosWorld player) select 0)-20, ((getPosWorld player) select 1)+15, 0]

I'm simply adding an alternate method of achieving this to the thread incase you find it useful, or others who skim across here are looking for a similiar solution
Zuletzt bearbeitet von realoksi; 11. Dez. 2016 um 21:44
Thanks Octane. I have only recently got my PC back after power down for two days. So i will try this out tomorrow. So this method is more superior simply because it will positioned correctly? especially like on a hill (in my mission there are three different possible places the wreck will be placed) the map is quite hilly.
Zuletzt bearbeitet von DazaKiwi; 13. Dez. 2016 um 1:27
realoksi 16. Dez. 2016 um 18:46 
Ursprünglich geschrieben von Daza_NZ:
Thanks Octane. I have only recently got my PC back after power down for two days. So i will try this out tomorrow. So this method is more superior simply because it will positioned correctly? especially like on a hill (in my mission there are three different possible places the wreck will be placed) the map is quite hilly.
Sorry for the 3-day delay, but in this type of situation, I would certainly recomend the BIS_fnc_findSafePos function on each of those locations. This will position it correctly and in a randomized fasion that'll add some originality to each playthrough.
DazaKiwi 16. Dez. 2016 um 19:35 
Thanks for your follow up reply :)
< >
Beiträge 15 von 5
Pro Seite: 1530 50

Geschrieben am: 9. Dez. 2016 um 23:23
Beiträge: 5