nuxil
Member-
Content Count
1606 -
Joined
-
Last visited
-
Medals
Everything posted by nuxil
-
what behaviour do you have on your units? form the wiki unitname action ["WEAPONINHAND"] unitname action ["WEAPONONBACK"] Soldier 'unitname' takes weapon from/to back. Change is persistent with player, but AI units will switch back if their behaviour mode is incompatible (SAFE or CARELESS with WEAPONINHAND, and STEALTH, COMBAT & AWARE with WEAPONONBACK). so if the behaviour is incompatible then offource it wount work
-
Well you can try with the currect script im working on.. my AA script which i seems to never get finished anyway thers the dia.hpp this file must be included in description.ext like: #include dia.hpp <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #define ST_LEFT 0 #define ST_RIGHT 1 #define ST_CENTER 2 #define CT_STATIC 0 #define ST_PICTURE 48 #define FontM "Zeppelin32" #define FontHTML "Zeppelin32" #define Size_Text_Small 0.025 #define CT_ACTIVETEXT 11 #define CT_BUTTON 1 #define ST_FRAME 64 #define CT_EDIT 2 #define CT_COMBO 4 #define CT_LISTBOX 5 #define CT_SLIDER 3 #define ST_HPOS 0x0F class RscText { type = CT_STATIC; idc = -1; style = ST_LEFT; colorBackground[] = {0, 0, 0, 0}; colorText[] = {1, 1, 1, 1}; font = FontM; sizeEx = 0.04; }; class RscPicture { type = CT_STATIC; idc = -1; style = ST_PICTURE; colorBackground[] = {0, 0, 0, 0}; colorText[] = {1, 1, 1, 1}; font = FontM; sizeEx = 0.04; }; class RscActiveText { type = CT_ACTIVETEXT; idc = -1; style = ST_LEFT; color[] = {1, 1, 1, 1}; colorActive[] = {1, 0, 0, 1}; font = FontM; sizeEx = 0.04; soundEnter[] = {"ui\ui_over", 0.2, 1}; soundPush[] = {, 0.2, 1}; soundClick[] = {"ui\ui_ok", 0.2, 1}; soundEscape[] = {"ui\ui_cc", 0.2, 1}; default = false; }; class RscButton { type = CT_BUTTON; idc = -1; style = ST_CENTER; colorText[] = {1, 1, 1, 1}; colorDisabled[] = {1, 1, 1, 0.7}; colorBackground[] = {0.2, 0.4, 1, 0.8}; colorBackgroundActive[] = {0.2, 0.4, 1, 1}; colorBackgroundDisabled[] = {0.2, 0.4, 1, 0.6}; colorFocused[] = {1, 1, 1, 0.4}; colorShadow[] = {0, 1, 0, 0}; colorBorder[] = {0, 1, 0, 0}; font = FontM; soundEnter[] = {"\ca\ui\data\sound\mouse2", 0.15, 1}; soundPush[] = {"\ca\ui\data\sound\new1", 0.15, 1}; soundClick[] = {"\ca\ui\data\sound\mouse3", 0.15, 1}; soundEscape[] = {"\ca\ui\data\sound\mouse1", 0.15, 1}; sizeEx = 0.02; offsetX=0; offsetY=0; offsetPressedX=0; offsetPressedY=0; borderSize=0; default = false; }; class RscFrame { type = CT_STATIC; idc = -1; style = ST_FRAME; colorBackground[] = {0, 0, 0, 0}; colorText[] = {1, 1, 1, 1}; font = FontM; sizeEx = 0.04; }; class RscEdit { type = CT_EDIT; idc = -1; style = ST_LEFT; font = FontHTML; sizeEx = 0.02; colorText[] = {0, 0, 0, 1}; colorSelection[] = {0.5, 0.5, 0.5, 1}; autocomplete = false; text =; }; class RscLB_C { style = ST_LEFT; idc = -1; colorSelect[] = {0.4, 0.4, 0.4, 1}; colorSelectBackground[] = {0.2, 0.2, 0.2, 1}; colorText[] = {0.2, 0.2, 0.2, 1}; colorBackground[] = {0.4, 0.4, 0.4, 1}; font = FontHTML; sizeEx = 0.025; rowHeight = 0.04; }; class RscListBox: RscLB_C { type = CT_LISTBOX; }; class RscCombo: RscLB_C { type = CT_COMBO; wholeHeight = 0.3; }; class RscSliderH { type = CT_SLIDER; style = ST_HPOS; color[] = {0.2, 0.2, 0.2, 1}; idc = -1; sizeEx = 0.025; }; class DIALOG1 { idd = -1; movingEnable = true; controlsBackground[] = {DLG_BACK1, FRAME1}; objects[] = { }; controls[] = {FIRE, ABORT, TEXT_DIST, TEXT_SPEED, TEXT_HIGHT, TEXT_LAUNCHDIR, TEXT_DIRE,TEXT_LOCKON,PIC_VIEWER}; class DLG_BACK1: RscText { colorBackground[] = {0.4, 0.4, 0.4, 1}; text =; x = 0; y = 0.00198; w = 0.16; h = 0.6; }; class FRAME1 : RscText { x = 0; y = 0.00198; idc = -1; w = 0.158; h = 0.6; style = ST_FRAME; colorText[] = {0, 0, 0, 1}; colorBackground[] = {0.4, 0.4, 0.4, 0,9}; SizeEX = 0.025; text = "Status"; }; class FIRE : RscButton { x = 0.00625; y = 0.53755; idc = -1; w = 0.07; h = 0.04; style = ST_LEFT; colorText[] = {0, 0, 0, 1}; font = FontM; SizeEX = 0.025; text = "Fire"; action = ""; default = false; }; class ABORT : RscButton { x = 0.085; y = 0.53834; idc = -1; w = 0.07; h = 0.04; style = ST_CENTER; colorText[] = {0, 0, 0, 1}; font = FontM; SizeEX = 0.025; text = "Abort"; action = "DIA=0; LOCKON = 0; closeDialog 0"; default = false; }; class TEXT_DIST : RscText { x = 0.005; y = 0.07115; idc = 100; w = 0.15; h = 0.02; style = ST_LEFT; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; font = FontM; SizeEX = 0.02; text = ""; }; class TEXT_SPEED : RscText { x = 0.005; y = 0.11067; idc = 101; w = 0.15; h = 0.02; style = ST_LEFT; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; font = FontM; SizeEX = 0.02; text = ""; }; class TEXT_HIGHT : RscText { x = 0.005; y = 0.1502; idc = 102; w = 0.15; h = 0.02; style = ST_LEFT; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; font = FontM; SizeEX = 0.02; text = ""; }; class TEXT_LAUNCHDIR : RscText { x = 0.005; y = 0.22925; idc = 103; w = 0.15; h = 0.02; style = ST_LEFT; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; font = FontM; SizeEX = 0.02; text = ""; }; class TEXT_DIRE : RscText { x = 0.005; y = 0.18972; idc = 104; w = 0.15; h = 0.02; style = ST_LEFT; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; font = FontM; SizeEX = 0.02; text = ""; }; class TEXT_LOCKON : RscText { x = 0.005; y = 0.03162; idc = 105; w = 0.15; h = 0.02; style = ST_LEFT; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; font = FontM; SizeEX = 0.02; text = ""; }; class PIC_VIEWER : RscPicture { x = 0.005; y = 0.27273; idc = 106; w = 0.15; h = 0.25; style = ST_PICTURE; colorText[] = {1, 1, 1, 1}; colorBackground[] = {0, 0, 0, 0}; size = 1; sizeEx = 1; text = ""; }; }; main script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _Me = _this select 0; //Little marker circle.. createMarker ["AAsl", [-1000,-1000]]; "AAsl" setMarkerBrush "DiagGrid"; "AAsl" setMarkerColor "ColorRedAlpha"; "AAsl" setMarkerShape "ELLIPSE"; "AAsl" setMarkerSize [175, 175]; //set addon to false.. KEGsClientAddonPresent = false; DIA=0; TLIST = []; CHECKE = []; LOCKON = 0; INFO = []; publicvariable "TLIST"; publicvariable "CHECKE"; publicvariable "LUNIT"; publicvariable "PAD"; publicvariable "LOCKON"; publicvariable "INFO"; publicvariable "DIA"; //finddisplay(46) displayseteventhandler ["Keydown","if ((_this select 1) == 16) then {Qon = true}"]; //finddisplay(46) displayseteventhandler ["KeyUp","if ((_this select 1) == 16) then {Qon = false}"]; // start the trigger.. so we can get an list of units. nil=[_Me] execvm "scripts\triggerarea.sqf"; sleep 3; CHECKE = TLIST; //lets check if the spectating client addon is installed on your system.. //we want to accsess the Marker classes. _foo = "KEGsAddon10" createVehicleLocal[-1000,-1000,0]; if(!isNull _foo) then { deletevehicle _foo; KEGsClientAddonPresent = true; }; // i got some problems with this.. :\ _a=0; // going to use as a exit variable when the AA dies later on.. while {(_a < 1)} do { _nrm = count TLIST; _nrc = count CHECKE; "AAsl" setMarkerPos [-1000,-1000]; onMapSingleClick "PAD =+ _pos"; if (PAD select 0 > 0) then { _px=pad select 0; _py=pad select 1; _only = nearestObjects [[_px,_py,250],["Air"], 550]; _now = _only select 0; if (!isNull _now) then { LOCKON=1; LUNIT=_now; _now=[]; }; "AAsl" setMarkerPos [_px,_py]; PAD=[0,0,0]; }; // if new units go in to aircrafts. just add them,, if (_nrm > _nrc) then { CHECKE = TLIST;}; // if some units died.. if ((_nrm < _nrc) || (_nrm == 0)) then { _Dunit=[]; _index=0; for [{_i=0},{_i < _nrc},{_i=_i+1}] do { _unit = checkE select _i; if (!alive _unit) then { _Dunit set [_index, _unit]; _index = _index +1; _Dunit resize _index; _Ename = format["%1", _unit]; }; }; {_Ename = format["%1", _x]; deletemarker _Ename;} foreach _Dunit; CHECKE = TLIST; }; // actual ploting if ((_nrm == _nrc) && (_nrm != 0)) then { nil=[] execvm "scripts\maplot.sqf"; if ((LOCKON == 1))then { nil=[] execvm "scripts\lockon.sqf"; nil=[_Me] execvm "scripts\infoaire.sqf"; if (DIA == 0) then { DIA=1; _dia = createDialog "DIALOG1"; }; //if (Qon) then { // nil=[_Me] execvm "scripts\fire.sqf"; //}; }; }; //closeDialog 0; sleep 0.1; }; triggerarea script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _Me = (_this select 0); while {true} do { _myarray=[]; WestTriggerOne = createTrigger ["EmptyDetector", position _Me]; WestTriggerOne setTriggerActivation ["EAST", "PRESENT", true]; WestTriggerOne setTriggerType "NONE"; WestTriggerOne setTriggerArea [50000, 50000, 0, false ]; //update the publicalvariable each sec sleep 1; _whohere = list WestTriggerOne; _nr = {alive _x} count (_whohere); _index=0; for [{_a=0},{_a < _nr },{_a=_a+1}] do { _unit = _whohere select _a; if ((_unit isKindOf "AIR")) then { _myarray set [_index, _unit]; _index = _index +1; _myarray resize _index; }; }; TLIST =+ _myarray; }; lockon script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _lockon = LUNIT; _nr=round LOCKON; while {(_nr == 1)} do { createMarker ["lockon", (position _lockon)]; "lockon" setMarkerBrush "DiagGrid"; "lockon" setMarkerColor "ColorBlue"; "lockon" setMarkerShape "ELLIPSE"; "lockon" setMarkerSize [175, 175]; "lockon" setMarkerPos (position _lockon); sleep 0.1; _nr=round LOCKON; }; ; //"lockon" setMarkerPos [-1000,-1000]; deleteMarker "lockon"; maplot script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> { _unit = _x; _Ename = format["%1", _x]; createMarker [_Ename, (position _x)]; _type = getText(configFile >> "CfgVehicles" >> format["%1", typeOf (vehicle _unit)] >> "simulation"); _icon = "Arrow"; switch(_type) do { case "airplane": {_icon = "KEGsPlane"}; case "helicopter": {_icon = "KEGsHelicopter"}; }; _Ename setMarkerTypeLocal _icon; _Ename setMarkerSize [0.5,0.5]; _Ename setMarkerDir (getdir _x); _Ename setMarkerText (format["%1",(typeOf _x)]); _Ename setMarkerPos (position _x); } foreach CHECKE; info script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _Me = _this select 0; _li = LUNIT; _name = name _li; _nr=round LOCKON; while {(_nr == 1)} do { // "n e s w" hight so on.. _Epos = getpos _li; _tx = _Epos select 0; _ty = _Epos select 1; _tz = _Epos select 2; _Apos = getpos _Me; _mx = _Apos select 0; _my = _Apos select 1; _mz = _Aos select 2; // Trigometri _hypotenus = [_mx,_my,0] distance [_tx,_ty,0]; _htt=0; // position of the target, and calculate the heading to it. divide into 4 sectors. if ((_mx < _tx) && (_my < _ty)) then { _hoskatet = [_mx,_my,0] distance [_tx,_my,0]; _motkatet = [_tx,_my,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _htt = 90 - _reelvink; }; if ((_mx < _tx) && (_my > _ty)) then { _hoskatet = [_mx,_my,0] distance [_tx,_my,0]; _motkatet = [_tx,_my,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _vx = 90 + _reelvink; _htt = _vx; }; if ((_mx > _tx) && (_my > _ty)) then { _hoskatet = [_mx,_my,0] distance [_mx,_ty,0]; _motkatet = [_mx,_ty,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _htt = 180 + _reelvink; }; if ((_mx > _tx) && (_my < _ty)) then { _hoskatet = [_mx,_my,0] distance [_tx,_my,0]; _motkatet = [_tx,_my,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _htt = 270 + _reelvink; }; _distance = format["Distance:%1",round (_li distance _Me)]; _speed = format["Speed:%1",round (speed _li)]; _hight = format["Hight:%1",round (getpos _li select 2)]; _dire = format["Heading:%1",round (getdir _li)]; _launchdir=format["Launch Dir:%1",round (_htt)]; _lockon = format["%1", _name]; ctrlSetText [100, _distance]; ctrlSetText [101, _speed]; ctrlSetText [102, _hight]; ctrlSetText [103, _dire]; ctrlSetText [104, _launchdir]; ctrlSetText [105, _lockon]; _type = typeOf vehicle _li; _pic=""; switch(_type) do { case "KA50": {_pic = format["pics\ka.paa"]}; case "Su34": {_pic = format["pics\su34.paa"]}; case "Su34B": {_pic = format["pics\su34.paa"]}; case "Mi17_MG": {_pic = format["pics\mi.paa"]}; case "Mi17": {_pic = format["pics\mi.paa"]}; }; ctrlSetText [106, _pic]; _nr=round LOCKON; sleep 0.1; }; LUNIT=[]; INFO=[]; the script is a bit buggy as its not 100% finished,, sorry i cant send you my paa files since i dont have yet fixed myself a place to uploade files. but in the infoaire.sqf script you'll see how i set the pictures when i click on diffrent airtyped on the map..
-
bind a key to enter vehicle
nuxil replied to colligpip's topic in ARMA - MISSION EDITING & SCRIPTING
yes ther is.. but you need to check the nearestobject and the type of it.. and if there are several vehicles close to eachother you might get in the wrong car. also you need to check if the is a driver already in that car. read this post -
bind a key to enter vehicle
nuxil replied to colligpip's topic in ARMA - MISSION EDITING & SCRIPTING
How about when you walk close to the vehicle you press enter -
hmm i have tryed and tryed and tryed,, i cant get other pictures beside paa file to show up in my dialogs.. but i finaly figurd out how to make thouse paa files
-
Hide radio until needed?
nuxil replied to -=FW=-Platty's topic in ARMA - MISSION EDITING & SCRIPTING
take a look at this http://community.bistudio.com/wiki/setRadioMsg -
i have been messing around a bit.. and i found out that, somehow it will only show paa files.. i tested with unpobing one of the bezerk missions and tryed with ther logo.. which is a paa file.. and it worked. i tryed with jpg/bmp/gif and png file format.. i also tryed with diffrent size of the images.. 128x128 | 256x256 so on.. but no luck.. so i guess i just have to buy photoshop and use the paa plugin to it.. :\
-
i have had simelar issue with the lockon.. my problem was that the Ai was turning on/off the engine all the time,, when they moved just a few meters.. try to force the engine on all the vehicles. and see if that helps.
-
Hi all.. im still working on my AA script trying to improve it everyday.. i found it a nice way to learn this scripting language.. The script plots helis and planes on the map. and when clicking close to the marker. the AA veheicle is suppose to shoot at the aircraft.. dosent work if the unit is flying verry fast.. i think its Besauce i use nearestObjects and it seems to be slow as ....! however, i gotten stuck with some issues here.. 1st.. how can i use the ingame icons.. "heli plain" you see in cadet mode. * i have installed the spectaing client script.. so can i use thouse classes ? _icon = "KEGsPlane" ; MarkerX setMarkerTypeLocal _icon? if so how.. besauce i tryed it and cant get that to work.. 2nd.. how can i exit a camera proberly.. in my fire.sqf script. i follow the missile by camera.. as long as the enemy units dies the camera exits fine. But if the missile hits a mountan or something else.. it dosent exit. Here are the code so far.. i use it in 3 scripts. main script <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _Me = _this select 0; myarray=[]; checkE=[]; publicvariable "myarray"; publicvariable "checkE"; publicvariable "pad"; _Dunit=[]; nil=[_Me] execvm "scripts\triggerarea.sqf"; sleep 3; checkE = myarray; _a=0; // going to use as a exit variable when the AA dies later on.. while {(_a < 1)} do { _nrm = count myarray; _nrc = count checkE; // get the pos from the map onMapSingleClick "pad =+ _pos"; if (pad select 0 > 0) then { _px=pad select 0; _py=pad select 1; // This is real SLOW.. need a fixup _only = nearestObjects [[_px,_py,100],["Air"], 200]; _now = _only select 0; nil=[_now,_Me] execvm "scripts\fire.sqf"; pad=[0,0,0]; }; sleep 0.5; if (_nrm > _nrc) then { checkE = myarray;}; if ((_nrm < _nrc) || (_nrm == 0)) then { _index=0; for [{_i=0},{_i < _nrc},{_i=_i+1}] do { _unit = checkE select _i; if (!alive _unit) then { _Dunit set [_index, _unit]; _index = _index +1; _Dunit resize _index; _Ename = format["%1", _unit]; }; }; {_Ename = format["%1", _x]; deletemarker _Ename;} foreach _Dunit; checkE = myarray; }; if ((_nrm == _nrc) && (_nrm != 0)) then { { _unit = _x; _Ename = format["%1", _x]; createMarker [_Ename, (position _x)]; //_Ename setMarkerTypeLocal _icon; _Ename setMarkerType "Dot"; _Ename setMarkerDir (getdir _x); _Ename setMarkerText (format["%1 sp:%2",(typeOf _x),(round speed _x)]); _Ename setMarkerPos (position _x); } foreach checkE; }; sleep 0.3; }; triggerarea.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _Me = (_this select 0); while {true} do { _myarray=[]; WestTriggerOne = createTrigger ["EmptyDetector", position _Me]; WestTriggerOne setTriggerActivation ["EAST", "PRESENT", true]; WestTriggerOne setTriggerType "NONE"; WestTriggerOne setTriggerArea [50000, 50000, 0, false ]; //update the publicalvariable each sec sleep 1; _whohere = list WestTriggerOne; _nr = {alive _x} count (_whohere); _index=0; for [{_a=0},{_a < _nr },{_a=_a+1}] do { _unit = _whohere select _a; if ((_unit isKindOf "AIR")) then { _myarray set [_index, _unit]; _index = _index +1; _myarray resize _index; }; }; myarray = +_myarray; }; fire.sqf <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _unit = _this select 0; _AAvehicle = _this select 1; _Ename = name _unit; _missil = "M_Ch29_AT" createVehicle [0,0,0]; _missil setpos [(getpos _AAvehicle select 0),(getpos _AAvehicle select 1),(getpos _AAvehicle select 2)+ 3.5]; sleep 0.1; _camera = "camera" camcreate (position _missil); while {(getdammage _unit < 0.9) && (getdammage _missil < 1)} do { _vel = velocity _missil; _dir = direction _missil; _speed = 20; _missil setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2)]; _Pm = getpos _missil; _Pu = getpos _unit; _Pmu = [((_Pu select 0) - (_Pm select 0)), ((_Pu select 1) - (_Pm select 1)),((_Pu select 2) - (_Pm select 2))]; _missil setVectorUp _Pmu; _missil setVectorDir _Pmu; if ((_unit distance _missil) <= 14) then { _missil setpos [(getpos _unit select 0),(getpos _unit select 1),((getpos _unit select 2)+1.6)]; }; camUseNVG set; _camera cameraeffect ["internal", "FRONT"]; _camera camsettarget _missil; _camera camPrepareFOV 1.100; _camera camsetrelpos [0,-10,5]; _camera camcommit 0; sleep 0.01; }; //end the while _camera cameraEffect ["Terminate", "FRONT"]; camDestroy _camera; im no expert with this camera thingy so i could use some help. now before you start arguing about using publicvariables as array.. try this test http://pastebin.ca/412031 if you wish to test this script. place a stryker on the map.. and in its init feald put. nil= [this] execvm "main.sqf" script lacks functions and is verry unfinished.
-
Need a helping hand with my AA script.
nuxil replied to nuxil's topic in ARMA - MISSION EDITING & SCRIPTING
yea.. while {(getdammage _unit < 0.9) && (getdammage _missil < 1) && (alive _unit) && (alive _missil)} do worked fine. now the camera exits. i also managed to get the icons thats in the spectating cilent addon to work on the map -
oh and use getdammage instead of dammage
-
this is wrong : if ((dammage UH1)<0.5) then (UH1 SideChat "Say this Text") with then you use {} like: if ((dammage UH1)<0.5) then {UH1 SideChat "Say this Text"};
-
Howdy all.. I made a simple script that checks for spesific units in a trigger area. and then plot ther position on the map with a marker "Dot" I see the unit icon way off line to the "Dot" marker. but when i start to run towards the "Dot" i see the _unit icon and the marker "Dot" getting closer. And when im right at the position of the marker "Dot" .. the unit icon and the marker dot is ontop of each other. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _Me = (_this select 0); sleep 2; _i=0; for [{_i=0},{_i<1},{_i=_i}] do { WestTriggerOne = createTrigger ["EmptyDetector", position _Me]; WestTriggerOne setTriggerActivation ["EAST", "PRESENT", true]; WestTriggerOne setTriggerType "NONE"; WestTriggerOne setTriggerArea [50000, 50000, 0, false ]; sleep 2; //get a list of enemy units inside the trigger. _whohere = list WestTriggerOne; _nr = count (_whohere); _index=0; _myarray=[0]; for [{_a=0},{_a < _nr },{_a=_a+1}] do { _unit = _whohere select _a; _Eclass = typeOf _unit; _Ename = name _unit; // i want only thouse who are of AIR type into a new array if (_unit isKindOf "AIR") then { _myarray set [_index, _unit]; createMarker [_Ename, (position _unit)]; _Ename setMarkerType "Dot"; _index = _index +1; _myarray resize _index; }; }; _nrma = count (_myarray); // plot the positions on the map for all the air units in the trigger area. for [{_b=0},{_b < _nrma },{_b=_b+1}] do { _unit = _myarray select _b; _Ename = name _unit; _pos= getpos _unit; _xp = _pos select 0; _yp = _pos select 1; _zp = _pos select 2; _Ename setMarkerPos [_xp,_yp,_zp]; sleep 0.001; }; }; if a unit has not been moving at all, the dot is right. But, if a unit has moved. the dot and the unit icon is not correct. can anyone try this and conferm it?
-
I know if i put the game on veteran Mode i get rid of the unit icons.. But.. i have yet to figure out howto do that in the edior. someone please tell.. please tell.. as i mostly spend my time in there..
-
Why are you using "EJECT" ? what if a soldier with a parashoot tryes to fly the heli? use GETOUT instead
-
If i know the position of A and B, and I know the distance of from A to B.. and i know the heading from A to B, i also know the hight of A and B,, so how can i the set obj A to face "point" at obj B whith eighter setvectorUp or setvectorDir,
-
hehe i dont get it im still as confused as i was.. Code Sample _Pa = getpos A; _Pb = getpos B; _Pab = [(_Pb select 0 - _Pa select 0), (_Pb select 1 - _Pa select 1),(_Pb select 2 - _Pa select 2)]; _objA setVectorDir _Pab; kinda worked. but if i changed it to setVectorUp _Pab instead.. i got better results.. obj B faces me in "xyz" cords..VS setVectorDir that only seems x.y,z where z=speed up/down with the objects current rotation "vectopup" <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _testobj = "LODy_test" createVehicle [0,0,0]; _testobj setpos [(getpos player select 0),(getpos player select 1), ((getpos player select 2)+50)]; while {true} do { _Pa = getpos _testobj; _Pb = getpos player; _Pab = [(_Pb select 0 - _Pa select 0), (_Pb select 1 - _Pa select 1),(_Pb select 2 - _Pa select 2)]; _testobj setVectorUp _Pab; sleep 0.1; }; on your player put nil = this execvm "weirdstuff.sqf" take a ride around it with a heli
-
I like to know that too.. i know how to get the angel tho.. but not how to use it with vectoup. forexample.. objA = Aax,Aay,Aaz. objB = Bbx,Bby,Bbz. // use this g0 = Bbx,Bby,0 "make a triangle" tan angel = (( Bbz distance g0 ) / ( objA distance objB )) atan angle = angle in deg,, PS.. i whish ther was a "setdir" to Z cordites :P
-
dont add sonicfog to the harrier,, its a sub sonic aircraft.. it doesnt do mach 1..
-
hi all.. how can i make a missile go off in mid air? i have tryed with setdammage but that didnt go so well.. i know the missile(s) have a lifetime.. and when the lifetime is out,, the missile explodes. so is ther a way for me to set the lifetime to 0 where i want it to go off ? ?
-
howto make a missile go off im mid air ?
nuxil replied to nuxil's topic in ARMA - MISSION EDITING & SCRIPTING
well. if ther is a way to reduce the lifetime on the missil,, it can be trigger by script or other methods.. i know the missile go off when it hits something,, but it also go off when it has used up its "lifetime" -
What licenses should be used for our work?[url
nuxil replied to =jps=sgtrock's topic in ARMA - MISSION EDITING & SCRIPTING
GPL -
What licenses should be used for our work?[url
nuxil replied to =jps=sgtrock's topic in ARMA - GENERAL
GPL -
hi.. im trying to make a Anti air craft script.. wher a unit simulates a sam site or other kind of aa vehicles.. i use a stryker for my aa vehicle.. it shoots out a missile "M_Ch29_AT" and should tryes to track the target, which is air type. however,, i cant adjust the vectorUp.. guess my skriping skill isnt good enought yet,, so i have to use sevelocity instead.. which looks weird.. cos the missil is going in a kind of ossilation state.. _-_-_-_ :P <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> sleep 1; //need the mission to compleate the load.. sleep (1+(random 3)); _AAvehicle = (_this select 0); _i=0; for [{_i=0},{_i<1},{_i=_i}] do { WestTriggerOne = createTrigger ["EmptyDetector", position _AAvehicle]; WestTriggerOne setTriggerActivation ["EAST", "PRESENT", true]; WestTriggerOne setTriggerType "NONE"; WestTriggerOne setTriggerArea [2500, 2500, 30, false ]; sleep 2; //get a list of enemy units inside the trigger. _whohere = list WestTriggerOne; _nr=count (_whohere); _a=0; for [{_a=0},{_a<_nr},{_a=_a+1}] do { //make the trigger big.. //? WestTriggerOne setTriggerArea [2500, 2500, 0, false ]; _unit = _whohere select _a; _nameAA= name _AAvehicle; _HELI=30; _PLAIN=90; _Value=0; _locktime=0; _Eclass=typeof _unit; _Ename= name _unit; _Ehight = getpos _unit select 2; _b=0; if ((_Eclass == "Su34") || (_Eclass == "Su34B")) then { _Value=_PLAIN; _locktime=3; } else { _Value=_HELI; _locktime=2; }; // end class if ((side _unit != side _AAvehicle) && (_unit iskindOf "AIR") && (_Ehight > _Value) && (_Ehight < 800) && ((getdammage _unit) <0.8)) then { _lockon=format["West: %1 locking on\nEast: %2,",_nameAA , _Ename]; hint format["%1", _lockon]; sleep (_locktime); hint ""; //check the hight again,,, we want to be able to avoid the AA vehicle.. if ( _Ehight < _Value ) then { _b=1; }; _missil = "M_Ch29_AT" createVehicle [0,0,0]; _missil setpos [(getpos _AAvehicle select 0),(getpos _AAvehicle select 1),(getpos _AAvehicle select 2)+ 3.5]; // need the missile to launch verticaly.. _missil setvectorUp [0,1,-1]; //_missil setvelocity [0,0,50]; //_missil setvectordir [1,0,0]; sleep 1; while {(alive _missil) && (_b == 0)} do { // "n e s w" hight so on.. _targetpos = getpos _unit; _tx = _targetpos select 0; _ty = _targetpos select 1; _tz = _targetpos select 2; _missilpos = getpos _missil; _mx = _missilpos select 0; _my = _missilpos select 1; _mz = _missilpos select 2; // missil direction _heading = getdir _missil; // Trigometri _hypotenus = [_mx,_my,0] distance [_tx,_ty,0]; // position of the target, and calculate new heading,, divide into 4 sectors. if ((_mx < _tx) && (_my < _ty)) then { _hoskatet = [_mx,_my,0] distance [_tx,_my,0]; _motkatet = [_tx,_my,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _nyheading = 90 - _reelvink; _missil setdir _nyheading; }; if ((_mx < _tx) && (_my > _ty)) then { _hoskatet = [_mx,_my,0] distance [_tx,_my,0]; _motkatet = [_tx,_my,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _vx = 90 + _reelvink; _nyheading = _vx; _missil setdir _vx; }; if ((_mx > _tx) && (_my > _ty)) then { _hoskatet = [_mx,_my,0] distance [_mx,_ty,0]; _motkatet = [_mx,_ty,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _nyheading = 180 + _reelvink; _missil setdir _nyheading; }; if ((_mx > _tx) && (_my < _ty)) then { _hoskatet = [_mx,_my,0] distance [_tx,_my,0]; _motkatet = [_tx,_my,0] distance [_tx,_ty,0]; _tanvink=( _motkatet / _hoskatet ); _reelvink = atan _tanvink; _nyheading = 270 + _reelvink; _missil setdir _nyheading; }; // check the hight for the missile and compared to the target. if (_mz > _tz) then { _vel = velocity _missil; _dir = direction _missil; _speed = 5; // move missile down.. ( think its better with setvectrorUp.. but dont know howto do it,, _missil setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),-350]; }; if (_mz < _tz) then { _vel = velocity _missil; _dir = direction _missil; _speed = 5; // move missile up.. ( think its better with setvectrorUp.. but dont know howto do it,, _missil setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),350]; }; sleep 0.001; }; //end the while hint ""; // resize the trigger after the shots WestTriggerOne setTriggerArea [5, 5, 30, false ]; }; // end if iskindOf "AIR" //check the status of the unit we just shot at.. if (getdammage _unit < 0.8) then {_a=_a; _b = 0;} else {_a=_nr; hint ""; }; }; // end 2nd loop //check if ower unit is dead.. and end the loop if aavehicle is dead. if (( _AAvehicle in _AAvehicle ) && (getdammage _AAvehicle < 0.7)) then {_i=_i;} else {_i=1;}; }; // end 1st loop to test the script just do var=[this] execvm "script.sqf" can anyone help? i know ther are variables uses over again with diff name :\ it nees a bit of cleaning up.. anyone
-
Thise nice effects should be standar in the next patch