Gudsawn 93 Posted July 8, 2014 (edited) Rooftop Static Weapons Script (overly long demonstration video)What it IsAs the name suggests, this script will take a given area (defined by a marker) and spawn static weapons (such as DShKMs or KORDs) on rooftops. Taking inspiration from Insurgency for Arma 2, rooftop static weapons add much more variation to battles and make jobs harder for both infantry and air support.This script was originally made for a private mission, but I thought other mission makers may also find this useful.How it WorksWhen called, the script will first scan a given area for enterable buildings. Positions within each building will then be identified. Since there is no command for finding rooftops, this has to be done manually by checking for obstructions above each position and deciding whether or not it is a rooftop. A final check is then performed to ensure that there is enough room for the static weapon to spawn and that the rooftop position is not obstructed by any nearby walls or other solid objects that may prevent the weapon from manoeuvring properly.How to Use1. Within your mission, create an ellipse marker (this will define the area that you wish to place static weapons) and give it a name (e.g. "m1").2. Place down a "Game Logic" unit and put the following in the unit's init field: ["m1", 1, 5, false, "CAF_AG_ME_T_RPK74", east] call gdsn_fnc_spawnRooftopStaticWeapons; Parameter 1: Name of marker (e.g. "m1").Parameter 2: Type of weapon placement. 1 = Light (Anti-infantry), 2 = Medium (AT), 3 = Heavy (AA).Parameter 3: Number of static weapons to spawn.Parameter 4: Delete marker after use.Parameter 5: Classname of gunner unit.Parameter 5: Side of gunner (east, west, resistance).RequirementsSince Altis/Stratis has no (or barely any) flat rooftops, this script has very little use on the vanilla maps. The example mission provided was created using:@A3MP@RDSThese mods are only required for the example mission. The script will, however, work with any mission (as long as you change the default static weapon classnames in the script). Details are in the readme.DownloadDownload via ArmaholicAny feedback/comments are always welcome. Edited December 23, 2015 by mistergoodson Share this post Link to post Share on other sites
Guest Posted July 8, 2014 Release frontpaged on the Armaholic homepage. Rooftop Static Weapons Script v1.0 ================================================ You are not registered on Armaholic, or at least not that we are aware of. In the future we offer the possibility to authors to maintain their own pages. If you wish to be able to do this as well please register on Armaholic and let me know about it. This is not mandatory at all! Only if you wish to control your own content you are welcome to join, otherwise we will continue to follow your work like we have always done ;) When you have any questions already feel free to PM or email me! Share this post Link to post Share on other sites
Von Quest 1163 Posted July 9, 2014 This is fantastic! Gotta giver her a try. May be a staple script for all missions. Thank You!! Share this post Link to post Share on other sites
SavageCDN 231 Posted July 9, 2014 ^ exactly!! Thanks a lot for releasing this to the masses :o Share this post Link to post Share on other sites
serjames 357 Posted July 11, 2014 GOOD job Goodson. Can you do something similar with bunkers / sandbag emplacements i.e. for Metis launchers or Recoiless at rifles ? Share this post Link to post Share on other sites
phronk 898 Posted July 12, 2014 Any chance you'll allow the script to spawn and despawn units, very similar to BangaBob's 'Enemy Occupation Script'? Having a function or some kind of parameter that makes it work with ALiVE would also be nice. I'm working on two different versions of Takistan Insurgency --- one that uses ALiVE for spawning/despawning, the other uses EOS instead. A great looking script and hope it is doable and worth your time! Share this post Link to post Share on other sites
barbolani 198 Posted July 12, 2014 Hi! Nice work! Just a question, if we omit the y part of the lineintersects we could achieve having this in the normal mil towers? The ones without roof, but space to watch. Share this post Link to post Share on other sites
Gudsawn 93 Posted July 12, 2014 (edited) @Serjames - I'll look into doing something like that. In terms of the rooftop placements, I'm thinking of also including sandbags to provide the gunners with some small defences. @Phronk - I'll probably be getting the script to work with ALiVE's profiler first (since my group uses ALiVE), and then I'll see about creating a custom spawning/despawning function :) @barboiani - The obstruction checkers (lineIntersects) use the map's X and Y axis, so omitting the Y part would not help with identifying mil towers. Unless I have misunderstood you? I think for specific placements of static weapons (e.g. in mil towers), it would be more reliable to use a predetermined list of buildings/towers. I may include this in the future. I'm glad you have all found this script useful for your missions :) Edited July 12, 2014 by Goodson Share this post Link to post Share on other sites
aviatormoser 6 Posted July 21, 2014 (edited) Great script. The script seems to delete my markers in single player, but it doesn't do so for MP on a dedicated server? Have you ever produced this bug? Edit: Oh I see. The script only runs on the server, so only the marker is deleted on the server. That makes sense. Edited July 21, 2014 by AviatorMoser Share this post Link to post Share on other sites
LoupVrt 14 Posted August 18, 2014 Goodson, I would like to spawn statics in several places, do I have to declare several markers in one fame logic (thus how do I seperate each marker name?) or is it best to use several game logics? Share this post Link to post Share on other sites
3lockad3 11 Posted August 19, 2014 (edited) I'm having an issue with the gunner moving into gunner. seems like some spawn in the guns and some out.. Anyone else having this issue ? nm, I'm a retard and some of my class names were wrong to the vehicle pool. Edited August 19, 2014 by 3lockad3 Share this post Link to post Share on other sites
alexsegen 17 Posted October 13, 2014 (edited) Yo, nice script you got there. I tried this and is working fine in the Editor but how do I make it work in dedicated server / Multiplayer session? When I do that, the Static Weapons don't appear on the rooftops but in the ground and the markers don't dissapear. Thanks! Edited October 13, 2014 by AlexSegen Share this post Link to post Share on other sites
dimon 32 Posted November 11, 2014 if (!(_rooftopPos in gdsn_rooftopPositionsUsed) && count (nearestObjects [ _rooftopPos , _type, 10]) == 0) then { gdsn_rooftopPositionsUsed = gdsn_rooftopPositionsUsed + [_rooftopPos]; // Create weapon _staticWeapon = createVehicle [(_type call BIS_fnc_selectRandom), _rooftopPos, [], 0, "NONE"]; _staticWeapon setPosATL _rooftopPos; _staticWeapon setVectorUp [0,0,1]; // Create gunner _crew = getText (configFile >> "CfgVehicles" >> (typeOf _staticWeapon) >> "crew"); if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 0) then {_side = east}; if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 1) then {_side = west}; if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 2) then {_side = guerilla}; if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 3) then {_side = civilian}; _group = createGroup _side; _gunner = _group createUnit [_crew, getPosATL _staticWeapon, [], 0, "NONE"]; _gunner moveInGunner _staticWeapon; Share this post Link to post Share on other sites
Olsen370 11 Posted January 17, 2015 Hello MisterGoodson, thanks for this very useful script. Is there any way to determine the direction the weapons are heading? Share this post Link to post Share on other sites
Hunter10000 10 Posted April 5, 2015 // Create gunner _crew = getText (configFile >> "CfgVehicles" >> (typeOf _staticWeapon) >> "crew"); if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 0) then {_side = east}; if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 1) then {_side = west}; if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 2) then {_side = resistance}; if ((getNumber (configFile >> 'CfgVehicles' >> (typeOf _staticWeapon) >> 'side')) == 3) then {_side = civilian}; _group = createGroup _side; _gunner = _group createUnit [_crew, getPosATL _staticWeapon, [], 0, "NONE"]; _gunner moveInGunner _staticWeapon; Thx for the script! Share this post Link to post Share on other sites
K.Hunter 32 Posted April 7, 2015 (edited) Any chance this works with Arma 2 OA? EDIT: I see the function used in the script is only for Arma 3 so I didn't even try it. But does anyone know of a similar script for A2? Edited April 7, 2015 by K-Hunter Share this post Link to post Share on other sites