Author: Jakerod
Author Website:

Requirements: No addons required

Version: 1.2

Short description: The script places men inside houses at windows, doors, and on rooftops and balconies.

Date: 2011-09-21 19:05


Comments: (4)
Rating:



 







Garrison House Area Script

by
Jakerod


Description:
The script places men inside houses at windows, doors, and on rooftops and balconies. The men can have a probability of presence. It presently only works for buildings on Takistan, Shapur, Desert, Zargabad, and some on Proving Grounds.

The script detects the houses within the given radius and finds the ones that are located in the library. The script then reads several pieces of data including the minimum and maximum skill that were entered and the percentage of positions that are filled. Each position has an array of one of five types attached to it; rifleman, anti-tank, machinegun, anti-tank/machinegun, and sniper. These arrays are located in the "Faction Unit Library". The script takes a random unit from the Unit Array and selects him for the given position and then, if a position probability of less than 1 was selected determines if the unit should be created. If the unit is created then he will be created at the Spawn Marker ("marker_name_2") and teleported into his position in the house. The units for each group are told to not leave the house and attack and to stop where they are. This prevents them from leaving the building in most situations. The only time I have observed them leaving is if they are under a lot of fire or if they run out of ammo. They will fire at targets.


Installation / Usage:
Best results if script is run at the beginning of the mission.

How It Works
Requires 2 Markers (1 that is used as a center around which men will appear in buildings and another for where the men should spawn).
At least 1 Unit of the Side that you are creating or a Side Center

There are 7 different inputs needed when running the script:
garrison_01 = ["marker_name",radius,#,%_of_positions,min_skill,max_skill,faction#,"marker_name_2"
,window#,door#,roof#,balcony#] execVM "spawn_group_v5.sqf";
"marker_name" - the marker around which you want the placement to be centered.
radius - the radius around the marker that you want buildings to be occupied in.
%_of_buildings - the percentage of buildings that you want to have occupied. .1 = 10%: .5 = 50%. Any number 0 - 1 should work.***New/Fixed v1.2
%_of_positions - the percentage of positions that you want to have occupied. .1 = 10%: .5 = 50%. Any number 0 - 1 should work.
min_skill - the minimum amount of skill for the units.
max_skill - the maximum amount of skill for the units.
faction# - the number for the faction that you want created (Found Below).
"marker_name_2" - defines where the units spawn before they are placed into the buildings.
window# - defines whether units spawn in windows (0 = Off/No; 1 = On/Yes)
door# - defines whether units spawn in doors (0 = Off/No; 1 = On/Yes)
roof# - defines whether units spawn on the roof (0 = Off/No; 1 = On/Yes)
balcony# - defines whether units spawn on balconies (0 = Off/No; 1 = On/Yes)

Faction Numbers:
0 - Takistan Militia
1 - Takistan Army
2 - Takistan Militia and Takistan Army
3 - Takistan Locals
4 - Takistan Miltia and Takistan Locals (Allied)
5 - US Army
6 - UK Army
7 - CDF
8 - Chedaki (Insurgents)
9 - NAPA (Guerillas)
10 - Russian Army
11 - US Marines
12 - Czech Army
13 - United Nations (UNO)
14 - PMC
15 - UK Army Desert
16 - UK Army Green


Quick start:
1.) Place Trigger
2.) Set to Radio Alpha
3.) In On Activation Line type: garrison_test = ["mkr2",100,1,1,1,1,1,"squad1"] execVM "spawn_group_v4.sqf";
4.) Close Trigger
5.) Place Marker
6.) Name mkr2
7.) Place 2nd Marker
8.) Name squad1
9.) Place OPFOR unit on map
10.) Place Player Unit (Must be group leader for this example)
11.) Save Map
12.) Paste Code from Pastebin into notepad file.
13.) Save as "spawn_group_v4.sqf" (with quotes) and select All Files
14.) Put above script file into mission folder
15.) Go Back into Editor
16.) Hit Preview
17.) Hit 0 - 0 - 1
18.) Men should be created and placed into building.


Limitations:
There is a small amount of down time when the script is called where the men are created and placed in position.
The more men you want the longer it will take for the script to place them.
The Airport Control Tower is not present in the present version due to an issue I am having figuring out positions for it.
May cause lag, depending on unit count, if used during mission.
MP effects unknown.
Group Limit Applies
Guys presently look off in random directions.


Media:



Future plans:
Men will hopefully face the right direction.
Trigger Area and/or Marker Area based instead of Radius based.
Cleaner Code, easier customization.
Chernarus, Utes, and Proving Ground Buildings


Changelog:
v1.2
- Added the ability to pick a percentage of buildings that will be occupied. See original post.


Forum topic:
- BI forums




Enable javascript to be able to download from Armaholic please!



Tags: No tags