Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

wokstation

Member
  • Content Count

    87
  • Joined

  • Last visited

  • Medals

Everything posted by wokstation

  1. The conflict rages on to the south and command have noticed that OPFOR aren't paying full attention to the airfield at Krasnostav. Time's perfect for a light hit-and-run strike by a small group of fireteams. That'd be you, then. Dependancies: None - pure vanilla. Duration: Approx 30mins. Difficulty: Well, I died lots while testing it. Make of that what you will... Support: None - the deployed fireteams are all that's available for this operation, but pay attention to the equipment screen in the briefing, there may be some nice toys to play with! Download .zip file here.
  2. Finally made one I thought I'd share (been writing a few "stock" scripts and once I've polished them a bit I'll chuck them out too). (Updated already: Made it slightly more accurate) What it does: Spawns a helicopter which then flies to the designated location and para-drops the selected crate within about 100m of the location, before flying off again and being removed. Uses no globals, has no dependancies except it requires the Functions module be present. It'll pick an appropriate helicopter and correctly-teamed crew depending on the side of the player (if the player's EAST, it'll spawn EAST stuff. WEST, it'll spawn WEST, anything else, it spawns civillians - so if you're playing GUER, you'll need to make sure there's at least one civvie on the map). How to use it: Call the script somehow, eg, via a radio trigger or at a set point in a mission, giving the target location and selecting a box: nul = [getpos player, 1] execVm "supplyDrop.sqf"; Replace "1" with one of the following numbers to get that box: 0 = Basic ammo 1 = Basic weapons 2 = Launchers 3 = Ordnance 4 = Special 5 = Vehicle 6 = Local Ammo 7 = Local Weapons 8 = Random. So the above example would make the helicopter bring a US Basic Weapons box to the player's location if the player is WEST, a RU Basic Weapons for EAST and Local for anyone else. It also calls the Garbage Module at the end, but if it's not present it doesn't seem to break anything, so it's not required per-say. Anyway, the script: supplydrop.sqf /* Resupply drop script by Wokstation / esd. ========================================= nul = [DropPosition, BoxSelection] execvm "resupplyDrop.sqf"; DropPosition: Location to drop supplies. Supplies will be delivered to within approximately 120m of that location. BoxSelection: The supply to drop, from the list below. 0 = Basic ammo 1 = Basic weapons 2 = Launchers 3 = Ordnance 4 = Special 5 = Vehicle 6 = Local Ammo 7 = Local Weapons 8 = Random. */ _DropPos = _this select 0; _choice1 = _this select 1; _tSide = side player; // *** This alters the side that spawns. Can be adjusted here. _spawnDistance = 2500; // *** How far in meters the helicopter will spawn from the drop location. _alt1 = 100; // *** Flight altitude. _CargoSpotA = [_dropPos select 0, _dropPos select 1, _alt1]; // *** Altitude-adjusted destination. if ((_choice1 < 0) or (_choice1 > 7)) then {_choice1 = floor random 8}; // *** Verify number in bounds and if not, assign random. // *** Ammo box arrays: _bluchoicesA1 = ["USBasicAmmunitionBox", "USBasicWeaponsBox", "USLaunchersBox", "USOrdnanceBox", "USSpecialWeaponsBox", "USVehicleBox", "LocalBasicAmmunitionBox", "LocalBasicWeaponsBox"]; _indchoicesA1 = ["LocalBasicAmmunitionBox", "LocalBasicWeaponsBox", "USLaunchersBox", "USOrdnanceBox", "SpecialWeaponsBox", "USVehicleBox", "LocalBasicAmmunitionBox", "LocalBasicWeaponsBox"]; _OpfChoicesA1 = ["RUBasicAmmunitionBox", "RUBasicWeaponsBox", "RULaunchersBox", "RUOrdnanceBox", "RUSpecialWeaponsBox", "RUVehicleBox", "LocalBasicAmmunitionBox", "LocalBasicWeaponsBox"]; // ****** Default choices: _c2D = _indchoicesA1 select _choice1; // *** The ammo box to spawn _vehc1 = "Mi17_Civilian"; // *** Default helicopter _ChuteT = "ParachuteMediumWest"; // *** Default parachute // ****** East choices: if (_tSide == east) then { _c2d = _opfChoicesA1 select _choice1; _vehc1 = "Mi17_rockets_RU"; _ChuteT = "ParachuteMediumEast"; }; // ****** West choices: if (_tSide == west) then { _c2d = _bluChoicesA1 select _choice1; _vehc1 = "MH60S"; }; // ****** Create helicopter: _rOrig = _DropPos; _rDir = random 360; _rDir2 = _rDir + 180; if (_rDir2 > 360) then {_rDir2 = _rDir2 - 360}; _rPos = [(_rOrig select 0)+(sin _rDir)*_spawnDistance,(_rOrig select 1)+(cos _rDir)*_spawnDistance, _alt1]; _DropDest = [(_rOrig select 0)+(sin _rDir2)*100,(_rOrig select 1)+(cos _rDir)*100, _alt1]; // Destination, just beyond player. _HeliCrew = creategroup _tSide; _HeliP = creategroup _tside; _Huey = ([_rpos, _rDir2, _vehc1, _HeliCrew] call BIS_fnc_spawnVehicle) select 0; _Huey setvehiclevarname "_Huey"; // ****** Split the pilot from the gunners, to allow the gunners to fire on targets of opportunity _tGuy = driver _Huey; [_tguy] join _HeliP; _HeliP setCombatMode "blue"; _HeliP setBehaviour "careless"; _HeliCrew setCombatMode "red"; _HeliCrew setBehaviour "combat"; // ****** Give orders and wait for heli to approach dropzone _tGuy doMove _CargoSpotA; _Huey flyInHeight _alt1; _vv1 = 0; while {(_vv1 == 0)} do { sleep random 1; if ((_Huey distance _CargoSpotA) < 250) then {_vv1 = 2}; if ((fuel _Huey) < 0.2 ) then {_vv1 = 1}; if !(isengineon _Huey) then {_vv1 = 1}; if ((!alive _tguy)) then {_vv1 = 1}; if !(_tguy in _Huey) then {_vv1 = 1}; if (!alive _Huey) then {_vv1 = 1}; }; // ****** Give orders to reduce altitude and wait for arrival at dropzone _tGuy doMove _dropDest; _Huey flyInHeight 50; _vv1 = 0; while {(_vv1 == 0)} do { sleep random 1; if ((_Huey distance _dropDest) < 100) then {_vv1 = 2}; if ((fuel _Huey) < 0.2 ) then {_vv1 = 1}; if !(isengineon _Huey) then {_vv1 = 1}; if ((!alive _tguy)) then {_vv1 = 1}; if !(_tguy in _Huey) then {_vv1 = 1}; if (!alive _Huey) then {_vv1 = 1}; }; // ****** release parachute: if (_vv1 == 2) then { _DropPos = getpos _Huey; _Chute1 = _ChuteT createvehicle _DropPos; _Cargo1 = _C2D createVehicle _dropPos; _Cargo1 attachTo [_chute1, [0,0,0]]; _chute1 setpos _dropPos; _tGuy doMove _rpos; _Huey flyInHeight _alt1; // ****** Wait for parachute to land and then reset cargo position. waituntil {!alive _chute1}; detach _Cargo1; _Cargo1 setpos [getpos _cargo1 select 0, getpos _cargo1 select 1, 0]; "SmokeShellGreen" createVehicle (getpos _Cargo1); }; // Wait for helicopter to return to spawn, and tidy. _vv1 = 0; while {(_vv1 == 0)} do { sleep random 2; if ((_Huey distance _rpos) < 200) then {_vv1 = 2}; if ((fuel _Huey) < 0.2 ) then {_vv1 = 1}; if !(isengineon _Huey) then {_vv1 = 1}; if ((!alive _tguy)) then {_vv1 = 1}; if !(_tguy in _Huey) then {_vv1 = 1}; if (!alive _Huey) then {_vv1 = 1}; }; _huey setdamage 1; [_Huey] call BIS_GC_trashItFunc; [_tguy] call BIS_GC_trashItFunc; { [_x] call BIS_GC_trashItFunc; } foreach units _HeliCrew; (Or if you're lazy, download it instead of copy/pasting). Example mission (by request) here. It's heavily commented, so if anyone wants to take it to pieces to use chunks, or re-write it, whatever, feel free. I hope someone finds it useful, anyway... (At the end where I re-position the cargo-box when the 'chute is destroyed, I've been thinking about replacing it so instead of getting it's own position and just setting the Z to 0, it gets the 'chute's Z and gives that to the crate, in case it lands on a building. Would this work properly? The parachute is dead at that point...)
  3. Couldn't see a getPosASL command in your code - it seems to take exception to whatever you've put in there.
  4. wokstation

    Forced landing script help

    Oh I'm not bothered about credit, I'm gratified enough seeing it used. I assume you're using an object created in the editor? Is there a reason (ie, to allow it to die and become unavailable) you're not using the spawnVehicle function?
  5. Not sure about switch, not done much with it, but I can see what's up with the IF statement: if (_ffe = true) Comparisons in IF statements use two equals signs, so (_ffe == true) would be right - except ArmA doesn't seem to like truisms. _ffe contains true/false, so you're asking if true equals true, perfectly valid except not in ArmA it seems. Instead just use the bool condition: if (_ffe) ArmA will then read that as "if TRUE" or "if FALSE" and act accordingly. Might even fix your switch issue.
  6. wokstation

    Forced landing script help

    Going by some of the parameter names I think he may be adapting one of my landing scripts - in which case the purpose is to separate the pilot from the gunnery crew so the pilot can remain careless/mode-green (so will fly and land regardless of fire) and the gunners still get to fire on targets of opportunity, so defending the helicopter. It's the method I use when creating a vehicle with the BIS functions.
  7. wokstation

    Helo Landing

    Give the soldiers a waypoint right next to the invisible helipad, of type "get out", and synchronise it with the helicopter's "transport unload" waypoint (make sure that transport unload waypoint is attached to the helipad for accurate landing).
  8. Then just adapt the script I've given you to cover the civilians in the area too - when it removes combatMode "blue" from the soldiers, make it also setCaptive FALSE on the civvies. It'd take you thirty seconds.
  9. _grp1 = _this select 0; _grp1 setcombatmode "blue"; _cnt1 = 0; while {_cnt1 == 0} do { { if ((damage _x) > 0) then {_cnt1 = 1}; } foreach units _grp1; sleep 0.2; }; _grp1 setcombatmode "yellow"; Off the top of my head, that'll make the group passed to the script hold fire utterly until one of them gets hurt, then they get to fire back.
  10. How are you creating the unit and when are you giving it the waypoints? If you're using createUnit, the wiki reckons you need to give it the join command to join it to the group you spawned it to before it'll accept any orders. Also if they're already doing an order, they don't seem to go for the waypoints - giving them a doMove to their current position seems to clear their current orders and make them return to waypoints/formation. There's also no move waypoint there. And are you adding this in an onActivation field in a trigger or something? And what's CASUnit? Is that a unit, or a group? Going by the variable name, I'm guessing it's a unit... in which case, the commands won't work. Try this: way1 = (group CASunit) addWaypoint [position player, 0]; way1 setWaypointType "MOVE"; way1 setWaypointBehaviour "aware"; way1 setWaypointCombatMode "yellow"; way1 setWaypointDescription "CAS Mission position."; way1 setWaypointSpeed "FULL"; way2 = (group CASunit) addWaypoint [position player, 0]; way2 setWaypointBehaviour "COMBAT"; way2 setWaypointCombatMode "RED"; way2 setWaypointDescription "CAS Mission position."; way2 setWaypointFormation "ECH LEFT"; way2 setWaypointSpeed "FULL"; way2 setWaypointType "SAD"; That tells them to go to the SAD area, then to do the SAD. If they still don't move, add this to the end: {_x doMove (getpos _x)} foreach units group CASunit;
  11. setCombatMode "Blue" springs to mind...
  12. wokstation

    Helo Landing

    unAssignVehicle just tells them that vehicle spot isn't theirs anymore. It doesn't tell them it's time to get out. You want doGetOut or commandGetOut for that.
  13. I believe there are similar for the other modules, but I don't know what they are. I tend to not run any commands on them until a few seconds into the mission to make sure they're running...
  14. wokstation

    Parachute Ammo Box

    There's several: http://community.bistudio.com/wiki/ArmA_2:_CfgVehicles#Air_Class_Vehicles
  15. It may be the marker that's the problem then - you need some other target...?
  16. Two things: initintro.sqf gets ran automatically at the start of the intro, in exactly the same way as init.sqf does for the mission. No more having to call your init from a unit on the map ;) The other is if that doesn't sort it and you still get a moment of player-cam, would fading-from-black help?
  17. Reference all the players in an array, and then check the object found against the array? eg... _myobject = nearestObject [objectname, "Man"]; if (_myobject in MyBigArrayOfPlayers) then { // Pop your codey stuff here };
  18. No, you're right. Do gunner instead, silly me :)
  19. T1 selectWeapon "D81"; (driver T1) selectweapon "D81"; (driver T1) lookAt (getMarkerPos Marker1); (driver T1) doTarget (getMarkerPos Marker1); Sleep 1.5; T1 fire "D81"; ?
  20. wokstation

    Acm editing

    You're not referencing your ACM. You said your ACM is called ACM_BIS, so that (and the rest of them) should read... [0.9, 1, ACM_BIS] call BIS_ACM_setAmmoFunc I'm betting if you put hint "bingbong"; at the end of your init, it won't hint when you start the level because the init file is waiting for a condition that'll never come true - for "BIS_ACM" to be !isNul. *eta: I've got a few ACMs dotted around on a map and needed to initialise them all the same at the same time, here's the code it uses: nul = [NameOfACM] execVm "esdInitAcm.sqf"; _the1 = _this; waitUntil {!isNil {_the1 getVariable "initDone"}}; waitUntil {_the1 getVariable "initDone"}; sleep 10; [1, _the1] call BIS_ACM_setIntensityFunc; [0, 0.4, _the1] call BIS_ACM_setSkillFunc; ["air_patrol", 1, _the1] call BIS_ACM_setTypeChanceFunc; ["ground_patrol", 0.5, _the1] call BIS_ACM_setTypeChanceFunc; [["USMC", "RU"], _the1] call BIS_ACM_setFactionsFunc; [_the1, 400, 800] call BIS_ACM_setSpawnDistanceFunc;
  21. *updated already - now allows you to add new taxi-ranks (bases) after the air-taxis have been initialised* *Known potential issue: if you reinitialise while a pilot is dead, he'll come back again once the respawn timer is up, meaning there'll be two pilots stood at one base. Won't cause anything nasty...* Seems those sneaky civvies have been taking advantage of the fact that no-one shoots at them and have started up their own air-taxi operation. Now you too can have access to their safe way of getting around with my new stock-script, Civilian Air Taxis! Download it and an example mission here. It adds a civilian helicopter-taxi-rank at your chosen places, just approach the pilot, pick your destination and you along with any of your squad within 100m of you will be treated to a really-short (14secs, ish) cut-scene of your flight before setting you at your destination. It also works out roughly how long the trip should have taken (at 120kph, plus a few minutes for pre-flight checks, loading and flying around tall things) and forwards time the right amount. "Accidentally" killed the pilot? Don't worry, you can still transport to that location, just not from... ...well, not until WokAir get around to sending a replacement, which could be up to 5mins (change esdAirTaxiDeadCD to change the delay), anyway. Quote from the readme and init file:
  22. It's been given a chance to wake up. Make sure you've got the functions module on the map and pop this at the start of your init.sqf: waituntil {!isnil "bis_fnc_init"}; waituntil {!isnil "BIS_MPF_InitDone"}; That'll make it load before it loads the rest of the mission.
  23. I use this: [_obj, -90, 0] call bis_fnc_setpitchbank; It requires the functions module be on the map and initialised.
  24. wokstation

    Setside for Vehicles

    There's no OPFOR equivalent to the C13, either.
  25. On the roof? Just put the unit over the building in the editor... spawning them by code you'd need the height of the roof to spawn them onto I think. Many buildings have set positions though (when you're in command of another unit, press space and look at a building, it'll come up "position #1" etc on some). First thing you need is the building's ID number - open the editor, click IDs and zoom in on the building. Make a note of the number on it. For this example I'll assume it's 123456 and you're trying to put the unit in building position #2. Place a unit next to the building, and in the unit's init code put the following: this setpos (((getpos this) nearestobject 123456) buildingpos 1); Done. If you want to add them to the building later, by script, you need to define the building. Put an object next to the building (a Logic, a unit, whatever) and in it's init put: TheBuilding1 = nearestObject [getpos this, 123456]; (or, if you created the object by script, it'd be TheBuilding1 = nearestObject [getpos YourNewObject, 123456]; instead). Then just setPos the unit: YourUnit setpos (TheBuilding1 buildingpos 1);
×