Forum Jump :

Author Message


Posts: 176
Rank:


Level: Member

Country: pl
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2014-09-29 15:46        
     
Hello.
I just made a little building garrison script that i would like to share.
I know there is few garrison scripts for ArmA3 but none of them works like i want.

The point of that script is, that you can populate area by placing one group in editor :)
Also it can be use to populate village with civilians.

Tested on non-standard maps and it looks it work.

[TOG] Garrison Scripts is simple and quick in use.
    Just copy tog_garrison_scrip.sqf to your mission folder.
    Place group of units near some buildings
    In group leader init place:
    nul = [this] execVM "tog_garrison_script.sqf";

Bam, units of this group are now in buildings and on rooftops.
If there are more units in group that positions in buildings, rest of them will be split on groups and start random patrol nearby.

Mission Makers can also pass few arguments to script if they want to customize few options.
What you can customize?:
    Radius for building search (default: 100)
    Max units from group that can be garrisoned (default all group) - if less then units in group - others will start patrol
    Max units in patrol (default: 3)
    Show/Hide info about script (default: true)

Extended usage:
 nul = [unit,radius,max units to garrison, max units per patrol,info] execVM "tog_garrison_script.sqf";
Example:
 nul = [this,80,5,4,true] execVM "tog_garrison_script.sqf";

Above example will search buildings in radius 80 from group leader. Place 5 units in random buildings and rest of group will be splitted for 4 man patrols walking nearby.

Have fun :)

DOWNLOAD:
ARMAHOLIC page

This post was edited by bp.sushi (2014-09-30 21:13, ago)


Author Message


Posts: 4
Rank:


Level: Member

Country: iq
Location:
Occupation:
Age: 20
In-game name:

 
#2 Posted at 2014-09-29 17:10        
     
vary helpful >>

thanks


Advertisement


Author Message


Posts: 20277
Rank:


Level: Super Admin

Country: nl
Location: The Netherlands
Occupation:
Age: 41
In-game name: Foxhound

 
#3 Posted at 2014-09-29 21:21        
     
Thanks for another great script :-)
News is up on the frontpage and you can find our mirror here:



Visit my family webshop desteigerhoutshop.nl.

Author Message


Posts: 176
Rank:


Level: Member

Country: pl
Location:
Occupation:
Age:
In-game name:

 
#4 Posted at 2014-09-29 22:20        
     
Thanks for publishing Foxhound!


Author Message


Posts: 14
Rank:


Level: Member

Country: fr
Location:
Occupation: Doing stuff !
Age: 29
In-game name: mckeewa

 
#5 Posted at 2014-09-30 02:53        
     
Hi, your script is really amazing.

I encoutered some things will trying it.

The init executed was :
nul = [this,200,30,2,true] execVM "garrison.sqf";

Working really fine in Agia Marina, but...



I think it comes from Cargo posts


===

Secondly, the script works in Zeus in local (editor), but not at all while on DedicatedServer in admin mode. That is not surprising.

Do you think there is a way to make it work for Zeus dedicated server ? That would be so amazingly timesaver and awesome.

Anyway, great script.


Author Message


Posts: 176
Rank:


Level: Member

Country: pl
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2014-09-30 08:13        
     
Im not experienced in using Zeus. Actualy i never used it, and i have no idea how to make scripts zeus-compatible.

But feel free do customize it for yourself :) If someone have experience with scripts for Zeus please, come out from the darkness :)


Author Message


Posts: 8
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2014-09-30 17:49        
     
really nice and easy scripted. just one question is there a way to debug it where you can see all the AI on the map so you can tell which buildings they are in?


Author Message


Posts: 176
Rank:


Level: Member

Country: pl
Location:
Occupation:
Age:
In-game name:

 
#8 Posted at 2014-09-30 19:38        
     
Debug is not included. If you want create markers paste it after line 116 (after _x setUnitPos "UP")

////INFO////
	if (_info) then {
		_mrkName = format ["mrk%1",_garrisonNum];
		_marker = createMarker [_mrkName, getPos _x ];
		_mrkName setMarkerType "mil_dot";
	};

This post was edited by bp.sushi (2014-09-30 19:52, ago)


Author Message


Posts: 8
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#9 Posted at 2014-09-30 20:33        
     
thank you that worked nicely

Just one more question is there away i can use the debug in a class Param in my description.ext so i can turn it on and off when i need to?

Added 23 minutes later:

i got the class Param to work :)

This post was edited by hellstorm77 (2014-09-30 20:57, ago)


Author Message


Posts: 176
Rank:


Level: Member

Country: pl
Location:
Occupation:
Age:
In-game name:

 
#10 Posted at 2014-09-30 21:07        
     
Nice :) can you paste example?


Author Message


Posts: 8
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#11 Posted at 2014-09-30 21:17        
     
in my init.sqf
for [ {_i = 0}, {_i < count(paramsArray)}, {_i = _i + 1} ] do
{
	call compile format
	[
		"PARAMS_%1 = %2",
		(configName ((missionConfigFile >> "Params") select _i)),
		(paramsArray select _i)
	];
};	

in my description.ext
class Params
{
	class Debug
	{
		title = "Enable Debug Mode";
		values[] = {1,0};
		texts[] = {"Enable","Disable"};
		default = 1;
	};
};

in the garrison script
if (PARAMS_Debug == 1) then {
	if (_info) then {
		_mrkName = format ["mrk%1",_garrisonNum];
		_marker = createMarker [_mrkName, getPos _x ];
		_mrkName setMarkerType "mil_dot";
	};
};

Added 18 minutes later:

if your thinking of adding to your scripts you could do it this way

if (Debug_tog > 0) then {
	if (_info) then {
		_mrkName = format ["mrk%1",_garrisonNum];
		_marker = createMarker [_mrkName, getPos _x ];
		_mrkName setMarkerType "mil_dot";
	};
};

add this to the first line of your scripts
Debug_tog = 0;

and you can change the 0 to 1 to turn debug on in your script

This post was edited by hellstorm77 (2014-09-30 21:37, ago)


Author Message


Posts: 176
Rank:


Level: Member

Country: pl
Location:
Occupation:
Age:
In-game name:

 
#12 Posted at 2014-09-30 22:29        
     
in script is also _debug variable on the begining. You can use it (it false as default, i was using it to test script)

But your example with params is very nice. Thanks! It will be helpfull :)

EDIT:
One more qiestion. Is Params finally works for pbo missions?

This post was edited by bp.sushi (2014-09-30 22:41, ago)


Author Message


Posts: 8
Rank:


Level: Member

Country: uk
Location:
Occupation:
Age:
In-game name:

 
#13 Posted at 2014-09-30 22:53        
     
i haven't tried it but it usually works for Params when i have made event mission for my community