OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Dj Tano on 22 Mar 2007, 19:57:54

Title: Putting enemies inside buildings and on different floors
Post by: Dj Tano on 22 Mar 2007, 19:57:54
Hey guys,

ive found this really great building in sahrani wich would be perfect for a house clearing mission, but i seem only to be able to put enemies ON buildings, instead of IN them... anybody knows wht i have to do?
Title: Re: Putting enemies inside buildings and on different floors
Post by: LeeHunt on 22 Mar 2007, 20:21:39
Very common problem.  In fact I made a joke blooper cutscene (i'll put it up on the forum later) about that.  In the init line for your unit, put in "this setpos (nearestbuilding pos 3)" i think.  I think that syntax is right. Check the old OFP forums on ofpec.com too. 
Title: Re: Putting enemies inside buildings and on different floors
Post by: myke13021 on 22 Mar 2007, 20:37:00
There's a script, made by Tophe, which could be helpful for you:

http://www.armaholic.com/page.php?id=879


:EDITH:
saw it only at the second sight...there's also a random house patrol script by the same author there:

http://www.armaholic.com/page.php?id=936
Title: Re: Putting enemies inside buildings and on different floors
Post by: D_P_ on 23 Mar 2007, 02:10:29
i played around with the arma hotel and that code... worked except with all the floors the available in the hotel, the unit positions went beyond 180... so it required alot of patience setting the units in thier desired positions. I also noticed  that after adding about 15/20 units in the hotel, the game began suffer heavy lag - dunno why*  :confused:

Code: [Select]
unit setpos  ((position unit nearestobject 172902) buildingpos 184);
unit setdir getdir unit +10;

*I know nothing about anything
Title: Re: Putting enemies inside buildings and on different floors
Post by: satexas69 on 23 Mar 2007, 03:52:31
Recommendation: Find a map called RED HOTEL or FORT ROOSTER and unpbo it. In both  missions, they have men in the hotel on various floors, looking out various windows and with various actions (guard, patrol, etc).

That will show you how to do it. No scripts involved.
Title: Re: Putting enemies inside buildings and on different floors
Post by: LeeHunt on 24 Mar 2007, 13:56:06
In the Init line of your unit put this: 

this setpos (nearestBuilding this buildingPos 1)

You can try buildingpos at higher numbers, i think one building even goes up to 22 positions....
Title: Re: Putting enemies inside buildings and on different floors
Post by: D_P_ on 24 Mar 2007, 19:13:46
Quote
You can try buildingpos at higher numbers, i think one building even goes up to 22 positions....

The hotel I refered to above has over 180  :blink: