Jump to content
Sign in to follow this  
Tike

Things falling though custom spawned LHD

Recommended Posts

Hi,

I've already googled for this problem but couldn't find a solution.

I'm using the init.sqf plus Game Logic to spawn in a LHD in my mission. However, at the start of the mission, it still seems to load, which means items/vehicle fall through it.

Is there any solution to this? Anyway to disable gravity for a moment or freeze vehicles? Any solution would be greatly appreciated.

Thanks in advance,

Tike

Share this post


Link to post
Share on other sites

What kind of script are you using? What map is it? Is the server dedicated or not? More info please :)

I have used this script before and it works fine:

in your game logic init:

_xhandle = [this] execvm "createCarrier.sqf"

and making a createcarrier.sqf file in your mission and then adding this code in there:

_replace = _this select 0;
_pos = getpos _replace;
_dir = getdir _replace;

if (isServer) then {
_parts = [
	"Land_LHD_house_1",	"Land_LHD_house_2",	"Land_LHD_elev_R",	
	"Land_LHD_1",	"Land_LHD_2",	"Land_LHD_3",
	"Land_LHD_4",	"Land_LHD_5",	"Land_LHD_6"
];
{
	_veh = _x createvehicle _pos;
	_veh setdir _dir;
	_veh setpos _pos;
} foreach _parts;

deletevehicle _replace;
};

Credit for the code goes to Rommel who gave it to me ages ago :) You can also change the createcarrier.sqf to whatever you want just make sure you change it in both the init line and the file name!

Share this post


Link to post
Share on other sites

I assume you are using the Functions Module and a Game Logic where you want the LHD to be?

Does your init have this:

waituntil {!isnil "bis_fnc_init"};
LHD1 call BIS_EW_fnc_createLHD;

I believe what is happening is that the LHD is spawned a little later because you are telling it to "waituntil" the Functions Module is ready to go. If you are using CBA by chance the Functions Module is pre-loaded and you can remove the top line of the above code.

Another option is to place Game Logics where you want the vehicles to be an the LHD and simply have them teleport onto the Logics with a 2 second countdown trigger.

I'd look into the script provided in the previous post. It shouldn't need any delay to create that LHD.

Share this post


Link to post
Share on other sites
What kind of script are you using? What map is it? Is the server dedicated or not? More info please :)

I have used this script before and it works fine:

in your game logic init:

_xhandle = [this] execvm "createCarrier.sqf"

and making a createcarrier.sqf file in your mission and then adding this code in there:

_replace = _this select 0;
_pos = getpos _replace;
_dir = getdir _replace;

if (isServer) then {
_parts = [
	"Land_LHD_house_1",	"Land_LHD_house_2",	"Land_LHD_elev_R",	
	"Land_LHD_1",	"Land_LHD_2",	"Land_LHD_3",
	"Land_LHD_4",	"Land_LHD_5",	"Land_LHD_6"
];
{
	_veh = _x createvehicle _pos;
	_veh setdir _dir;
	_veh setpos _pos;
} foreach _parts;

deletevehicle _replace;
};

Credit for the code goes to Rommel who gave it to me ages ago :) You can also change the createcarrier.sqf to whatever you want just make sure you change it in both the init line and the file name!

Listen server, Sahrani Map, using the script which eegore posted c:

Sorry for the lack of information it was 1 am and I was tired, haha

I assume you are using the Functions Module and a Game Logic where you want the LHD to be?

Does your init have this:

waituntil {!isnil "bis_fnc_init"};
LHD1 call BIS_EW_fnc_createLHD;

I believe what is happening is that the LHD is spawned a little later because you are telling it to "waituntil" the Functions Module is ready to go. If you are using CBA by chance the Functions Module is pre-loaded and you can remove the top line of the above code.

Another option is to place Game Logics where you want the vehicles to be an the LHD and simply have them teleport onto the Logics with a 2 second countdown trigger.

I'd look into the script provided in the previous post. It shouldn't need any delay to create that LHD.

Yea, I have exactly that script. I don't know anything about scripting so I couldn't know what the waituntil means (although it seems pretty obvious).

I don't know how to do the teleporting, so I'll just try removing the waituntil in the init.sqf and see if that works.

Thanks both of you for your help! I really appreciate it!

Share this post


Link to post
Share on other sites

Ok, yeah it was ~2 in the morning when I posted sorry for not being more helpfull, good luck with your mission!

Share this post


Link to post
Share on other sites
Ok, yeah it was ~2 in the morning when I posted sorry for not being more helpfull, good luck with your mission!

Oh please, you were pretty helpful, as same as eegore :3

EDIT: If I may ask, what's the difference between both of the scripts?

Edited by Tike

Share this post


Link to post
Share on other sites

The one I sent have the script itself in the mission, the one he sent use the same script I belive but BI used his way of doing it in a mission called 'Eagle Wing' and it basicly finds the LHD script somewhere in the EW.pbo in ArmA2OAs files.

BIS_EW_fnc_createLHD

BIS=BOHEMIA INTERACTIVE STUDIO

EW=EAGLE WING

FNC=NOT SURE WHAT IT MEANS REALLY

createLHD=CREATES THE LHD

BIS_EW_fnc_createLHD is basicly the same script but instead of being manually into a mission its in the game bu default.

(Kind of hard to explain when youre not the best at english but I hope you got it :))

EDIT: Basicly the script I sent adds it manually and his adds it the way bohemia did it, its all the same.

Green|

Share this post


Link to post
Share on other sites

FNC means Function.

The primary difference is that the function module method requires no scripting.

Share this post


Link to post
Share on other sites

Alright cool, thanks for both of your answers.

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  

×