Arma 3
Stahe 25 ENE 2019 a las 13:58
Possible to attach trigger to plane?
So I have a script code to refuel/rearm/repair aircraft. Is it possible to create that trigger, and attach it to an aircraft (that way the plane can refuel/rearm/repair aircraft flying near it)? I tried the attachto code, but the trigger stayed still while the plane took off. There's a high chance I did it wrong, since I'm not skilled in scripting.

Here's the code for the refuel/repair/rearm:

private ["_veh","_vehType"];
_veh = _this select 0;
_vehType = getText(configFile>>"CfgVehicles">>typeOf _veh>>"DisplayName");

if ((_veh isKindOf "plane") && (driver _veh == player)) exitWith {

_veh sidechat format ["Servicing %1.", _vehType];
sleep .125;

_veh setVehicleAmmo 1;
_veh sidechat format ["%1 Rearmed.", _vehType];
sleep .125;

_veh setDamage 0;
_veh sidechat format ["%1 Repaired.", _vehType];
sleep .125;

_veh setFuel .025;
sleep .125;
_veh setFuel .05;
sleep .125;
_veh setFuel .075;
sleep .125;
_veh setFuel .10;
sleep .125;
_veh setFuel .125;
sleep .125;
_veh setFuel .15;
sleep .125;
_veh setFuel .175;
sleep .125;
_veh setFuel .20;
sleep .125;
_veh setFuel .225;
sleep .125;
_veh setFuel .25;
sleep .125;
_veh setFuel .275;
sleep .125;
_veh setFuel .3;
sleep .125;
_veh setFuel .325;
sleep .125;
_veh setFuel .35;
sleep .125;
_veh setFuel .375;
sleep .125;
_veh setFuel .40;
sleep .125;
_veh setFuel .425;
sleep .125;
_veh setFuel .45;
sleep .125;
_veh setFuel .475;
sleep .125;
_veh setFuel .50;
sleep .125;
_veh setFuel .525;
sleep .125;
_veh setFuel .55;
sleep .125;
_veh setFuel .575;
sleep .125;
_veh setFuel .60;
sleep .125;
_veh setFuel .625;
sleep .125;
_veh setFuel .650;
sleep .125;
_veh setFuel .675;
sleep .125;
_veh setFuel .70;
sleep .125;
_veh setFuel .725;
sleep .125;
_veh setFuel .750;
sleep .125;
_veh setFuel .775;
sleep .125;
_veh setFuel .80;
sleep .125;
_veh setFuel .825;
sleep .125;
_veh setFuel .850;
sleep .125;
_veh setFuel .875;
sleep .125;
_veh setFuel .90;
sleep .125;
_veh setFuel .925;
sleep .125;
_veh setFuel .950;
sleep .125;
_veh setFuel .975;
sleep .125;
_veh setFuel 1;
sleep .125;

_veh sidechat format ["%1 Refueled.", _vehType];
sleep .125;


_veh sidechat format ["Service Complete", _vehType];
};
Última edición por Stahe; 25 ENE 2019 a las 14:04
< >
Mostrando 1-4 de 4 comentarios
Dada 25 ENE 2019 a las 19:14 
Did you try to test your trigger with a hint ?
Dada 25 ENE 2019 a las 19:20 
i already use attachTo for a trigger its working, make sure to init in the init field of the refuelling plane and give a variable name to the plane for exemple "plane" and a for the trigger for exemple "airfuel"

put that in the init field of the support plane it should work
airfuel attachTo [plane,[0,0,0]]
Northy 26 ENE 2019 a las 8:44 
Try:

Call the trigger 'airfuel'
Call the C130 'plane'

airfuel triggerAttachVehicle [plane];
Henderson 26 ENE 2019 a las 8:55 
Use Radio Alpha or Bravo if it doesn't work out.
< >
Mostrando 1-4 de 4 comentarios
Por página: 1530 50

Publicado el: 25 ENE 2019 a las 13:58
Mensajes: 4