OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: DjTano on 31 May 2007, 00:22:46

Title: How do i put enemies in buildings?
Post by: DjTano on 31 May 2007, 00:22:46
Hey guys,

ive once seen a thread about a VERY simple way to do that, but ive lost it now so can anybody tell me how to put enemies in buildings?
Title: Re: How do i put enemies in buildings?
Post by: bedges on 31 May 2007, 00:23:51
buildingpos (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=a#buildingPos).
Title: Re: How do i put enemies in buildings?
Post by: LeeHunt on 31 May 2007, 04:30:16
I understand your frustration, i even made a blooper reel about this problem, check it out:

http://www.youtube.com/watch?v=FkqBywbOEIk

But the answer is, put this line in the initialization line for a unit (and buildings can have way more just one position,)

this setpos (nearestBuilding this buildingPos 1)
Title: Re: How do i put enemies in buildings?
Post by: DjTano on 31 May 2007, 20:29:24
Quote
this setpos (nearestBuilding this buildingPos 1)

when i use that i land in a corner of the island on the sea... wtf?
Title: Re: How do i put enemies in buildings?
Post by: LeeHunt on 31 May 2007, 21:25:49
strange.  did you put the enemy unit on top of the building on the map?  Also you pressed F1 to create an enemy soldier, then in the initialization line put

this setpos (nearestBuilding this buildingPos 1)

right?  worked for me.  try searching the forums i think i asked this question a while back and its in there.
Title: Re: How do i put enemies in buildings?
Post by: smoke52 on 02 Jun 2007, 01:20:21
what i use is this:

this setpos [getpos this select 0, getpos this select 1, XXX]

where XXX is the height. for example:

this setpos [getpos this select 0, getpos this select 1, 4]

works everytime.
Title: Re: How do i put enemies in buildings?
Post by: DjTano on 02 Jun 2007, 18:08:18
tried tht aswell, and it doesnt work :(
Title: Re: How do i put enemies in buildings?
Post by: smoke52 on 03 Jun 2007, 01:26:32
how and what are you placing?

put a soldier in the building, then in the soldiers INIT field put the command
Code: [Select]
this setpos [getpos this select 0, getpos this select 1, 4]
*you have to use some trial and error for the height, its not always 4

you could also just put the soldier out in the open, put your player looking at the soldier then preview it... you should see the soldier fall to the ground.

also i forgot where i downloaded this from but heres some scripts that places the guy randomly in the building, and another to place a random patrol in the building...all you have to do is place a soldier near any building and it will automatically jump the guy in the building and he will start patrolling, or just be randomly placed.

scripts:
http://download.yousendit.com/FAF10ACF6E4D98D9
Title: Re: How do i put enemies in buildings?
Post by: DjTano on 03 Jun 2007, 03:53:19
yea, i found a solution to it...
Title: Re: How do i put enemies in buildings?
Post by: Mr.Peanut on 04 Jun 2007, 16:51:27
Post your solution! Share and enjoy!