Jump to content
Luckyas

How to check if carrier launch started?

Recommended Posts

Hello everyone.

I am making a mission with the new carrier ship, and I want to use those cool new animation. I know that by binding allot of "moves" with "playmove" I can make the AI carrier crew do the desired launch animations. But now comes my problem. I need to know the timing when the ai should start doing to animations. I want the animations to start when the player is initiating the "launch action". Is there a way to check this, so the ai will start their animations?

 

Help will be much appriciated!

Thanks

Share this post


Link to post
Share on other sites

I'm not quite sure there is any way to necessary check if a plane has launched via the carrier as if it's a boolean.

bump. 

Share this post


Link to post
Share on other sites

For now im just using a triggerzone. But this is not consistant as some people take off later, or earlier...

Share this post


Link to post
Share on other sites
31 minutes ago, Luckyas said:

For now im just using a triggerzone. But this is not consistant as some people take off later, or earlier...

you're likely to get very unreliable results with that.

Especially since if you trigger the trigger once but you're not launching it may provide a false positive. 

Share this post


Link to post
Share on other sites
1 minute ago, Midnighters said:

you're likely to get very unreliable results with that.

Especially since if you trigger the trigger once but you're not launching it may provide a false positive. 

Iknow. But for know I dont see any other ways to do it.

Share this post


Link to post
Share on other sites

Use the functions viewer and set it to configfile, A3_Jets, All. Theres lots of information in the functions for you to get the bits you need.

 

In no particular order here is an information dump from 5 minutes of reading the catapult functions.

//Interesting lines in the catapult functions
_cfgSettings = missionConfigFile >> "CfgCarrier" >> "LaunchSettings";
_duration = getNumber(_cfgSettings >> "duration") max 6;
_distance = getNumber(_cfgSettings >> "distance"); if (_distance == 0) then {_distance = 15} else {_distance = _distance max 0.1 min 15};
_condShow = getText(_cfgSettings >> "condShow"); if (_condShow == "") then {_condShow = "true"};
_condProgress = getText(_cfgSettings >> "condProgres"); if (_condProgress == "") then {_condProgress = "true"};
_codeStart = getText(missionConfigFile >> "CfgCarrier" >> "LaunchSettings" >> "codeStart");
_codeEnd = getText(missionConfigFile >> "CfgCarrier" >> "LaunchSettings" >> "codeEnd");


//description.ext based off of above available options
class CfgCarrier
{
	class LaunchSettings
	{
		duration = 6; //holdAction duration max 6 seconds
		distance = 15; //length of catapult, min 0.1, max 15
		condShow = "true"; //Used in holdAction conditionShow passed as param 0 of call to [ { _condShow }, _distance ] bis_fnc_carrier01CatapultID
		condProgress = "true"; //Used in holdAction conditionShow passed as param 0 of call to [ { _condProgress }, _distance ] bis_fnc_carrier01CatapultID
		codeStart = ""; //code called on holdaction init, _this holds standard holdAction params for Start
		codeEnd = ""; //code called on holdaction complete, _this holds standard holdAction params for Completion
	};
};


//Variables available
player setVariable ["addDebug",true]; //Will hint catapult debug info

_carrierTrigger = player getVariable "bis_carrierDeckTrigger";
_catapultData = _carrierTrigger getVariable "bis_carrierCatapultsData";
//Data is used to animate deflectors
_catapultData params[
	["_part", objNull],
	["_memPoint", ""],
	["_dirOffset", 0],
	["_animations", 0],
	["_actionName", "" ]
];
//[_part,_animations,10] call BIS_fnc_Carrier01AnimateDeflectors; //Animate UP
//[_part,_animations,0] call BIS_fnc_Carrier01AnimateDeflectors; //Animate DOWN

_catapultState = player getVariable "carrierCatapultState";
//State
//-1	action aborted/not yet started
//0		action started
//1-24	action in progress
//25	action complete

_catapultAttached = player getVariable "carrierCatapultAttached";
_planeWithAction = _carrierTrigger getVariable "bis_carrierCatapultPlane";
_actionID = _planeWithAction getVariable "bis_carrierCatapultActionID";
_wingFoldAnimationsList = _planeWithAction getVariable ["bis_wingFoldAnimations",[]]
_wingStateUnFolded = _planeWithAction getVariable ["bis_wingStateUnFolded",-1]

_carrierParts = _carrierObject getVariable "bis_carrierParts";
or
_carrierParts = _carrierTrigger getVariable "bis_carrierParts";
//Where each part is actual spawned object of classname shown below and memPoint on base carrier object where part is positioned
//_carrierParts = [
//	[ "Land_Carrier_01_hull_01_F","pos_Hull1" ],
//	[ "Land_Carrier_01_hull_02_F","pos_Hull2" ],
//	[ "Land_Carrier_01_hull_03_F","pos_Hull3" ],
//	[ "Land_Carrier_01_hull_04_F","pos_Hull4" ],
//	[ "Land_Carrier_01_hull_05_F","pos_Hull5" ],
//	[ "Land_Carrier_01_hull_06_F","pos_Hull6" ],
//	[ "Land_Carrier_01_hull_07_F","pos_Hull7" ],
//	[ "Land_Carrier_01_hull_08_F","pos_Hull8" ],
//	[ "Land_Carrier_01_hull_09_F","pos_Hull9" ],
//	[ "Land_Carrier_01_island_01_F","pos_Island1" ],
//	[ "Land_Carrier_01_island_02_F","pos_Island1" ],
//	[ "DynamicAirport_01_F","pos_Airport" ]
//];

//Carrier Wire position
_carrierHullWithWire = ( _carrierParts select{ typeOf _x == "Land_Carrier_01_hull_08_F" } ) select 0;
_carrierWirePosition = _carrierHullWithWire modelToWorld (_carrierHullWithWire selectionPosition "pos_Cable_1");

Shame they didnt seem to include any scriptedEventHandlers for this stuff. Although Start and End action are available through description.ext so you can add your own.

  • Like 3

Share this post


Link to post
Share on other sites

I did some search for you. Carrier is an object. So, after a look into the configfile cfgclasses, I found some animations with deflectors.

The bad thing is they are in some hull classes, not in the ship class itself.

Never mind! You can wait for this following condition:

 

!(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] isEqualTo []) &&  {(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] select 0) animationPhase "Deflector_1_hydraulic_1" > 0}

 

where deflector_1 is the deflector of the cat nbr1 (starboard side external) . Hull_04 is for cats 1 and 2, hull_07 for cats 3 and 4.

there are 3 hydraulics anims on each cats. Hydraulic_1 is for the raise.

So, the condition is met each time you start to raise the right deflector (each time you start the launch sequence).

 

Put that in 4 repeatable triggers, whit the right hull and the right deflector, (never mind the area and location of the trigger). Do what you want.

I hope this help.:drinking2:

  • Like 3

Share this post


Link to post
Share on other sites
2 minutes ago, pierremgi said:

I did some search for you. Carrier is an object. So, after a look into the configfile cfgclasses, I found some animations with deflectors.

The bad thing is they are in some hull classes, not in the ship class itself.

Never mind! You can wait for this following condition:

 


!(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] isEqualTo []) &&  {(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] select 0) animationPhase "Deflector_1_hydraulic_1" > 0}

 

where deflector_1 is the defector of the cat nbr1 (starboard side external) . Hull_04 is for cats 1 and 2, hull_07 for cats 3 and 4.

there are 3 hydraulics anims on each cats. Hydraulic_1 is for the raise.

So, the condition is met each time you start to raise the right deflector (each time you start the launch sequence).

 

Put that in 4 repeatable triggers, whit the right hull and the right deflector, (never mind the area and location of the trigger). Do what you want.

I hope this help.:drinking2:

Thats just what I needed. Wil try it out right now!

 

Thanks everyone!

Share this post


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

Thats just what I needed. Wil try it out right now!

 

Thanks everyone!

 

If you are successful would you mind sharing the full setup?  i am attempting something similar for a carrier on a public server map.

Share this post


Link to post
Share on other sites
1 hour ago, Thunder.B said:

 

If you are successful would you mind sharing the full setup?  i am attempting something similar for a carrier on a public server map.

!(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] isEqualTo []) &&  {(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] select 0) animationPhase "Deflector_1_hydraulic_1" > 0}

This is already the "Full setup". Just use this code as your condition and make a activation.

Share this post


Link to post
Share on other sites
19 minutes ago, Luckyas said:

!(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] isEqualTo []) &&  {(nearestObjects [player,["Land_Carrier_01_hull_04_F"],60] select 0) animationPhase "Deflector_1_hydraulic_1" > 0}

This is already the "Full setup". Just use this code as your condition and make a activation.

 

Apologies i also meant if you have the animation references for the AI as well. as i am a few steps behind you. i had to get my anti griefing measures in place before i started placing AI units.

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

×