PELHAM
Member-
Content Count
1582 -
Joined
-
Last visited
-
Medals
Everything posted by PELHAM
-
Getting units to fire near someone
PELHAM replied to Funkman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
When the units are in a tank they are under control of a commander so will not fire or target unless he orders them to. In addition to a driver and gunner you need to assign a commander with: _man1 moveInCommander _tank1; try Vino's advice on the commander? other ideas: Also look at: commandTarget commandFire You might need to get the vehicle as a whole to target your object with: Description: Remotely forces a unit to fire the given weapon. http://community.bistudio.com/wiki/fireAtTarget Example 2: _handle = Igla_AA_pod_TK_EP1 fireAtTarget [_helicopter,currentweapon Igla_AA_pod_TK_EP1]; Example 3: _handle = Igla_AA_pod_TK_EP1 fireAtTarget [helicopter]; -
AI Land and load C-130J
PELHAM replied to Paddy086's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
No the "Land" referred to in that command is the class - ie Land vehicles. Not a landing aircraft. http://community.bistudio.com/wiki/countType Scripting_Commands_ArmA2 CfgVehicles You might get this to work: Will check the height above terrain of the C130 every 3 seconds. _heightchkr = { while {alive yourC130unit} do { sleep 3; _height = getPosATL yourC130unit; }; }; call _heightchkr; Condition of your trigger: yourC130unit in thislist && _height > 10; Will trigger if C130 is there and value of _height is less than 10m Untested so not 100% sure this would work. Another method would be to have a unit in cargo when the C130 passes over the airfield the 1st time then remove him for the landing when the landing instruction is issued. Your trigger condition might be: C130 in thislist && !(unit in thislist); -
AI Land and load C-130J
PELHAM replied to Paddy086's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Check out the downloads at Armaholic.com - scripts for almost everything there! They have great C130 ramp and cargo stuff - better than anything i could do. -
Placing units inside of buildings / On towers
PELHAM replied to SOSyourself's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Variation that I use: easy method to assign positions in buildings: Put this in the soldiers init: this setPos ((position this nearestObject 123839) buildingPos 4); 123839 = building identifier number - max zoom in on the Editor, press the ID's button. 4 = building position - you will have to figure out where these are. If you go into a building as a squad leader and press space - you get lines to building positions as you move the cursor around. If you want to make them keep standing up - best on balconies etc: this setUnitPos "Up"; -
AI de/activate mines
PELHAM replied to Nephris1's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well I'm a noob so forgive me if this is gibberish but wouldn't attaching a repeating trigger to an AI work? If you set it to a 1 or 2m area set with a condition "_mine1 or _mine2 etc... in thislist;" to detect the mines - then hideObject, animation or run a script of your choice (detect if mine is activated or not etc)? Give the unit a name, give the trigger a name. Then in the unit's init: triggername attachTo [unitname, [0,0,0]]; The trigger will move wherever the AI goes I think. Don't ask me how to write a script for all that lol! -
Make side East hold/Open fire and Urban combat questions.
PELHAM replied to EBass's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Easy method to assign positions in buildings: Put this in the soldiers init: this setPos ((position this nearestObject 123839) buildingPos 4); 123839 = building identifier number - max zoom in on the Editor, press the ID's button. 4 = building position - you will have to figure out where these are. If you go into a building as a squad leader and press space - you get lines to building positions as you move the cursor around. If you want to make them keep standing up - best on balconies etc: this setUnitPos "Up"; -
Radio Voices sounds real slow in MP Missions
PELHAM replied to zonekiller's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It happens in some of the Domination servers where occasionally friendly AI spawn at targets in error. I hope some of the server admins read the above and stop it lol! Funny when it happens tho. -
Correct order of installation
PELHAM replied to Dr. Horrible's topic in ARMA 2 & OA - TROUBLESHOOTING
I have a friend just starting with all four, arma2 game and expansions. What's the current install order now we have PMC as well? -
AI Land and load C-130J
PELHAM replied to Paddy086's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well to open the ramp is easy - you just can't use it. BIS don't do walk in vehicles. You can walk in the static C130 but it's stuck in a flying animation so can't be used on the ground. Also if you sit inside the C130 with the ramp open - it looks closed, unless you are right next to the door. Ramp is in 2 halves so 2 animations: to open ramp h1 animate ["ramp_top",1]; h1 animate ["ramp_bottom",1]; to close ramp h1 animate ["ramp_top",0]; h1 animate ["ramp_bottom",0]; C130 Animations 0 means closed, 1 is open for all - as above. door_1 door_2_1 door_2_2 ramp_top ramp_bottom Cargo? Norrins script is the best! look here: http://www.armaholic.com/page.php?id=5893 http://forums.bistudio.com/showthread.php?p=1447841#post1447841 http://forums.bistudio.com/showthread.php?t=73630&highlight The core of vehicle cargo is the attachTo command - read here: http://community.bistudio.com/wiki/attachTo All scripting here: http://community.bistudio.com/wiki/Category:Scripting_Commands_ArmA2 ---------- Post added at 12:36 ---------- Previous post was at 11:22 ---------- Why not add a parachute drop to that mission? Create a trigger activated by Blufor. On Act: nul = stick1 execVm "groupeject.sqf"; (Your group must be called stick1 - or edit that to name of your group. put this in the squad/team leaders init, change groupname to whatever you want.) groupname = group this; save this to groupeject.sqf in the mission folder { unassignvehicle _x; _x action ["EJECT", vehicle _x]; sleep 1; } foreach units _this; When the C130 flies over the trigger they will parachute 1 AI per second. Example of a script loop - it must have a sleep in it or the game will crash. -
Ai A10 wont bomb targets on waypoint
PELHAM replied to Paddy086's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This isn't easy: If you use an AI to laser designate you need to be his team/squad leader and be a more senior rank- they will only target vehicles less than 500m away. You need to order him to move about 450m fom the target. Select the AI (F1-F10) press 2, assign him a specific target when he gets there. If you want to target enemy AI or buildings - you need to laser it yourself, or set up a laser target as suggested above. The AI pilot will usually not drop bombs on the 1st pass. If you have the target lasered and he can see it from 3000m he will sometimes drop on 1st pass. To laser you need a Laserdesignator and batteries. put this in the init of your player or AI: this addMagazine "Laserbatteries"; this addWeapon "Laserdesignator"; (or they are in one of the special ammo crates.) It is best to take away the AI's rifle or he will keep swapping between it and the LD. eg I use the BAF JTAC - it already has a laser designator so I just use this in it's init: this removeWeapon "BAF_L85A2_UGL_Holo"; You will have to play as the AI and check his loadout at an ammo box to see what you need to remove. The weapon class names are in a Sticky at the top of the forum. To prevent the A10 from firing guns, sidewinders and mavericks so you can test LGB's, put this in it's init for bombs only; this setVehicleAmmo 0.0; {this addMagazineTurret ["4Rnd_GBU12",[-1]];} forEach [1,2]; {this addMagazineTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];} forEach [1,2]; this will give you 8 GBU12 bombs and 240 chaff/flares. Script 'bombs only' example for an F35B named _F35Bveh put this in it's init: xhandler = [this] execVM "f35load.sqf"; save this to f35load.sqf _F35Bveh = _this select 0; _F35Bveh setVehicleAmmo 0.0; {_F35Bveh removeMagazines _x} forEach (magazines _F35Bveh); {_F35Bveh removeWeapon _x} forEach (weapons _F35Bveh); {_F35Bveh addMagazine "2Rnd_GBU12"} forEach [1,2,3,4]; _F35Bveh addWeapon "BombLauncherF35"; {_F35Bveh addMagazine "120Rnd_CMFlare_Chaff_Magazine"} forEach [1,2,3,4]; _F35Bveh addWeapon "CMFlareLauncher"; _F35Bveh setFuel 1; -
AI Land and load C-130J
PELHAM replied to Paddy086's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
OK here is what I did. It's all been done before - if you search C130, C130 ramp, etc you will find posts. Kylania and Norrin have some good cargo and eject scripts. You will also find some HALO scripts to use with the static C130. All done in the Editor but easy to script as well. I will do a scripted version of this if you need it. Zargabad 1. Place your C130 on the map, North West-ish of the airfield - heading 180 degrees, name it h1, FLYING. 2. F2, Group, add a BLUFOR, US Army, Infantry, Rifle Squad near the hangars. Make sure they are well back from the taxiway or the C130 will stop and not proceed. Set one of the privates as PLAYER. In the squad leaders init: stick1 = group this; C130 Positions: up to 26 crew and passengers. See attachTo for cargo and vehicles. 3. WP-0 Add a MOVE waypoint for h1 between the C130 and the airfield with: h1 landAt 0; in the init. Set speed LIMITED - it's a small map. see:http://community.bistudio.com/wiki/landAt 4.WP-1 add a C130 h1 MOVE waypoint away from Zargabad (4a.WP-1 add a C130 h1 CYCLE somewhere else - will return you to the airfield) The C130 will circle and approach from the south, land, taxi around and take off all on it's own with just that landAt command. To stop it to load troops add: 5. Trigger 1 - 20m x 5m across the taxi,waynear troops. Anybody, Once Cond: h1 in thislist; OnAct: h1 setFuel 0; h1 animate ["door_1",1]; {_x assignAsCargo h1} foreach units stick1; (units stick1) orderGetIn true; 6. Trigger 2 (overlap with Trigger 1) Anybody, Once, Countdown, timeoutMin=60, timeoutMid=60, timeoutMax=60. Cond: h1 in thislist; OnAct: h1 animate ["door_1",0]; sleep 5; h1 setFuel 1; Notes: door_1 is the LHS side door. 60 seconds = delay before C130 starts taxi for take off - adjustable. h1 in thislist; the trigger can only be activated by this unit. 7. Synchronise Trigger 2 with WP-1 Will stop the WP becoming active until the trigger activates. NOTE: Make sure there are no players, units, vehicles etc near the runway or taxiway. The C130 pilot will stop to avoid them, even if they are close to the wingtips. It is pre-programmed to pause near the hangers for a few seconds with landAt. -
AI Land and load C-130J
PELHAM replied to Paddy086's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Read this: http://forums.bistudio.com/showthread.php?t=87317&highlight=aircraft+taxi and this: http://forums.bistudio.com/showthread.php?t=95882&highlight=aircraft+taxi and this: http://forums.bistudio.com/showthread.php?t=99739&highlight=aircraft+taxi As you can see people have problems with the C130 and in general getting AI crewed aircraft to stop. Some of these problems may have been fixed but the above should get you started. I will have a go if I get time. Sounds like an interesting project! What Arma version do you have? 2 / OA / both etc? and what airfield did you want to use? -
Custom weapon loadout for planes
PELHAM replied to mpreuett's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try this: {this addMagazineTurret ["12Rnd_Vikhr_KA50",[-1]];} forEach [1,2,3]; Example: A-10 CAS Loadout This script requires Operation Arrowhead Beta 1.52.71816 or later to function! mercyne on the BIS forums wanted a CAS based A-10 loadout with GAU-8, FFARs and 8 Hellfires. Here’s how to do that with the new removeMagazinesTurret commands. Code: this removeMagazinesTurret ["4Rnd_GBU12",[-1]]; this removeMagazinesTurret ["2Rnd_Sidewinder_AH1Z",[-1]]; {this addMagazineTurret ["2Rnd_Maverick_A10",[-1]];} forEach [1,2,3]; this removeWeapon "BombLauncherA10"; this removeWeapon "SidewinderLaucher_AH1Z"; -
Spawn vehicle mid air.
PELHAM replied to fadly1979's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Xeno is right - the BIS spawnfunction is the best way to do this now. I am still learning scripting so wanted to do it the hard way 1st. My way of doing things: //create group and aircraft _F35Bgrp1 = createGroup west; _F35Bveh = createVehicle ["F35B", position player, [], 5000, "FLY"]; //create pilot and move in aircraft _F35Bpilot = _F35Bgrp1 createUnit ["US_Soldier_Pilot_EP1", [0,0,1], [], 0, "CAN_COLLIDE"]; _F35Bpilot moveInDriver _F35Bveh; //create 1st wp _wp0 = _F35Bgrp1 addWaypoint [position player, 0]; [_F35Bgrp1, 0] setWaypointType "SAD"; [_F35Bgrp1, 0] setWaypointSpeed "FULL"; [_F35Bgrp1, 0] setWaypointCombatMode "RED"; I like the above because of the random behaviour. It will start 5000m away and arrive from a random direction and patrol the area around the player in a random manner without too much specific scripting. Lots more lines than BIS spawnfunction but it's fun getting it right! You can use a laser designator with the above and it will drop GBU 12s on second pass. -------------------------------------------------------------------------- My full random CAS script - can be called with a radio trigger when you need it. The F35B will head to your position and patrol. You or the JTAC need to laser designate targets for him. The JTAC is a little work shy - he needs to be within 475m to show any interest in targeting things with the laser designator. Select him and press 2 to select a specific target for him or he might wonder between targets and the jet will not lock on. As usual the pilot will only drop bombs on the second pass. (can be 1st pass if you add code to target specific items but this is designed to be used anywhere, against any vehicles) edit: shock! the F35B will drop on the 1st pass if circunstances are right! The F35B will leave and be deleted after all enemies within 500m are dead. -
Making AI aircraft drop flares
PELHAM replied to weedman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Cracked it - Xeno you're my Hero! He mentions this infinite loop here: http://forums.bistudio.com/showthread.php?t=79556&highlight=infinite+loop AH64D To load extra flares: {this addMagazineTurret ["60Rnd_CMFlareMagazine",[-1]];} forEach [1,2,3,4,5,6,7,8]; This gives 13.5mins / 810 seconds flying time with flares for the script below. 30 pairs flares x 3 seconds x 9 magazines = 810 Name helicopter h2 To eject a pair of flares every 3 seconds: BlaBla = { while {alive h2} do { sleep 3; h2 action ["useWeapon", h2, driver h2, 0]; }; }; call BlaBla; CAUTION: you need a sleep in a loop or the game crashes - too many CPU cycles. Looks cool against a night / dusk / early morning sky. I have seen video of older Apaches without the modern missile launch detection system using this constant flare ejection over high threat areas. Nice to be able to replicate it. edit:The launcher on the AH64D will take the 120Rnd_CMFlare_Chaff_Magazine from the F35B. So to add chaff and flares to the AH64D do: this removeMagazineTurret ["60Rnd_CMFlareMagazine",[-1]]; {this addMagazineTurret ["120Rnd_CMFlare_Chaff_Magazine",[-1]];} forEach [1,2,3]; -
Making AI aircraft drop flares
PELHAM replied to weedman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
This works well in a trigger: heli1 action ["useWeapon", heli1, driver heli1, 0]; just name the helicopter heli1. Can anyone advise a loop to make it do it every 5 seconds - I cant get an sqf loop to work with this: while {alive _heli1} do { _heli1 action ["useWeapon", _heli1, driver _heli1, 0]; sleep 5; }; edit: Is the above a loop? I can find many in sqs but no good examples for sqf - which should I be using? -
Spawn vehicle mid air.
PELHAM replied to fadly1979's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
LOL a shortcut to far! -
Need fresh eyes on my script...
PELHAM replied to jimsolo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I ran it through the Squint script helper / checker: It suggested: add this line top private ["_man","_helo","_Trash","_Loc","_LZ1","_Pad1","_wp1"]; change your line to this onMapSingleClick {'LZ1' setMarkerPosLocal _pos;LZclick = true}; change your line to this onMapSingleClick {}; Don't know if any of that will work but it gets me out of trouble often. It could not check the variables such as MedPilot1, Trash, takeoff etc: as they are defined/exist elsewhere. -
How do I make my PMC units Bluefor
PELHAM replied to SpecterM's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Don't be tempted by the command setSide JTGibson says: This is a frequent question on OFPEC, but produced here because it was difficult to find an answer to. setSide does not work for men, vehicles, etc.: it is intended for locations (i.e., territory). If you want to switch a unit's (e.g., the player's) side in the middle of a battle, make the unit joinSilent a group on the given side instead. If you want the unit to become the group leader after joining, use selectLeader. I haven't tested the idea of spawning a temporary unit of that side, assigning the player to that unit, setting the player as the leader, then deleting the original unit, but I don't see why it wouldn't work. (It begs the question why we don't have a setSide object function, though.) -
Spawn vehicle mid air.
PELHAM replied to fadly1979's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It executes - -Does not spawn vehicle, -Does not spawn crew, you can sometimes see the mortar spawn for a fraction of second then it disappears - no AI crew. Arma2 + OA 1.57 I have no trouble creating AI with it - when you specify a vehicle it does not work. Tried it with an AH64D too? Test it and let me know if it works for you? -
Worthless triggers
PELHAM replied to Modinthalis's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
That helped me with another problem - thank you! -
Weapon name help for ammo box
PELHAM replied to Tom5587's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It has a misleading name! It's listed here: http://forums.bistudio.com/showpost.php?p=1292940&postcount=8 but does not indicate it is the satchel charge. Put this in your ammobox.sqf: _this addMagazineCargo ["PipeBomb", 100]; will give you 100 satchel charges Example BAF ammo box sqf that you can download from Armaholic (it's not mine - can't remember who did it) -
Making AI aircraft drop flares
PELHAM replied to weedman's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I think it's this: _hely action ["useWeapon", _hely, driver _hely, 0]; too many quote marks. Add flares to the AH64D Weapon Class(1) = CMFlareLauncher Magazine Class(1) = 60Rnd_CMFlareMagazine See if the usual addMagazine / addMagazineTurret works? Not tried it meself. edit - I notice the AH1Z has a 120Rnd_CMFlareMagazine -
Spawn vehicle mid air.
PELHAM replied to fadly1979's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Can you actually create a piloted / crewed vehicle with that alone? I put this in an sqf and it doesn't work private ["_mortar2"]; _mortar2 = group player createUnit ["M252_US_EP1", position player, [], 15,"NONE"]; All the examples I have seen use it to create the crew then add them to the vehicle with moveInDriver etc. -
To work correctly with all 3 modes of the Artillery Computer you need this ammo: this addMagazine "8Rnd_81mmHE_M252"; this addMagazine "8Rnd_81mmWP_M252"; You don't need the Artillery Module for the player or AI in the player group - just order them to Fire at Target with your cross hairs or select Fire at Target and click on the map. (works in Arma2 OA 1.54 and above) The illum does not work ATM - there are no effects in the ammo config. I think ACE has some but don't know for sure? The best way of changing all the ammo to WP is this: this setVehicleAmmo 0.0; this addMagazine "8Rnd_81mmWP_M252"; or for multiple magazines: this setVehicleAmmo 0.0; {this addmagazine "8Rnd_81mmWP_M252"} forEach [1,2,3,4]; (code provided by Muzzleflash) When the mortar spawns there will be a short delay before the WP magazine loads as the default HE ammo is deleted. I am trying to find a way to get the magazine preloaded. I am not 100% sure about multiplayer but this works in a radio trigger when I host Domination on a LAN. Spawns a mortar 10m from the player with extra ammo: _mortar1 = createVehicle ["M252_US_EP1", position player, [], 10, "NONE"]; {_mortar1 addmagazine "8Rnd_81mmHE_M252"} forEach [1,2,3,4];