Arma 3
DazaKiwi Dec 9, 2016 @ 11:23pm
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?
Last edited by DazaKiwi; Dec 9, 2016 @ 11:23pm
< >
Showing 1-5 of 5 comments
DazaKiwi Dec 9, 2016 @ 11:27pm 
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 Dec 11, 2016 @ 9:38pm 
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
Last edited by realoksi; Dec 11, 2016 @ 9:44pm
DazaKiwi Dec 13, 2016 @ 1:27am 
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.
Last edited by DazaKiwi; Dec 13, 2016 @ 1:27am
realoksi Dec 16, 2016 @ 6:46pm 
Originally posted by 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 Dec 16, 2016 @ 7:35pm 
Thanks for your follow up reply :)
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Dec 9, 2016 @ 11:23pm
Posts: 5