<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title><![CDATA[Bohemia Interactive Forums - TAKE ON HELICOPTERS : MISSIONS - Editing & Scripting]]></title>
		<link>http://forums.bistudio.com/</link>
		<description />
		<language>en</language>
		<lastBuildDate>Thu, 20 Jun 2013 10:45:53 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forums.bistudio.com/images/misc/rss.png</url>
			<title><![CDATA[Bohemia Interactive Forums - TAKE ON HELICOPTERS : MISSIONS - Editing & Scripting]]></title>
			<link>http://forums.bistudio.com/</link>
		</image>
		<item>
			<title>confused on how to properly  implement failcode in attach slingload function</title>
			<link>http://forums.bistudio.com/showthread.php?157082-confused-on-how-to-properly-implement-failcode-in-attach-slingload-function&amp;goto=newpost</link>
			<pubDate>Tue, 18 Jun 2013 18:08:09 GMT</pubDate>
			<description>I am having difficulty with the BIS attach slingload and detach slingload functions. 
 
I am running a script in which I attach a slingload and drop...</description>
			<content:encoded><![CDATA[<div>I am having difficulty with the BIS attach slingload and detach slingload functions.<br />
<br />
I am running a script in which I attach a slingload and drop it at a repair point. If the slingload rope breaks, I want the script to stop running and the markers, task etc. to be deleted. I can't figure out why it's not working. <br />
<br />
I've tried setting the failcode for attach slingload to be a switch that I can then use to exit the remaining script: <br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; _wreckTask setSimpleTaskDestination (getPosATL _wreck);<br />
&nbsp; &nbsp; &nbsp; &nbsp; hint &quot;Helicopter wreck recovery task assigned&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; _Wp1 = [Player, _slingHelper, 10, 5,{<font color="#0000FF">_slingloadFailed = true;</font>},targetWeight]spawn BIS_fnc_wpSlingLoadAttach;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; waitUntil {scriptDone _Wp1};<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <font color="#0000FF">while {!(scriptdone _wp2)} do<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  If (slingloadFailed) exitWith {hint &quot;You dropped the cargo!&quot;};<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _wreckTask setSimpleTaskDestination (getPosATL repairHelipad);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; _wp2 = [Player, repairHelipad, 20, 5, [0,360]] spawn BIS_fnc_wpSlingLoadDetach;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; waitUntil {scriptDone _wp2};<br />
&nbsp; &nbsp; &nbsp; &nbsp; };</font><br />
<br />
//cleanup<br />
&nbsp; &nbsp; &nbsp; &nbsp; deleteVehicle _slingHelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; deleteMarker wreckMarker;<br />
&nbsp; &nbsp; &nbsp; &nbsp; player removeSimpleTask _wreckTask;<br />
&nbsp; &nbsp; &nbsp; &nbsp; crashSwitchList set [_wreckID, false];<br />
&nbsp; &nbsp; &nbsp; &nbsp; _slingloadFailed = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; _crashSwitch = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; -wreckID = nul;<br />
};</code><hr />
</div>but the helicopter automatically detaches the load as soon as it attaches when I run it. I've also tried deleting all of the script components directly in the failcode, but it ignores them:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">&nbsp; &nbsp; &nbsp; &nbsp; _wreckTask setSimpleTaskDestination (getPosATL _wreck);<br />
&nbsp; &nbsp; &nbsp; &nbsp; hint &quot;Helicopter wreck recovery task assigned&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; _Wp1 = [Player, _slingHelper, 10, 5,{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <font color="#0000FF"> deleteVehicle _slingHelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; deleteMarker wreckMarker;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player removeSimpleTask _wreckTask;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; crashSwitchList set [_wreckID, false];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  _slingloadFailed = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  _crashSwitch = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  -wreckID = nul;</font><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },targetWeight]spawn BIS_fnc_wpSlingLoadAttach;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; waitUntil {scriptDone _Wp1};<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; _wreckTask setSimpleTaskDestination (getPosATL repairHelipad);<br />
&nbsp; &nbsp; &nbsp; &nbsp; _wp2 = [Player, repairHelipad, 20, 5, [0,360]] spawn BIS_fnc_wpSlingLoadDetach;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp;  waitUntil {scriptDone _wp2};<br />
<br />
//cleanup<br />
&nbsp; &nbsp; &nbsp; &nbsp; deleteVehicle _slingHelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; deleteMarker wreckMarker;<br />
&nbsp; &nbsp; &nbsp; &nbsp; player removeSimpleTask _wreckTask;<br />
&nbsp; &nbsp; &nbsp; &nbsp; crashSwitchList set [_wreckID, false];<br />
&nbsp; &nbsp; &nbsp; &nbsp; _slingloadFailed = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; _crashSwitch = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; -wreckID = nul;<br />
};</code><hr />
</div>... and lastly, I tried to use a failcode switch this way, which was also ignored:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"><br />
&nbsp; &nbsp; &nbsp; &nbsp; _wreckTask setSimpleTaskDestination (getPosATL _wreck);<br />
&nbsp; &nbsp; &nbsp; &nbsp; hint &quot;Helicopter wreck recovery task assigned&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; _Wp1 = [Player, _slingHelper, 10, 5,{<font color="#0000FF">_slingloadFailed = true; hint &quot;You dropped the cargo&quot;</font>},targetWeight]spawn BIS_fnc_wpSlingLoadAttach;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; waitUntil {scriptDone _Wp1};<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; _wreckTask setSimpleTaskDestination (getPosATL repairHelipad);<br />
&nbsp; &nbsp; &nbsp; &nbsp; _wp2 = [Player, repairHelipad, 20, 5, [0,360]] spawn BIS_fnc_wpSlingLoadDetach;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <font color="#0000FF">waitUntil {(scriptDone _wp2) || (_slingloadFailed)}</font>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
//cleanup<br />
&nbsp; &nbsp; &nbsp; &nbsp; deleteVehicle _slingHelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; deleteMarker wreckMarker;<br />
&nbsp; &nbsp; &nbsp; &nbsp; player removeSimpleTask _wreckTask;<br />
&nbsp; &nbsp; &nbsp; &nbsp; crashSwitchList set [_wreckID, false];<br />
&nbsp; &nbsp; &nbsp; &nbsp; _slingloadFailed = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; _crashSwitch = nul;<br />
&nbsp; &nbsp; &nbsp; &nbsp; -wreckID = nul;<br />
};</code><hr />
</div>Any ideas why this doesn't work?</div>

]]></content:encoded>
			<category domain="http://forums.bistudio.com/forumdisplay.php?119-TAKE-ON-HELICOPTERS-MISSIONS-Editing-amp-Scripting"><![CDATA[TAKE ON HELICOPTERS : MISSIONS - Editing & Scripting]]></category>
			<dc:creator>nephros</dc:creator>
			<guid isPermaLink="true">http://forums.bistudio.com/showthread.php?157082-confused-on-how-to-properly-implement-failcode-in-attach-slingload-function</guid>
		</item>
		<item>
			<title>Is it possible to slingload another helicopter with BIS fnc wpSlingLoadAttach?</title>
			<link>http://forums.bistudio.com/showthread.php?156398-Is-it-possible-to-slingload-another-helicopter-with-BIS-fnc-wpSlingLoadAttach&amp;goto=newpost</link>
			<pubDate>Sat, 08 Jun 2013 14:52:12 GMT</pubDate>
			<description>I have been  putting together a kind of sandbox on the south asia map, and one of the features I am trying to impement is the ability to recover a...</description>
			<content:encoded><![CDATA[<div>I have been  putting together a kind of sandbox on the south asia map, and one of the features I am trying to impement is the ability to recover a helicopter that has crashed (provided it is small or medium, and therefore within the external weight restriction of the heavy helicopter) and bring it back to a repair point at the sumrakent airport, via slingloading.<br />
<br />
The problem I am running into is that it appears the TOH helicopter models are not allowed as targets for slingload attachment via 'BIS fnc wpSlingLoadAttach' (although the ARMA 2 helicopter models are).<br />
<br />
If I try to create a bucket and attach it to the center of the target helicopter and then slingload the bucket:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">bucket setPosATL [getPosATL targetHelicopter]; <br />
bucket attachTo [targetHelicopter];</code><hr />
</div>the helicopter holds the bucket to the ground and I can't slingload either.<br />
Alternatively, if I attach the target helicopter to the bucket:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">bucket setPosATL [getPosATL targetHelicopter]; <br />
targetHelicopter attachTo [bucket];</code><hr />
</div>The bucket separates from the target helicopter on attachment, leaving the helicopter behind.<br />
<br />
Is there a way to allow the TOH helicopters as targets or do I need to find a different approach?<br />
<br />
==================================================  =============<br />
<br />
SOLVED<br />
<br />
Here is the code that works:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">_slingHelper = &quot;Misc_cargo_cont_net1&quot; createVehicleLocal getPosATL targetHeli; <br />
_slingHelper hideObject true;<br />
<br />
If (targetHeli isKindOf &quot;Heli_Medium01_Base_H&quot;) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; {_slingHelper attachTo [targetHeli, [0,0,-2]];<br />
&nbsp; &nbsp; &nbsp; &nbsp; sleep 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; detach _slinghelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; targetheli attachTo [_slingHelper,[0,0,2]]} <br />
&nbsp; &nbsp; &nbsp; &nbsp; else <br />
&nbsp; &nbsp; &nbsp; &nbsp; {_slingHelper attachTo [targetHeli, [0,0,-1.5]];<br />
&nbsp; &nbsp; &nbsp; &nbsp; sleep 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; detach _slinghelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; targetheli attachTo [_slingHelper,[0,0,1.5]]};</code><hr />
</div>Commentary (for other scripting novices like me who are trying to figure this stuff out :p )<br />
-Since I can't directly slingload the TOH helicopter (named targetHeli), I am creating an invisible cargo in net (_slingHelper), attaching the targetHeli to the cargo in net, and then slingloading the cargo in net. I delete the cargo in net at the end, and voila!<br />
-Problems and solutions:<br />
 1) Attaching _slinghelper to targetheli doesn't work: The helicopter stays frozen to the ground when you try to lift _slinghelper. You have to attach TargetHeli to _slinghelper.<br />
2) When you create _slinghelper through code, it will spawn about 5m away from the helicopter. To teleport it 5m over to the helicopter (and not vice versa), you have to attach _slinghelper to targetheli first, then detach it. You have to sleep 1 second or else _slinghelper won't move at all (figured that out by dumb luck).<br />
3) The center of gravity of the cargo in net (_slinghelper) is 1.5m lower than that of the light helicopters, and 2m lower than that of the medium helicopters, so you have to offset it or else your helicopter will either be buried in the ground or floating in the air.<br />
4) If you try to use a smaller item than the cargo in net as your _slinghelper (I tried the ammocrate first), it spins wildly when you add the weight of a helicopter to it. I haven't experimented with this yet, but if you find that the cargo in net is still not stable enough, you could probably use a shipping crate instead for added stability. You'd have to expirement with the center of gravity offset.<br />
5) My code is set up to account for either a light or medium helicopter and ignores all other possibilities. This is because in the mission I am creating I will have already excluded hinds and large helicopters from slingloading due to their weights.<br />
<br />
Also (for other fledgling scripters), here is the full code for my test scenario in which I pick up targetHeli, deposit it at a helipad named hw3, and then land at hw1 (with a few hints thrown in). It shows how I'm doing custom waypoint scripting. A similar script will be triggered in my mission when a player reports his helicopter has crashed, and become an available task until either the task is performed, the helicopter is repaired, or the helicopter is destroyed.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"> //heliWaypointInit.sqf<br />
//player waypoint and task testing<br />
//waypoint format: [player, target, completion radius, &lt;arguments&gt;] spawn &lt;functionName&gt;;<br />
//attachslingload arguments: [posLimit, failCode, weight] spawn BIS_fnc_wpSlingLoadAttach;<br />
//detachslingload arguments: [posLimit, LimitDir] spawn BIS_fnc_wpSlingLoadDetach;<br />
//land arguments: [dirParam, visualize] spawn BIS_fnc_wpLand;<br />
//_slinghelper offset for light: targetheli attachTo [_slingHelper,[0,0,1.5]];<br />
//_slinghelper offset for medium: targetheli attachTo [_slingHelper,[0,0,2]];<br />
<br />
WT_LIGHT = 722;<br />
wT_MEDIUM = 3100;<br />
<br />
//Assign weight to target helicopter based on size<br />
If (targetHeli isKindOf &quot;Heli_Medium01_Base_H&quot;) then {targetWeight = WT_MEDIUM} else <br />
<br />
{targetWeight = WT_LIGHT};<br />
<br />
//task setup<br />
_helitsk1 = player createsimpletask [&quot;pick up container&quot;];&nbsp; <br />
_helitsk1&nbsp; setsimpletaskdescription [&quot;pick up the container and take it to the marker noted&quot;, <br />
<br />
&quot;pick up container&quot;, &quot;&quot;];&nbsp;  <br />
_helitsk1&nbsp; settaskstate &quot;CREATED&quot;; <br />
<br />
waitUntil {taskState _helitsk1 == &quot;ASSIGNED&quot;};<br />
<br />
//we cant attach helicopter directly, so we use slinghelper<br />
_slingHelper = &quot;Misc_cargo_cont_net1&quot; createVehicleLocal getPosATL targetHeli; <br />
_slingHelper hideObject true;<br />
<br />
If (targetHeli isKindOf &quot;Heli_Medium01_Base_H&quot;) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; {_slingHelper attachTo [targetHeli, [0,0,-2]];<br />
&nbsp; &nbsp; &nbsp; &nbsp; sleep 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; detach _slinghelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; targetheli attachTo [_slingHelper,[0,0,2]]} <br />
&nbsp; &nbsp; &nbsp; &nbsp; else <br />
&nbsp; &nbsp; &nbsp; &nbsp; {_slingHelper attachTo [targetHeli, [0,0,-1.5]];<br />
&nbsp; &nbsp; &nbsp; &nbsp; sleep 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; detach _slinghelper;<br />
&nbsp; &nbsp; &nbsp; &nbsp; targetheli attachTo [_slingHelper,[0,0,1.5]]};<br />
<br />
_helitsk1&nbsp; setsimpletaskdestination (getPosATL _slingHelper);&nbsp; <br />
hint &quot;heli task assigned&quot;;<br />
_wp1 = [Player, _slingHelper, 10, 1, {hintC &quot;You dropped the cargo!&quot;},targetWeight] spawn <br />
<br />
BIS_fnc_wpSlingLoadAttach;<br />
<br />
waitUntil {scriptDone _wp1};<br />
<br />
hint &quot;sling load attached&quot;;<br />
_helitsk1 setSimpleTaskDestination (getPosATL hw3);<br />
_wp2 = [Player, hw3, 10, 1, [0,360]] spawn BIS_fnc_wpSlingLoadDetach;<br />
<br />
waituntil {scriptDone _wp2};<br />
<br />
deleteVehicle _slingHelper;<br />
hint &quot;slingload detached&quot;;<br />
_helitsk1 setSimpleTaskDestination (getPosATL hw1);<br />
_wp3 = [player, getPosATL hw1, 10,[],true] spawn BIS_fnc_wpLand;<br />
<br />
waitUntil {scriptDone _wp3};<br />
<br />
_helitsk1 setTaskState &quot;SUCCEEDED&quot;;<br />
hintc &quot;good job, shut down your engine!&quot;;<br />
<br />
//cleanup<br />
player removeSimpleTask _helitsk1;</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forums.bistudio.com/forumdisplay.php?119-TAKE-ON-HELICOPTERS-MISSIONS-Editing-amp-Scripting"><![CDATA[TAKE ON HELICOPTERS : MISSIONS - Editing & Scripting]]></category>
			<dc:creator>nephros</dc:creator>
			<guid isPermaLink="true">http://forums.bistudio.com/showthread.php?156398-Is-it-possible-to-slingload-another-helicopter-with-BIS-fnc-wpSlingLoadAttach</guid>
		</item>
		<item>
			<title>Viewing Ingame Units and Stuff</title>
			<link>http://forums.bistudio.com/showthread.php?155845-Viewing-Ingame-Units-and-Stuff&amp;goto=newpost</link>
			<pubDate>Wed, 29 May 2013 23:52:45 GMT</pubDate>
			<description>i would like to know if there is a viewer available to let me see what each unit looks like without having to extract/export the game data.</description>
			<content:encoded><![CDATA[<div>i would like to know if there is a viewer available to let me see what each unit looks like without having to extract/export the game data.</div>

]]></content:encoded>
			<category domain="http://forums.bistudio.com/forumdisplay.php?119-TAKE-ON-HELICOPTERS-MISSIONS-Editing-amp-Scripting"><![CDATA[TAKE ON HELICOPTERS : MISSIONS - Editing & Scripting]]></category>
			<dc:creator>Korant</dc:creator>
			<guid isPermaLink="true">http://forums.bistudio.com/showthread.php?155845-Viewing-Ingame-Units-and-Stuff</guid>
		</item>
		<item>
			<title>Mission Editor Available Maps</title>
			<link>http://forums.bistudio.com/showthread.php?155763-Mission-Editor-Available-Maps&amp;goto=newpost</link>
			<pubDate>Tue, 28 May 2013 20:51:30 GMT</pubDate>
			<description>the info for ToH - Rearmed states that there are sceneries for Chernarus, Takistan, Utes, and others.  in the mission editor i only see Oil Platform,...</description>
			<content:encoded><![CDATA[<div>the info for ToH - Rearmed states that there are sceneries for Chernarus, Takistan, Utes, and others.  in the mission editor i only see Oil Platform, South Asia, and Seattle.  i have all the ToH DCL stuff from Steam.  where do i find these other maps?</div>

]]></content:encoded>
			<category domain="http://forums.bistudio.com/forumdisplay.php?119-TAKE-ON-HELICOPTERS-MISSIONS-Editing-amp-Scripting"><![CDATA[TAKE ON HELICOPTERS : MISSIONS - Editing & Scripting]]></category>
			<dc:creator>Korant</dc:creator>
			<guid isPermaLink="true">http://forums.bistudio.com/showthread.php?155763-Mission-Editor-Available-Maps</guid>
		</item>
	</channel>
</rss>
