Jump to content
Sign in to follow this  
jpinard

Civilian group - move to church and pile inside

Recommended Posts

I did some searches but nothing really seemed to fit what I want to do. I have 15 civilians in a group, they're coming from all over the city and I want them to not just go by the church, but to go inside (hopefully all of them).

I'm not used to working with buildings at all, so any help would be great. Thanks guys and gals! :)

Edited by jpinard

Share this post


Link to post
Share on other sites

give them a waypoint by clicking on the building, there should be a dropdown list to select building position.

Share this post


Link to post
Share on other sites

Search Armaholic for Mr Murray's Editing Guide.

Many buildings in Armed Assault® are passable as they was in Operation Flashpoint®. But

one of the new ArmA® features is that the leader of a group can allocate his Soldiers

special positions in a building. To do this only a single mouse click is needed, that will

take the effect that the resp. soldiers will move to their desired postions.

These positions are fixed defined positions inside a building modell. Each positions owns

an own number. The user can now place the units directly on the desired positions inside

or even on the top of the building. A perfect example is the Hotel which has around 265

fixed positions, so the Hotel own nearly the most positions of all used buildings in the

game. Because of the fact that its quite unclear where all these positions are located so

all five levels with their positions in the Hotel, are shown on the next pages. A special

feature can be found in Chapter 6.16. This script will become units patrolling through

the building.

To place units inside a building so one only needs to place a unit directly onto the building

and defines the following Syntax into the initline of the unit

this setPos (nearestBuilding this buildingPos PositionNumber)

This command is much less complicate then name setPos [X,Y,Z], because all the needed

coordinates doesn’t have to get determined before. If the building has been named as

explained in Chapter 5.61, so following Syntax can be used as well:

this setPos (HouseName buildingPos PositionNumber)

If one wants to place units randomly inside a building so the random command has to be used.

this setPos (nearestBuilding this buildingPos Random 265)

By using this command a random position will be defined now which is located

somewhere between 0 and 265.

As units can be placed onto a special position, so one can ask them to move to an x –

desired position within the respective building. To do this just use following Syntax

Name doMove (nearestBuilding this buildingPos 123)

Name doMove (House1 buildingPos 123)

Or to another random position:

Name doMove (House1 buildingPos random 123)

The way how to name a object or a building has been explained well accurate in Chapter

5.61. In example:

House1=nearestBuilding this

And so on...

Share this post


Link to post
Share on other sites

If your civilians are all in the same group, give the group a waypoint right next to the entrance of the church. In the activation field of that waypoint, put the following:

nul = [group this,nearestBuilding this] execVM "enterBuilding.sqf"

Now create a script file in your mission directory called "enterBuilding.sqf". Use the following code for the script:

_unitArray = units (_this select 0);
_building = _this select 1;
_indices = 0;

// find out how many building positions are available 
while {str (_building buildingPos _indices) != "[0,0,0]"} do
{
_indices = _indices + 1;
};

// if no interior positions were found, simply move everyone to the structure
if (_indices == 0) exitWith {{_x doMove (position _building)} forEach _unitArray};

_i = _indices;

// move units into as many unique buildings positions as possible.  overlap after that
{
_x doMove (_building buildingPos _i);
_i = _i - 1;
if (_i < 0) then {_i = _indices};
// have units stop after arriving at proper location, unless group leader, as he stops anyway
if (_x != leader group _x) then {_x spawn {waitUntil {unitReady _this};doStop _this}};
// delay to avoid AI clusterfucking
sleep 1;
} forEach _unitArray;

I haven't really tested that, but it should work.

Share this post


Link to post
Share on other sites

I just realized I made a very stupid mistake. I'd started this work in the larger town with the white church (Chernarus) and since the church was side-on to where I was testing I just assumed it was enterable. To my dismay, it's not :( Now I have to recreate the entire scenario in a totally different town. So dumb on my part.

ST_Dux - I think your script is eactly what I'll need. I think if I had everyone go to the same point inside the church it might create issues (I'd like to have up to 25 civilians go in).

---edit---

None of the "open churches" are in a landscape which fits my mission and the perspective needed. Is there any way I can replace the church in Stary Sobor with the one from Novy Sobor?

Edited by jpinard

Share this post


Link to post
Share on other sites

Don't have CO installed here at work so can't check, but placing a gamelogic where you want the church to be and using:

nul = "Land_Church_03" createVehicle getPos this;

in it's init field will plop down this at that location:

Land_Church_03.jpg

Share this post


Link to post
Share on other sites
Don't have CO installed here at work so can't check, but placing a gamelogic where you want the church to be and using:

nul = "Land_Church_03" createVehicle getPos this;

in it's init field will plop down this at that location:

Land_Church_03.jpg

Holy cow, if this works I will be one very happy bunny. Gonna try it right now.

---wonderful, works!---

Is there a way I can destroy/remove the old church and have this one plopped down in its place (ie. not exploding of course)? If not, I guess this town will have 2 churches :)

Edited by jpinard

Share this post


Link to post
Share on other sites

Place a Gamelogic by the Church, then put this in it's init:

(position this nearestObject ####) hideObject true; nul = "Land_Church_03" createVehicle getPos this;

Where #### is the Map ID code of the Church. Click the IDs button in the editor and zooooom in to see the number. In testing I've been having some odd results, sometimes the building is gone, other times you can see it, but pass right through it.

Share this post


Link to post
Share on other sites
Place a Gamelogic by the Church, then put this in it's init:

(position this nearestObject ####) hideObject true; nul = "Land_Church_03" createVehicle getPos this;

Where #### is the Map ID code of the Church. Click the IDs button in the editor and zooooom in to see the number. In testing I've been having some odd results, sometimes the building is gone, other times you can see it, but pass right through it.

Excellent, I'm getting closer! Just 1 remaining issue.

1. I need to remove two benches that are normally in the courtyard of the church. But the ID #'s are obscured by the the old church building. How can I see those ID #'s or get them? <--- I could see the last 3 digits and was able to figure it the rest based on the other ID"s in the area.

2. The replacement church doesn't want to face the direction I want it to, no matter how I rotate the game logic icon. Any tricks to overcome that?

Edited by jpinard

Share this post


Link to post
Share on other sites

newChurch = blah blah; newChurch setDir 90;

I assume that'll work in MP, if not just move the code from the gamelogic's init to a trigger, so it runs for everyone.

Share this post


Link to post
Share on other sites
Many buildings in Armed Assault® are passable as they was in Operation Flashpoint®. But

one of the new ArmA® features is that the leader of a group can allocate his Soldiers

special positions in a building. To do this only a single mouse click is needed, that will

take the effect that the resp. soldiers will move to their desired postions.

Mr Murray needs a history lesson. The described behavior existed in OFP well before ArmA was around...

Share this post


Link to post
Share on other sites
Don't have CO installed here at work so can't check...

Damn! Now that would be a cool workplace.

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  

×