Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Civilian group - move to church and pile inside

  1. #1
    Gunnery Sergeant
    Join Date
    Feb 17 2010
    Location
    Enceladus, Saturn
    Posts
    557

    Civilian group - move to church and pile inside

    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!
    Last edited by jpinard; Jul 27 2010 at 17:00.

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

  3. #3
    Search Armaholic for Mr Murray's Editing Guide.

    Quote Originally Posted by 5.62
    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.
    Quote Originally Posted by 5.63
    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...

  4. #4
    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:

    Code:
    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:

    Code:
    _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.

  5. #5
    Gunnery Sergeant
    Join Date
    Feb 17 2010
    Location
    Enceladus, Saturn
    Posts
    557
    Author of the Thread
    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?
    Last edited by jpinard; Jul 27 2010 at 20:35.

  6. #6
    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:

    Code:
    nul = "Land_Church_03" createVehicle getPos this;
    in it's init field will plop down this at that location:


  7. #7
    Gunnery Sergeant
    Join Date
    Feb 17 2010
    Location
    Enceladus, Saturn
    Posts
    557
    Author of the Thread
    Quote Originally Posted by kylania View Post
    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:

    Code:
    nul = "Land_Church_03" createVehicle getPos this;
    in it's init field will plop down this at that location:

    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
    Last edited by jpinard; Jul 27 2010 at 21:19.

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

    Code:
    (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.

  9. #9
    Gunnery Sergeant
    Join Date
    Feb 17 2010
    Location
    Enceladus, Saturn
    Posts
    557
    Author of the Thread
    Quote Originally Posted by kylania View Post
    Place a Gamelogic by the Church, then put this in it's init:

    Code:
    (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?
    Last edited by jpinard; Jul 27 2010 at 21:44.

  10. #10
    Code:
    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.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •