Desrat 0 Posted March 14, 2013 (edited) I was looking to populate buildings with enemies and having put this together over the last couple of days thought someone else may get some use from it too. Script counts all available positions in radius, and spawns the units for you. It currently selects 10% of the total available positions at random and makes sure no duplicates (or really close) are spawned. Useage: _h = ["marker_name"(string), Max Distance from center to spawn(number), side (number 1=east, 2=west), Debug Markers(true - optional)] execVM "RndmHse.sqf; Example: _h = ["Target_Area", 100, 1, true] execVM "RndmHse.sqf"; Download Demo Requires CBA_A3 UPDATE V1.1 CBA no longer required DEMO V1.1 DEMO V1.2 - Now works - sorry Edited March 23, 2013 by Desrat typo Share this post Link to post Share on other sites
Guest Posted March 14, 2013 (edited) Release frontpaged on the Armaholic homepage. Random House Garrison Script [ALPHA] v1.0Community Base addons A3 Edited March 14, 2013 by Guest example line should be the same now. Share this post Link to post Share on other sites
Desrat 0 Posted March 14, 2013 (edited) cool, thanks Could I request you edit the example line to match mine above (I had a typo initially) EDIT : Appreciate the speedy edit Foxhound Edited March 14, 2013 by Desrat Share this post Link to post Share on other sites
HazJ 1289 Posted March 14, 2013 Does this script require CBA on the server or just client ? Also, would be nice if you could make a vanilla ver of this too! :) Share this post Link to post Share on other sites
Desrat 0 Posted March 14, 2013 (edited) server only.., uses 3 functions from CBA - if you can find me a suitable alternative I'll happily do a vanilla version Functions are: CBA_fnc_getNearestBuilding, CBA_fnc_createMarker, and CBA_fnc_shuffle Although marker one is just because it's easier, I could replace that easy enough. Edited March 15, 2013 by Desrat Share this post Link to post Share on other sites
vIP3r_75 1 Posted March 16, 2013 (edited) server only.., uses 3 functions from CBA - if you can find me a suitable alternative I'll happily do a vanilla versionFunctions are: CBA_fnc_getNearestBuilding, CBA_fnc_createMarker, and CBA_fnc_shuffle Although marker one is just because it's easier, I could replace that easy enough. Hi there, First of all thaks a lot for this script, i was placing unit inside buildings by using the code below in the init field of a unit: this setPosATL [2038.46,2704.55,4.13975]; and i was using this script in the init.sqf in order to get the right coords (x,y,z): while {true} do { copyToClipboard str getposATL player; hint str getposATL player; sleep 0.2; }; Secondly, back to your topic, it's very easy to get your script working on the VANILLA version.. CBA_fnc_getNearestBuilding private ["_building", "_i"]; _building = nearestBuilding _this; _i = 0; while {str(_building buildingPos _i) != str([0,0,0])} do { _i = _i + 1; }; [_building, _i] In order to replace CBA_fnc_shuffle you can use something like the following: _allItems = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]; _selectedItems = []; _howManyToSelect = 20; while {_howManyToSelect != 0} do { _add = _allItems select (floor(random(count _allItems))); if (!(_add in _selectedItems)) then { _selectedItems = selectedItems + [_add]; _howManyToSelect = howManyToSelect - 1; }; }; Let me know if you need any help! CYA Edited March 16, 2013 by vIP3r_75 Share this post Link to post Share on other sites
lee1hy 1 Posted March 16, 2013 Is there sample mission without CBA? not require addon Share this post Link to post Share on other sites
ghostnineone 10 Posted March 16, 2013 The example mission doesn't seem to be working for me. I just load it into the editor and make spawn in as player and no one spawns. Does the example line still go in a trigger like in a2? Share this post Link to post Share on other sites
Desrat 0 Posted March 16, 2013 I'll do a quick vanilla version when I get home later, thx. As for the demo not working only thing I can suggested is that you don't have CBA running. Share this post Link to post Share on other sites
ghostnineone 10 Posted March 16, 2013 It's running, unless there was an update to CBA I don't know about. Share this post Link to post Share on other sites
Desrat 0 Posted March 16, 2013 The demo should just be copied to your mpmissions folder (after extraction of course ) the script is called from the init.sqf file. ---------- Post added at 22:56 ---------- Previous post was at 22:03 ---------- Vanilla version 1.1 available - see 1st post Share this post Link to post Share on other sites
Guest Posted March 17, 2013 Addon free version frontpaged on the Armaholic homepage. Random House Garrison Script [ALPHA] v1.1 Share this post Link to post Share on other sites
lee1hy 1 Posted March 17, 2013 Addon free version frontpaged on the Armaholic homepage. http://www.armaholic.com/datas/users/news_download_a3_3.pngRandom House Garrison Script [ALPHA] v1.1 Thank you !!! Share this post Link to post Share on other sites
Desrat 0 Posted March 17, 2013 Addon free version frontpaged on the Armaholic homepage Appreciated, thanks Share this post Link to post Share on other sites
Psilocybe 3 Posted March 18, 2013 Is there any way to have the soldiers within set to 'dismissed' or safe? I have a mission where you have to blow up a barracks full of enemy who are relaxed after they have returned from a successful mission. Share this post Link to post Share on other sites
Desrat 0 Posted March 18, 2013 Is there any way to have the soldiers within set to 'dismissed' or safe? I have a mission where you have to blow up a barracks full of enemy who are relaxed after they have returned from a successful mission. open the RndmHse.sqf file and go right to the bottom and find this line (it's like the 5th line from the end of the file) _spawnUnit setPos _spawnPos; after it add this _grp setBehaviour "SAFE"; Share this post Link to post Share on other sites
lee1hy 1 Posted March 19, 2013 (edited) 1. the position of the enemy dot appears in the map. any possible disable?? 2. too many AI respwaned on docks beach, any possible reduce AIs? Edited March 19, 2013 by lee1hy Share this post Link to post Share on other sites
lee1hy 1 Posted March 20, 2013 Sorry double post but please check my post !!! Share this post Link to post Share on other sites
Desrat 0 Posted March 20, 2013 1. the position of the enemy dot appears in the map. any possible disable?? Already explained in the documentation -- _h = ["marker_name"(string), Max Distance from center to spawn(number), side (number 1=east, 2=west), [b][color=#ff0000]Debug Markers(true - optional)[/color][/b]] execVM "RndmHse.sqf; so change the 3rd parameter to false or omit completely. e.g [color=#333333]_h = ["Target_Area", 100, 1, false] execVM "RndmHse.sqf";[/color] 2. too many AI respwaned on docks beach, any possible reduce AIs? Spawning is random but obviously locations with more positions are statistically more likely to be populated. You could increase the distance check but this could prevent units spawning on multiple levels within the same building, anyway change the following section // returns true/false if another unit within 2mif (_side == 1) then { _skip = {side _x == east} count nearestObjects [_spawnPos,["Man","Car","Tank"],2] > 0; } else { _skip = {side _x == west} count nearestObjects [_spawnPos,["Man","Car","Tank"],2] > 0; }; the number 2 (near the end of lines 2 and 4) represents the minimum distance between units - increase the value till you get the result your looking for. Share this post Link to post Share on other sites
Desrat 0 Posted March 22, 2013 new version - 1.2 (see 1st thread) Increased distance between spawned units. Some units will now patrol their building instead of remaining static. Share this post Link to post Share on other sites
lordprimate 159 Posted March 22, 2013 IT seem the link for version 1.2 is broken. thanks in advance Share this post Link to post Share on other sites
Desrat 0 Posted March 23, 2013 IT seem the link for version 1.2 is broken. thanks in advance Fixed - sorry. Share this post Link to post Share on other sites
lee1hy 1 Posted March 23, 2013 i made simple urban combat map, classic skimish style this map name is "HARDCORE INFAN" http://pds21.egloos.com/pds/201303/23/61/HARDCOREINFAN.Stratis.zip anti-team kill in respwan_west anti-demolition in respwan_west TK punishiment with respwan_without gear NAME on map VAS ammo system Random House Garrison Script - v1.0 light in house for night by tpw First aid by DAP Based on F3 Share this post Link to post Share on other sites
Guest Posted March 23, 2013 Updated version frontpaged on the Armaholic homepage. Random House Garrison Script [ALPHA] v1.2 Share this post Link to post Share on other sites