Jump to content
priglmeier

Adding any units or objects to LCC explodes immediately in game

Recommended Posts

I am working on an EF mission using the Tanoa map.

I added an LCC offshore and tested it in SP with the driver's character. I works properly.

 

Later, I added some units to the LCC and an amphibious vehicle.

Every time I start the game the LCC explodes when loaded now. WHY?

I haven't found recent reports of this behavior, but there was an old bug like this 10+ years ago.
No idea what the fix is. Let me know please.

Share this post


Link to post
Share on other sites

Not really a bug. You can't place the vehicle in LCC via the editor (too tricky). Use instead the vehicle in vehicle functionality.
For example, adding 2 slammer tanks in cargo (with their crew or not), name the tanks tk1 tk2 (or else), then:
in init field of the LCC:

if isServer then {{this setVehicleCargo _x} count [tk1,tk2]};

 

Note: You have also a LCC static (in props editor) . You can place your vehicles inside, in editor, for scenery if needed.

  • Like 1

Share this post


Link to post
Share on other sites

That doesn't work.
if isServer then {{this setVehicleCargo _x} count [tk1,tk2]};

Created a LAV-25 as variable lav1

LCC is variable name lcc1

Tried to add this to the Init for LCC1
if isServer then {{this setVehicleCargo _x} count [lav1]};

Strange. It complains about "Init missing ;"
Cleary the line ends with ";"
 

Share this post


Link to post
Share on other sites
if isServer then {{this setVehicleCargo _x} count [lav1]};

has two extra-invisible characters ruining the code and throwing errors. If you want to see them, just re-copy/paste your code and wrap it as code (the <> icon above). If red dots appear, your code suffers for bad usage of the forum editor (and this eternal issue).
As general rule: Copy/paste only wrapped code, then check for your own final code with the code wrap again. Eliminate all red dots (extra-characters).

That said, I don't know where does your LAV-25 come from. One sure thing, its bounding box must be OK for vehicle in vehicle with LCC. I tested with two tanks, so LAV-25 should be fine.
For just one vehicle, you don't need to loop the code for an array (single element). Just:

if isServer then {this setVehicleCargo lav1};


 

Share this post


Link to post
Share on other sites

Sorry, my bad, yes that does work with a single LAV.
When I add the second LAV, I am back to explosions. I like explosions but not here. 🙂

if isServer then {this setVehicleCargo lav1, lav2};

Share this post


Link to post
Share on other sites

I've seen similar issues when the vehicles or units are positioned too close to the LCC's geometry or each other, causing collisions as soon as the game starts. Try adjusting the positions slightly and make sure the amphibious vehicle isn't overlapping or colliding with anything inside the LCC. You could also try adding a slight delay or checking for mod conflicts if you're using any.

Share this post


Link to post
Share on other sites
1 hour ago, priglmeier said:

Sorry, my bad, yes that does work with a single LAV.
When I add the second LAV, I am back to explosions. I like explosions but not here. 🙂

if isServer then {this setVehicleCargo lav1, lav2};

The very first rule for scripting is to pay attention for syntax.
vehicle setVehicleCargo  cargo

where :

- vehicle is an object (LCC or variable this, referring to it in its  init field is OK).

- cargo is also an object. So lav1 or lav2 or else.

The fact is this setVehicleCargo lav1, lav2 is not correct, because lav1,lav2 is neither an object or an array of them (not expected here anyway).
You can loop, as I did for tanks:
if isServer then {{this setVehicleCargo _x} count [lav1,lav2] };

 

Of course, lav1 and lav2 must be ashore in editor, not in cargo space of the LCC. The command setVehicleCargo does the trick.

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

×