Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
wawa

Need help with setting up air extract\insertion

Recommended Posts

Hi, so this issue I am having is for creating multiple markers on the Mission... using the name's of each marker and assigning two individual SQF files for either Extraction or Insertion. But long story short, I want to make a currently placed Black Hawk on the mission provide either Extraction or Insertion by Radio Commands. So, I set up a Black Hawk with the label "BH01". This was named in order to call the associated in-game object with a variable called _BH01 in a SQF file. So after doing this, I wanted to set a waypoint for _BH01 to go to a Marker named "BHWP1", which is stored into a variable called _BHWP1... and then I placed a trigger with Radio Alpha and in the INIT field, I carefully placed nul = [bH01] ExecVM "Scripts\Extract.sqf". But, I never could get the SQF code to compile without errors in the debug, so I thought I would drop by here and get some additional support. If anyone who understands the ArmA 2 script language, post me the accurate way of going about coding a Waypoint for an Existing unit in the game. It would be not only helpful to my mission, but educational for future reference in scripting. I have some experience with other scripting languages, Unreal Script v1.0... Quake... C++ and some HTML\CSS.

//Object = vehicle "unitName" <-- ???

_start = getMarkerPos "BHWP1"; // Find the Marker, can be used for extraction\insertion

_end = getMarkerPos "BHWP2"; // location of drop off.

_BH01 = vehicle "BH01";

_BH01 setBehaviour "CARELESS";

_BHWP1 addWaypoint [_start, 0];

_BHWP1 setwaypointtype "TR Unload";

/*

waitUntil{{_x in transporthelo} count units group _unit == 0};

Sleep 3;

_BHWP2 = _bhGroup addWaypoint [_end, 0];

_BHWP2 setwaypointtype "MOVE";

_BHWP2 setwaypointstatements ["True", ""];

*/

I know I've jumped on the boat a little late here, but I want to get a little experienced with A2 Code so I can possible start producing some Weapons and other mods into ArmA.

Edited by wawa

Share this post


Link to post
Share on other sites

could be a workaround by not using scripts. for your situation I'd use 2 helicopters or alternatively, you could make the helicopter do an insertion then land somewhere else and hold 'engineoff' with radio triggers, then place more waypoints after for extraction.

Share this post


Link to post
Share on other sites

unitName could be misleading in case that you looked the command "vehicle" up in BIKI - it doesn't mean the string representation of the unit, but the reference to it.

In you're case you don't even need to use vehicle because you already have a variable with a reference to your blackhawk: BH01.

The name you assign your vehicles in the editor are actually global variables pointing to that vehicle (you even used that variable upon calling extract.sqf as a parameter).

//Object = _this select 0; <-- ???
_start = getMarkerPos "BHWP1"; // Find the Marker, can be used for extraction\insertion
_end = getMarkerPos "BHWP2"; // location of drop off.
BH01 setBehaviour "CARELESS";
BH01 addWaypoint [_end, 0];
BH01 setwaypointtype "TR Unload";

This piece of code should instruct your blackhawk to fly to the marker BHWP2 and unload every passenger not in the same group as the pilot/copilot.

What you tried to do was assigning a new waypoint to a string :D

_BHWP1/2 are just strings, and you can't assign anything to strings.

Share this post


Link to post
Share on other sites
could be a workaround by not using scripts. for your situation I'd use 2 helicopters or alternatively, you could make the helicopter do an insertion then land somewhere else and hold 'engineoff' with radio triggers, then place more waypoints after for extraction.

Yeah, I thought of this actually... it would work fine in a mission. I just figured the the idea of using Marker labels as waypoints could be a little more powerful... but I am still not getting the code right. Though, I was assuming the names\labels for the objects in the game were callable in the SQF. I think I had it all wrong xD

But still, I am looking for some reference to this... it would take days of trial and error if not.

---------- Post added at 19:10 ---------- Previous post was at 19:08 ----------

unitName could be misleading in case that you looked the command "vehicle" up in BIKI - it doesn't mean the string representation of the unit, but the reference to it.

In you're case you don't even need to use vehicle because you already have a variable with a reference to your blackhawk: BH01.

The name you assign your vehicles in the editor are actually global variables pointing to that vehicle (you even used that variable upon calling extract.sqf as a parameter).

//Object = _this select 0; <-- ???
_start = getMarkerPos "BHWP1"; // Find the Marker, can be used for extraction\insertion
_end = getMarkerPos "BHWP2"; // location of drop off.
BH01 setBehaviour "CARELESS";
BH01 addWaypoint [_end, 0];
BH01 setwaypointtype "TR Unload";

This piece of code should instruct your blackhawk to fly to the marker BHWP2 and unload every passenger not in the same group as the pilot/copilot.

What you tried to do was assigning a new waypoint to a string :D

_BHWP1/2 are just strings, and you can't assign anything to strings.

Thankyou for giving me some code :)

I have a Tutorial on ArmA SQF Script atm, but I am still using bad parameters and that takes basic index knowledge. It will come with experience!

Share this post


Link to post
Share on other sites

Ah yes, I used some of it as reference before... but then I thought to myself about just using an existing chopper with a name. Useful code though, it is basically what I am doing!

Share this post


Link to post
Share on other sites
Sign in to follow this  

×