Jump to content

twirly

Member
  • Content Count

    1304
  • Joined

  • Last visited

  • Medals

Everything posted by twirly

  1. What exactly is in your condition. It should be something like this.... this && myVariable Is the this && there?
  2. I think this line is supposed to be... hostage setPos (mybuilding buildingPos ([2,5] select floor (random 2)));
  3. If you had an array of the town units called _townunits then you can use setCaptive to make the plane ignore them. The thing though... is that everyone will ignore them. They become "NEUTRAL"; {_x setcaptive true} foreach [b]_townunits[/b]; Change the true to false to bring them back to being targets again.
  4. I suspect this is what you really want.... //create a red smokeshell at a helipad called hpad1 _smoke_red = "SmokeShellRed" createVehicle position hpad1; //create a green smokeshell at helipad called hpad2 _smoke_green = "SmokeShellGreen" createVehicle position hpad2; But if it really is the particle effects your after.... this is a fire and smoke example... It creates fire and smoke at a helipad called hpad1; Call the fire and smoke script (firesmoke.sqf) with this:- //create fire and smoke at helipad1....using particleffects nul = [hpad1] execVM "firesmoke.sqf"; firesmoke.sqf:- _obj = _this select 0; _PS1 = "#particlesource" createVehicleLocal getpos _obj; _PS2 = "#particlesource" createVehicleLocal getpos _obj; _PS3 = "#particlesource" createVehicleLocal getpos _obj; _PS1 setParticleCircle [0, [0, 0, 0]]; _PS1 setParticleRandom [0.2, [1, 1, 0], [0.5, 0.5, 0], 1, 0.5, [0, 0, 0, 0], 0, 0]; _PS1 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 8, 2, 6], "", "Billboard", 1, 1, [0, 0, 0], [0, 0, 0.5], 1, 1, 0.9, 0.3, [1.5], [[1, 0.7, 0.7, 0.5]], [1], 0, 0, "", "", _obj]; _PS1 setDropInterval 0.03; _PS2 setParticleCircle [0, [0, 0, 0]]; _PS2 setParticleRandom [0, [0, 0, 0], [0.33, 0.33, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0]; _PS2 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 8, 0, 1], "", "Billboard", 1, 10, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10], [[0.3, 0.3, 0.3, 0.33], [0.4, 0.4, 0.4, 0.33], [0.2, 0.2, 0, 0]], [0, 1], 1, 0, "", "", _obj]; _PS2 setDropInterval 0.5; _PS3 setParticleCircle [0, [0, 0, 0]]; _PS3 setParticleRandom [0, [0, 0, 0], [0.5, 0.5, 0], 0, 0.25, [0.05, 0.05, 0.05, 0.05], 0, 0]; _PS3 setParticleParams [["\Ca\Data\ParticleEffects\Universal\Universal", 8, 3, 1], "", "Billboard", 1, 15, [0, 0, 0.5], [0, 0, 2.9], 1, 1.275, 1, 0.066, [4, 5, 10, 10], [[0.1, 0.1, 0.1, 0.75], [0.4, 0.4, 0.4, 0.5], [1, 1, 1, 0.2]], [0], 1, 0, "", "", _obj]; _PS3 setDropInterval 0.25; Note: This is all .sqf and not .sqs script. Try not to use .sqs. It's an older form of scripting. In fact there's no need to... so don't use it. It's not much different to .sqf though so all the examples still apply. You just need to know a few rules and be able to apply them to convert the code.
  5. Try adding this && to your condition.... So the trigger is fired (this) and your condition is also met. [b][i]this &&[/i][/b] ({alive _x} count units Antiaa) == 0;
  6. Port... yes... with a lot of work. Just open the mission and play it... No way!
  7. Hi... Put this in a file called init.sqf....in your mission folder. This will create a little handler for keypresses. MY_KEYDOWN_FNC = { switch (_this) do { //Key Y case 44: { nul = [] execVM "my_script1.sqf"; }; //Key X case 45: { nul = [] execVM "my_script2.sqf"; }; //Key C case 46: { nul = [] execVM "my_script3.sqf"; }; }; }; To enable your little keypress handler at any time.... //Add an EventHandler to the main display... waituntil {!isnull (finddisplay 46)}; (findDisplay 46) displayAddEventHandler ["KeyDown","_this select 1 call MY_KEYDOWN_FNC;false;"]; Now.. when you press the "Y" key... my_script1.sqf will run. Press the "X" key and my_script2.sqf will run.... and so on..... To remove the EventHandler and return your keyboard to normal.... use.... //Remove the EventHandler... (findDisplay 46) displayRemoveAllEventHandlers "KeyDown"; ASCII Codes can be found here. I believe you have to use the HEX codes.... not 100% sure on that so fiddle to find out. EDIT: I just saw Demonized post above... and think you'd better use the link he posted there to get the Key Codes. As standard ASCII codes are probably not what Arma 2 uses. I have changed the codes in the script above according to that page... so it should now work as posted.
  8. Once you have the Functions Module on the map...these lines will return the dive angle (pitch) of the _plane. _pitchbank = _plane call BIS_fnc_getPitchBank; _pitch = _pitchbank select 0; _pitchbank will be an array containing two things... pitch and bank... like this... [pitch, bank] You then need to select the first element of the array to get _pitch... so... _pitch = _pitchbank select 0 Yes downloaded a video from YouTube. Used flv2avi to convert to an .avi Used VirtualDub to extract the sound to a .wav Used Audacity to manipulate the .wav.... in this case split in into two parts... and make the .oogs. I wouldn't worry too much about asking permission to use the sound from an old archive video on YouTube....it's probably public record and in the public domain anyway. Hope that helps.
  9. Here are some links that might help you... just two of many results. Searching does wonders! http://forums.bistudio.com/showthread.php?123191 http://forums.bistudio.com/showthread.php?110368
  10. You are dead right.... doMove works now with the sleep. Hmmmm! Cheers for that.
  11. I feel your pain!. I have been there too! ... and seems that I'm there again... now! The civilians have a mind of their own. Lol!.... they seem to get a bit confused when there's men with guns around. I've been trying to get him to move once he is in the car and it's really quite bizarre... some commands simply don't seem to work anymore. I am using the latest beta. Unless I'm terribly misguided or have missed some change to the way things work.... doMove, moveTo and commandMove now seem useless!!!??? They certainly are useless here! Here is the code for the little test I did....as well as a demo mission here! test.sqf:- _man = _this select 0; _veh = _this select 1; _mkr = _this select 2; _man setbehaviour "CARELESS"; _man domove position _veh; waituntil {unitready _man}; _man assignAsDriver _veh; [_man] orderGetIn true; waituntil {vehicle _man != _man}; //waituntil {unitready _man}; hint "man in vehicle"; //*** all of these don't work anymore????? ***** //_man domove (getmarkerpos _mkr); //_man moveto (getmarkerpos _mkr); //_man commandmove (getmarkerpos _mkr); //giving a waypoint to _man's group works fine group _man addWayPoint [getmarkerpos _mkr,10]; Call it with:- nul = [man,vehicle,marker_to_move_to] execVM "test.sqf"; All quite strange... really! EDIT: I see there's a ticket for some sort of bug with domove etc. https://dev-heaven.net/issues/28311
  12. Something like this maybe....the sound is broken into two parts... the dive and the pullout. Demo mission here! This is not an ideal solution and there will be problems with the play length of the sounds.... but is here to give you some ideas. Because of the limitations of playing sound... I'm not sure if an ideal solution is possible! The first sound plays in a dive of over 20 degrees and the second sound plays when the aircraft has been in a dive of >20 and is now <10 degrees. Also instead of using playsound which is non-directional... you can use _plane say3D "sound".... which is directional. For the description.ext (which you must create). The sounds are in a folder called sounds. description.ext:- //************************************************************ // === Sounds ===============================================> //************************************************************ class CfgSounds { sounds[]= {stuka_01,stuka_02,nofear,topgun_s}; class stuka_01 { name = "stuka_01"; sound[] = {\sounds\stuka_01.ogg, 1, 1.0}; titles[] = {}; }; class stuka_02 { name = "stuka_02"; sound[] = {\sounds\stuka_02.ogg, 1, 1.0}; titles[] = {}; }; class nofear { name = "nofear"; sound[] = {\sounds\nofear.ogg, db-0, 1.0}; titles[] = {}; }; class topgun_s { name = "topgun_s"; sound[] = {\sounds\topgun_s.ogg, db-6, 1.0}; titles[] = {}; }; }; ....and for the loop to monitor the planes inclination. Call with nul = [plane] execVM "siren.sqf"; siren.sqf:- _plane = _this select 0; _indive = false; while {canmove _plane} do { _pitchbank = _plane call BIS_fnc_getPitchBank; _pitch = _pitchbank select 0; hint format ["pitch: %1",_pitch]; if (_pitch < (-20) and not _indive) then {playsound "stuka_01";_indive = true}; if (_pitch >= (-10) and _indive) then {playsound "stuka_02";_indive = false}; sleep 1; }; You can use Audacity to make your .oog sounds from .wavs! There's a couple extra sounds in the folder just for the hell of it!
  13. Put it in init.sqf and not an init.sqs! There's no need to ever use .sqs... it's the older scripting language for Operation Flashpoint. EDIT: It probably shouldn't be in the init.sqf either actually.... but called in another script when needed as F2k Sel suggested.
  14. This won't work because of @unitready. That's .sqs code. Try waitUntil {unitready vip5};
  15. addWaypoint needs a position and a placement radius. _wptest1 = _grp1 addWaypoint [[12604.7,9837.15,0.214798],10] ;
  16. Hi... I sort of re-wrote things a bit. There's no point in having the same lines over and over again if they only need to be executed once. This is not tested and I took out a whole bunch of seemingly redundant code. It should still work as intended though. I also formatted so that it can be read. Next time use the PHP or Code tags when posting code.... it's much easier on the eyes. waituntil {!isnil "bis_fnc_init"}; _habib = _this select 0; _habibgroup = group _habib; _markers = ["Habibscar2","Habibscar3","Habibscar4","Habibscar5 ","Habibscar6","Habibscar7","Habibscar8","Habibsca r9","Habibscar10","Habibscar11"]; _randommarker = _markers call BIS_fnc_selectRandom; _randomcarpos = getMarkerPos _randommarker; _cartype = ["VolhaLimo_TK_CIV_EP1","p85_gold","SUV_TK_CIV_EP1" ,"car_sedan","p85_w353","Volha_1_TK_CIV_EP1","Lada 2_TK_CIV_EP1","car_hatchback","S1203_TK_CIV_EP1"," p85_trabi","Volha_2_TK_CIV_EP1","VWGolf"] call BIS_fnc_selectRandom; _habibscar = _cartype createVehicle _randomcarpos; _carpos = getpos _habibscar; _cardir = getdir _habibscar; DMZ_Excluded = DMZ_Excluded + [_habibscar]; _closest = [_randommarker,_habibscar] call BIS_fnc_nearestPosition; _TL = ["TK_INS_Soldier_TL_EP1","TK_INS_Soldier_2_EP1","TK _INS_Soldier_EP1","TK_INS_Soldier_3_EP1","TK_INS_S oldier_4_EP1","TK_INS_Warlord_EP1","TK_Soldier_EP1 ","TK_Soldier_B_EP1","TK_Soldier_Engineer_EP1","TK _Soldier_SL_EP1","TK_Soldier_Officer_EP1"] call BIS_fnc_selectRandom; _rifleman = ["mas_tak_conv_sl_d","mas_tak_conv_slk_d","mas_tak_ conv_sl_n","mas_tak_conv_slk_n","mas_tak_sf_tl_n", "mas_tak_sf_sl_n","mas_tak_sf_dem_n","mas_tak_conv _lgh_v","mas_tak_conv_slk_v","mas_tak_sf_sl_m","ma s_tak_conv_slk_m"] call BIS_fnc_selectRandom; _mgunner = ["TK_INS_Soldier_AR_EP1","TK_INS_Soldier_MG_EP1","T K_Soldier_MG_EP1","TK_Soldier_AR_EP1","TK_Special_ Forces_MG_EP1","mas_tak_sf_mg_d","ETerrorist10","E Terrorist9","ETaliban10","ETaliban9","mas_tak_conv _ar_z"] call BIS_fnc_selectRandom; _glauncher = ["TK_INS_Soldier_TL_EP1","TK_Soldier_GL_EP1","TK_Sp ecial_Forces_EP1","mas_tak_sf_sl_d","ETerrorist5", "ETaliban4","EGangsta_merc7","mas_tak_conv_gl_d"," mas_tak_conv_gl_n","mas_tak_sf_sl_n","mas_tak_conv _gl_v"] call BIS_fnc_selectRandom; _ATlauncher = ["TK_INS_Soldier_AT_EP1","TK_INS_Soldier_AT_EP1","T K_Soldier_LAT_EP1","TK_Soldier_AT_EP1","TK_Soldier _HAT_EP1","mas_tak_conv_at_d","ETerrorist6","ETali ban5","mas_tak_sf_at_d","mas_tak_conv_at_n","mas_t ak_sf_at_n"] call BIS_fnc_selectRandom; _AAlauncher = ["TK_INS_Soldier_AA_EP1","TK_INS_Soldier_AA_EP1","T K_Soldier_AA_EP1","mas_tak_conv_aa_d","ETerrorist7 ","ETaliban6","mas_tak_conv_aa_n","mas_tak_conv_aa _v","TK_INS_Soldier_AA_EP1","TK_INS_Soldier_AA_EP1 ","TK_INS_Soldier_AA_EP1"] call BIS_fnc_selectRandom; _Medic = ["TK_INS_Bonesetter_EP1","TK_INS_Bonesetter_EP1","T K_Soldier_Medic_EP1","IRAN_MAN_Medic","ETerrorist1 2","ETaliban12","EGangsta_merc10","mas_tak_sf_med_ d","mas_tak_conv_med_d","mas_tak_conv_med_n","mas_ tak_sf_med_n"] call BIS_fnc_selectRandom; _Sniper = ["TK_INS_Soldier_Sniper_EP1","TK_INS_Soldier_Sniper _EP1","TK_Soldier_Sniper_EP1","TK_Soldier_SniperH_ EP1","TK_Soldier_Sniper_Night_EP1","mas_tak_sf_snp _d","ETerrorist11","ETaliban11","EGangsta_merc9"," mas_tak_conv_mark_d","mas_tak_sf_snpgh_d"] call BIS_fnc_selectRandom; //this switch can be reduced to one or two lines lines using call compile format! switch {_closest) do { case "Habibscar2": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar3": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar4": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar5": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar6": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar7": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar8": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar9": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar10": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; case "Habibscar11": { habib setVehicleInit "task1a = player createSimpleTask[""Hearts and Minds: Habib's Car"",task1];task1a setSimpleTaskDescription[""<br/><marker name='Habibscar2'>Habib's Car</marker> was stolen by a group of militiamen.<br/>Find Habib's car and return it to him.<br/><br/>"",""Hearts and Minds: Habib's Car"",""Find Habib's car""];task1a setSimpleTaskDestination (getMarkerPos ""Habibscar2"");task1a setTaskState ""Created"";[task1a] call mk_fTaskHint"; }; }; //remove the chosen marker from the list _markers = _markers - [_closest]; //delete the leftover markers {deleteMarker _x} foreach _markers; _closest setMarkerType "mil_circle"; _closest setMarkerColor "ColorGreen"; processInitCommands; _carGuardGroup = [_carpos, EAST, [TL,_rifleman,_mgunner,_glauncher,_ATlauncher,_AAla uncher,_Medic,_rifleman,_rifleman,_rifleman,_rifle man,_rifleman],[],[],[],[],[],_cardir] call BIS_fnc_spawnGroup; nul=[_carGuardGroup, _carpos] call bis_fnc_taskDefend; nul = [_habibscar] execVM "scripts\habibscar_destroyed.sqf"; waitUntil {_habibscar distance _habib <= 30}; habib setVehicleInit "this switchMove ""c7a_bravoTOerc_idle3"";this globalChat ""Thank you for returning my car"""; processInitCommands; sleep 2; habib setVehicleInit "this globalChat ""I will go to your base now"""; processInitCommands; habib setVehicleInit "task1a setTaskState ""Succeeded"";[task1a] call mk_fTaskHint"; processInitCommands; sleep 5; habib setVehicleInit "task1 setTaskState ""Succeeded"";[task1] call mk_fTaskHint"; processInitCommands; waitUntil {(count crew _habibscar) == 0}; sleep 10; _habib switchmove ""; _habib enableAI "MOVE"; _habib assignAsDriver _habibscar; _habib action ["getInDriver", _habibscar]; waitUntil {_habib in _habibscar}; _habibscar lock true; _habibscar allowdamage false; _habibwp1 = _habibgroup addWaypoint [getmarkerpos "habibbasewpmarker",0]; [_habibgroup, 1] setWaypointType "GETOUT"; [_habibgroup, 1] setWaypointBehaviour "CARELESS"; [_habibgroup, 1] showWaypoint "NEVER"; deleteMarker "habibbasewpmarker";
  17. Got it to work by declaring _spawn1,_spawn2,_spawn3 as private at the top of the script. private ["_spawn1","_spawn2","_spawn3"]; I also replaced _x with _i in the script when testing... I think _x should probably only be used in foreach blocks... that seems to be the proper convention anyway.
  18. The syntax is probably like this.... _gunshipgroupleader setVehicleInit "gunshipgroup = group this; this setIdentity ""AH-1Z/A"""; or.... same thing but single quotes for AH-1Z/A.... _gunshipgroupleader setVehicleInit "gunshipgroup = group this; this setIdentity 'AH-1Z/A'"; Both should work.
  19. Just noticed that when in the airport tower on Utes and looking through the glass... no smoke or explosions are visible. Just checked some other buildings and the same result....no smoke, fire or explosions visible when looking through window glass.
  20. Hi mate...and welcome to the forums. Try this... replace (leader _this==_this) with (_this in playableUnits) EDIT: ...or specifically for an array with only UID's (_this in UIDarray). You need to create the array UIDarray or whatever you want to call it.
  21. Wrong forum man..... look for the one that deals with modelling.
  22. Hey man.... I added the randomness part and it should work. I did a quick test and it seemed too. Give it a spin and see what you think. I'll have a think about the not being detectable right away as you get into the car after being detected. I see that could be a problem. private ["_ldr","_i","_unit","_rndwait"]; _ldr = _this select 0; while {count (units group _ldr) >=1} do { [color="Red"] if (random 100 < 15) then { _rndwait = 60 + random 60; hint format ["Detectable for %1 seconds",_rndwait]; } else { _rndwait = 1; hint "Un-detectable"; }; [/color] for "_i" from 0 to (count (units group _ldr))-1 do { _unit = (units group _ldr) select _i; if (vehicle _unit == _unit) then { if (captive _unit) then {_unit setcaptive false}; } else { if (! captive _unit [color="Red"]&& _rndwait == 1[/color]) then {_unit setcaptive true}; }; sleep 0.01; }; sleep [color="Red"]_rndwait[/color]; };
  23. Did you try this (assuming briefing.jpg is in a folder called images in your mission folder)? <img image='images\briefing.jpg' width='256' height='256'/>
×