Jump to content
Sign in to follow this  
kylejtown

SETPOSASL question

Recommended Posts

Just curious if anyone has ever run into this problem before. I'm using the LHD port mod (Link: http://www.armaholic.com/page.php?id=26197) I've got my units set up on the ship the way I want, but a curious thing happens, seemingly randomly, when I set a unit at a certain height, they don't always stay at that height.

For instance, I have two units which are going to function as "armories" where you can go and open the VA through them. I have both of them set at a height of 9.35. Thing is, sometimes they spawn at different heights.

I run the code through a script which is activated within the init.sqf:

INIT.SQF:
//setting up the arsenal in game
null = execVM "scripts\loadouts\LHDloadouts.sqf";
Arsenal_01 addaction ["Open VA",{["Open",true] call BIS_fnc_arsenal}];
Arsenal_02 addaction ["Open VA",{["Open",true] call BIS_fnc_arsenal}];

//Setup hanger within the LHD
null = execVM "scripts\LHDhanger\LHDhanger.sqf";
null = execVM "scripts\LHDdeck\LHDdeck.sqf";

and here is the LHDhanger.sqf script:

//Vehicles
LAV_01 setPosASL [position LAV_01 select 0, position LAV_01 select 1, 9.35];
LAV_02 setPosASL [position LAV_02 select 0, position LAV_02 select 1, 9.35];
MRAP_01 setPosASL [position MRAP_01 select 0, position MRAP_01 select 1, 9.35];
MRAP_02 setPosASL [position MRAP_02 select 0, position MRAP_02 select 1, 9.35];
MRAP_03 setPosASL [position MRAP_03 select 0, position MRAP_03 select 1, 9.35];
CRV_01 setPosASL [position CRV_01 select 0, position CRV_01 select 1, 9.35]; 

//Containers
Container_01 setPosASL [position Container_01 select 0, position Container_01 select 1, 9.35];
Container_02 setPosASL [position Container_02 select 0, position Container_02 select 1, 9.35];
Container_03 setPosASL [position Container_03 select 0, position Container_03 select 1, 9.35];


//Personal
Guard_01 setPosASL [position Guard_01 select 0, position Guard_01 select 1, 9.35]; 
Guard_02 setPosASL [position Guard_02 select 0, position Guard_02 select 1, 9.35];
Arsenal_01 setPosASL [position Arsenal_01 select 0, position Arsenal_01 select 1, 9.35];
Arsenal_02 setPosASL [position Arsenal_02 select 0, position Arsenal_02 select 1, 9.35];
[Guard_01, "STAND","ASIS"] call BIS_fnc_ambientAnim;
[Guard_02, "STAND","ASIS"] call BIS_fnc_ambientAnim;
[Arsenal_01, "GUARD","HEAVY"] call BIS_fnc_ambientAnim;
[Arsenal_02, "GUARD","HEAVY"] call BIS_fnc_ambientAnim;

Arsenal_01 and Arsenal_02 are the only two objects/units which have this happen to them in this mission, although I've seen it happen in other missions I've made. Just curious as too why they do this and if their is a fix/solution.

Thanks for any help.

Share this post


Link to post
Share on other sites

I think BIS_fnc_ambientAnim modifies positional values, especially considering animations. Are Guard_01 and Guard_02 fine? the function code is a hell of a mess to comb through so I can't really see if it directly fiddles with positional values or if it's just the animations, but I'd imagine it's something like that. Otherwise, test without ambientAnim and see if they stay/spawn at the correct height. (Keep in mind "Guard" executes moving animations)

Share this post


Link to post
Share on other sites

Interesting, and yea Guard_01 and 02 are completely fine. It only seems to affect arsenal 01 or 02. and it's random each time. I just tested it again and they were both right where I want them to be, but testing it again 02 was about a meter off the deck of the ship. i'll check it out without the animations this time.

Share this post


Link to post
Share on other sites

Right so I just went through the code, and it's actually using setPosASL/getposASL for logics and attaching. I'd see no problem with it but considering it's an LHD and especially a ported one (it was already a mess in ArmA 2 lol) I would not recommend using animations of any sort, as you'd be lucky to actually find an ASL value that gives perfect placement without any extra shenanigans ontop (wheels stuck in ground? better explode to bring my message across)

Share this post


Link to post
Share on other sites

Yea, just tested it without the animations running and they spawn just fine. I appreciate the help.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×