Jump to content
rocko

Mulitple UnitPlay instances

Recommended Posts

Just a quick (hopefully) question!

 

Does anyone know if the use of UnitPlay is limited?  I'm trying to get two seperate helicopters, with one .sqf each to fly into an LZ however only one of them will follow .sqf, the other acts under normal AI flight.

 

Can I only use one instance of UnitPlay?

Share this post


Link to post
Share on other sites

Having two instances should work just fine. (at least it did when I last used it in A2)

 

Make sure you didn't accidentially reference the same unit in both files.

Share this post


Link to post
Share on other sites

I used UnitPlay to move 10 different zodiacs in my Property of Mabunga mission, so it definitely works.  Post your code on how you start the two different helicopters if you haven't figured it out already.

Share this post


Link to post
Share on other sites

I'm having an issue with using two different unitplay instances.

The first is a F-35B taxing to the runway and taking off(works fine by itself).

The second, I placed a LHD and placed an AV-8B making separate path.sqf(path2.sqf) for it.

Upon playing the scenario, the F-35B spawns on top of the Harrier and carnage ensues of course!

Here is my files and structure: 

 

Init.sqf:

MyPath = compile preprocessFile “path.sqf”;

MyPath2 = compile preprocessFile “path2.sqf”;


rec = [f351] spawn Mypath;

rec = [av8b] spawn Mypath2;

 

Made 2 path.sqf's i.e. path and path2.

 

Made triggers on each A/C with on Activations of:

 

null = [f351] execVM "path.sqf";rec = [f351] spawn Mypath; (This works fine by itself-w/o AV-8B involved)

null = [av8b] execVM "path2.sqf";rec = [av8b] spawn Mypath2;

 

Anyone see an issue?

My goal is to resolve the horrid AI pathfinding issues on airfields and aircraft carriers.

 

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

×