Jump to content
Sign in to follow this  
deltagamer

LHD Spawn Issue (SetPos, CreateVehicle and Model Segments)

Recommended Posts

Hey everyone,

I've been working on a LHD mod for a bit now, whilst using the Atlas LHD as a reference model. However I've seemingly hit a brick wall that's really hindering any further progress on the release and future development of this mod. Basically I've encountered the 'Invisible Gap' problem that sometimes has the player fall through the deck (Roadway issue maybe?). A few other Ship mods with multiply large parts had this problem at some point or possibly even still have this issue. I believe I have narrowed the issue down to it being an uneven sea level but there could be many unknown factors that could be causing my problem. I'm really needing a better way to spawn an object this large however I have no clue where to start.

Does anyone have decent knowledge on how to help me out with my issue?

I'm using ArMaTeC' script to spawn the whole LHD currently:

// Original LHD placement script by ArMaTeC
if (isServer) then {
_LHDspawn = _this select 0;
_LHDdir = getdir _LHDspawn;
_LHDspawnpoint = [getposasl _LHDspawn select 0, getposasl _LHDspawn select 1, 1.2]; //1.2
deletevehicle _LHDspawn;
_parts = 
[
               "DEGA_Land_LHD_house_1",
               "DEGA_Land_LHD_house_2",
               "DEGA_Land_LHD_1",
               "DEGA_Land_LHD_2",
               "DEGA_Land_LHD_3",
               "DEGA_Land_LHD_4",
               "DEGA_Land_LHD_5",
               "DEGA_Land_LHD_6",
               "DEGA_Land_LHD_6_End",
               "DEGA_Land_LHD_elev_R" 
];
{
	_dummy = _x createvehicle _LHDspawnpoint;
	_dummy setdir _LHDdir;
	_dummy setpos _LHDspawnpoint;
} foreach _parts;	
};

The mod is also open source so if you want to check it out for yourself you can download it at my GitHub:

https://github.com/deltagamer/DEGA_LHD

Share this post


Link to post
Share on other sites

Hey delta, I may be completely wrong but it could be because you are using setPos, maybe try changing it to maybe setPosASL? Reason being is because above you are using getPosASL.

You could even use the new commands which are supposed to be more accurate (getPosASLVisual used with setPosASL).

Nope just noticed that it should be all spawning at the same height (1.2) so I have no idea.

Edited by Lala14

Share this post


Link to post
Share on other sites

Thanks for responding and trying to help me out, its sucks that there is no decent support for larger objects of this scale in arma 3. If you can think of anything else that might help me out then let me know as I'm going to need all the help I can get here.

Share this post


Link to post
Share on other sites

I downloaded this and tried it last night.

It spawns fine with the script you've got but I tried using setPosASL on the position and it messed up the spawning.

I looked through the config and saw lots of errors about "UV compression" like this one:

Warning: UV coordinate on point 12806 is too big UV(-800.721863, -459.863708) - the UV compression may produce inaccurate results

Not sure if that is responsible for the gaps in the roadway. Sorry I can't be more help as I don't know that much about modelling in O2.

Share this post


Link to post
Share on other sites
I downloaded this and tried it last night.

It spawns fine with the script you've got but I tried using setPosASL on the position and it messed up the spawning.

I looked through the config and saw lots of errors about "UV compression" like this one:

Not sure if that is responsible for the gaps in the roadway. Sorry I can't be more help as I don't know that much about modelling in O2.

Yeah I've expereinced this issue myself, it was hilarious when I first saw it.

http://i.imgur.com/9m9duro.jpg (241 kB)

As for the UV mapping, I don't think that should effect the issue I'm having and it should hopefully be an easy fix. Could you possibly move the LHD around at different locations of the map on Stratis/Atlis and let me know if you get the Invisible Gap problem when running on the deck at all?

Share this post


Link to post
Share on other sites

lol yeah setPosASL is not good for this! :)

Here's a test mission so you can press 0,0,0 to spawn a carrier 500m in front of you

0,0,9 teleports you above the deck.

I've noticed it's the same sections of deck that are the problem.

Between "DEGA_Land_LHD_1" and "DEGA_Land_LHD_2" and also between "DEGA_Land_LHD_5" and "DEGA_Land_LHD_6"

https://dl.dropboxusercontent.com/u/101800212/lhd.Altis.7z

Share this post


Link to post
Share on other sites

I added a sleep 1; into the script and got interesting results. It never really worked however visually the model had different elevations.

Share this post


Link to post
Share on other sites

Interesting finding with the sleep and the different elevations. So far I assumed that most gaps are from intersecting LODs, e.g. road and geo overlap somehow and cause the engine some confusion. One could also try to spawn the carrier parts and get the position later on and compare them. If the altitude is all different, that might explain the gaps.

Share this post


Link to post
Share on other sites
Interesting finding with the sleep and the different elevations. So far I assumed that most gaps are from intersecting LODs, e.g. road and geo overlap somehow and cause the engine some confusion. One could also try to spawn the carrier parts and get the position later on and compare them. If the altitude is all different, that might explain the gaps.

Yeah I encountered the lod issues a few times when developing the interiors of the ship, its really strange. I've made sure that the lods are not causing this issue but it might be best to have someone else run over it to make sure. I've spoken with J0nes and I asked if it would be ok for him to check it out and see if he can fix the issue I'm having. He also kindly gave me the sources to the Atlas Mod so I could have a look myself however I don't understand how he managed to get it working.

Share this post


Link to post
Share on other sites

Hey I was actually going to suggest possibly using this command, setVehiclePosition.

And using the parameter "CAN_COLLIDE" may fix everything.

Ok nope, it spawned all the parts into the centre.

Edited by Lala14

Share this post


Link to post
Share on other sites

Yeah I'm still struggling to get anywhere myself. I spoke with J0nes and I've been told that the best way to get it working would be to have an invisible landing pad and set it to 0 ASL so it should be flat on the water and have the ships parts spawn onto that. When I get the chance I'll have a look at redoing the spawn script in order to have something like that working.

Share this post


Link to post
Share on other sites

i'm very interested to use your ship, backported to OA ideally.

in OA we spawn the LHD using a BIS function they wrote that fixed the broken deck issue, so looking into how they did this may help you out

in mission.sqm

(also needs the functions module placed in editor

		class Item33
	{
		side="LOGIC";
		class Vehicles
		{
			items=1;
			class Item0
			{
				position[]={8091.1509,0.34830463,716.58838};
				azimut=55;
				id=235;
				side="LOGIC";
				vehicle="Logic";
				leader=1;
				skill=0.60000002;
				text="LHD1";
				description="LHD1";
			};
		};
	};

in init.sqf

if (isServer) then 
{
waituntil {!isnil "bis_fnc_init"}; LHD1 call BIS_EW_fnc_createLHD;
};

maybe track down that function in the OA code or see if it works already in A3

for my modified ship

http://forums.bistudio.com/showthread.php?181411-FRL_Air-mod-WIP&p=2956088

i changed a couple of the models but kept the p3dthe same as the bis ones, and made a patch of their stock classes, so my modified ship spawns perfectly!

Edited by eggbeast

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  

×