Jump to content
Sign in to follow this  
Desrat

Random House Garrison Script

Recommended Posts

ai only walking in beach just a little, they do not partol inside the building and in the street of village

Share this post


Link to post
Share on other sites
ai only walking in beach just a little, they do not partol inside the building and in the street of village

They're not meant to, occasionally a unit will patrol it's "current" building, that is normal behavior. However it seems some of the buildings near the pier do not include interiors hence why they patrol around the front.

Share this post


Link to post
Share on other sites

When area is set to include a dock, all dock positions get filled. Try using this script at the airfield near the dock.

Share this post


Link to post
Share on other sites

Can´t get it work with the current DEV-build. Is this a problem on my end or is this script not compatible to the DEV-builds?

EDIT: Forget the above. I had a ":" instead of ";" within my init.sqf :mad:

It works fine with the latest DEV-build.

Edited by Dr_Cox1911

Share this post


Link to post
Share on other sites
It works fine with the latest DEV-build.

Good to know thx..

Share this post


Link to post
Share on other sites

It doesn't seem to work for buildings placed in the editor. Any suggestions on what to modify in order for them to be recognized by the script as well?

Share this post


Link to post
Share on other sites

EDIT: It seems that a "house" created by the map (BIS) and a "house" placed by the editor are two different animals. A pre-existing "house" can be addressed by the "nearestBuilding" cmd but one placed in the editor can not.

Share this post


Link to post
Share on other sites

Is there a way to get it working with Editor placed Houses?

Share this post


Link to post
Share on other sites
EDIT: It seems that a "house" created by the map (BIS) and a "house" placed by the editor are two different animals. A pre-existing "house" can be addressed by the "nearestBuilding" cmd but one placed in the editor can not.

Can probably be found by using "nearestObjects" command, looking for type "house".

Share this post


Link to post
Share on other sites
EDIT: It seems that a "house" created by the map (BIS) and a "house" placed by the editor are two different animals. A pre-existing "house" can be addressed by the "nearestBuilding" cmd but one placed in the editor can not.

IN RANDOM HOUSE
/////////////////////////////////////
///// END OF EDITABLE AREA //////////
/////////////////////////////////////
//waituntil {gameStarted}; 

// get all houses within distance
_blds = nearestobjects [[(_centre select 0),(_centre select 1), 0],["house"], _dist];
------------------------------------------------------------------------------------------------

IN FILLHOUSE
IN fillHouse.sqf
_building = nearestObject [_center, "house"]; 

IN patrol-vG.sqf and patrol-vF.sqf
_building = nearestObject [_unit, "house"];

Edited by tomturner

Share this post


Link to post
Share on other sites
IN RANDOM HOUSE
/////////////////////////////////////
///// END OF EDITABLE AREA //////////
/////////////////////////////////////
//waituntil {gameStarted}; 

// get all houses within distance
_blds = nearestobjects [[(_centre select 0),(_centre select 1), 0],["house"], _dist];
------------------------------------------------------------------------------------------------

IN FILLHOUSE
IN fillHouse.sqf
_building = nearestObject [_center, "house"]; 

IN patrol-vG.sqf and patrol-vF.sqf
_building = nearestObject [_unit, "house"];

Did you ever get this to work with editor placed buildings .. from what your posting, its looks like you just saying that those commands are already used and you still don't get the results you want.. Is that the case? or is this working with editor placed buildings?

Share this post


Link to post
Share on other sites

Yes, that is what I was demonstrating, the substitution of "nearestBuilding" with "nearestObject" with the appropriate syntax using an array ( [_center, "house"] ).

Share this post


Link to post
Share on other sites
Does this script still work in beta (the ignorant asks)?

As yet not tried it in the Beta - away on business at the moment but will double check tomorrow.

Share this post


Link to post
Share on other sites

So it works in beta for the most part, pretty much everything that it is programmed to do. The problem I am encountering is the AI still leave their buildings to engage most of the time. Is this intentional? If I use an observer view I can watch as multiple enemies come out of houses to converge on my position and once they have killed me they all run off to houses. Im not sure if they are going back to the house they came from or picking a new one.

Its funny to watch... A bunch guys surrounding my house, then I die. About 2 minutes later the area is clear... Like a ghost town.. lol. So my question is there a true garrison method that keeps them in their house?

Share this post


Link to post
Share on other sites
..is there a true garrison method that keeps them in their house?

I use doMove in a loop when unitReady fulfills, that way AI gets back in the building after messing around with hostiles.

Share this post


Link to post
Share on other sites

They already go back into buildings after they are done. The question is how to get them to stop from leaving their building in the first place..

Share this post


Link to post
Share on other sites

I just looked at this for the first time since June, and it seems fine to me. About 75% of the spawned units spawn in a static position. The other 25% make active patrols (within their building).

I don't mess with the AI's own decision making though so once they come under attack the AI FSM's take over but they should return back after the engagement is over, here's the code block specific for the search/patrols

while {alive _unit} do { _unit setBehaviour "SAFE";

_grp setSpeedMode "LIMITED";

_newPosNumber = floor(random _noPos);

_unit doMove (_house buildingPos _newPosNumber);

sleep (floor((random 120) + 60));

};

Share this post


Link to post
Share on other sites

Has someone tried it on Altis, getnearest command kills game and script to work...

Share this post


Link to post
Share on other sites

I like this script but really wish it had Independent enabled, I tried to modify it by replacing the NATO troops with Indies' but they just end up team killing each other for some reason.

If you could update the script or even advise me how to fix this I would really appreciate it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×