Jump to content
Sign in to follow this  
FL350

buildings causing a problem

Recommended Posts

hey guys in the middle of a mission and need some help! i did search for this but i cant understand the difficult responses,

when i start my mission i want enemy infantry to be positioned inside the buildings in a small town, looking out the window in an ambush position etc...

when i place the man over the building hes just starts on the roof, so do i still place him over the building, but add something to the inti...line? im really hoping its this simple, and thanks for puting up with the 100th time this questioned been asked, but i need it answered very simply... thanks! crazy_o.gif

Share this post


Link to post
Share on other sites

you can either use the setpos command with raw numberseg: unit setpos [1000,2000,10], which is very good as the unit can be placed anywhere inside the building, but you have to use trial and error to get it in the right place.The other option is to use the setpos command with the buildingpos command eg: unit setPos ((object 21222) buildingPos 1). this limits the postions available to place the unit. i also recommend going to http://www.ofpec.com/COMREF/index.php and searching these functions if you need more help using them

Share this post


Link to post
Share on other sites

do i just copy this line into the unit init.. line?

: unit setPos ((object 21222) buildingPos 1).

and place the unit over the building?

Share this post


Link to post
Share on other sites

it says invalid expression if i do this sad_o.gif , yeah look it may be to complex for me i think , shame the creators of this game for not making things like this simple! even after they made the game twice!!

Share this post


Link to post
Share on other sites

there is no such command as object in ArmA.

try something like :

_unit setPos (getPos _unit nearestObject 21222) buildingPos 1)

where _unit is placed close to the building 21222 in the editor. placing the unit far away will cause a delay while the nearestObject command searches the for the building, possibly requiring ArmA to stream data.

Share this post


Link to post
Share on other sites

i placed the unit close to the building, and added this line into the inili..bar

_unit setPos (getPos _unit nearestObject 21222) buildingPos 1)

and it says " missing ; "

i tried to put a " ; " before and after the sentence but it still wont work

Share this post


Link to post
Share on other sites

Try using:

this setpos 1000

I think that should place the soilder 1000 meters in the air, however I'm not sure if it starts counting from the ground of building (if you're above one).

Then just use trial and error until it's place where you want it.

Share this post


Link to post
Share on other sites

narct,

You need 2 things:

1. The objectID number from the building you want to place the unit in

2. You need to give the unit a name, here we use "e1"

Then place the unit close to the building and in the units initialization line type:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">e1 setPos ((getPos e1 nearestObject 256217) buildingPos 2)

This places the unit at the fixed building position (if the building has such a number). Using this method you might not be able to place a unit exactly at a window though.

In this case you need to work with the setPos command and a lot of trial and error until the unit is where you want.

If you want to try this method then you need to type the following in the init line:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setPos [getPos this select 0,getPos this select 1,3]

The last numer in above code (3) defines the height above ground from the unit. If the unit sinks towards the ground you need to raise the number, if its floating in the air lower it.

In addition to that, you might prevent the unit from moving around and going prone:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">this setPos [getPos this select 0,getPos this select 1,3]; this disableAI "MOVE"; this setUnitPos "UP"

Hope that answers all your questions smile_o.gif

Share this post


Link to post
Share on other sites
i placed the unit close to the building, and added this line into the inili..bar

_unit setPos (getPos _unit nearestObject 21222) buildingPos 1)

and it says " missing ; "

i tried to put a " ; " before and after the sentence but it still wont work

oops, i removed the opening redundant bracket, but not the closing one. sorry for the added confusion confused_o.gif

good answer W0lle.

Share this post


Link to post
Share on other sites

thanks guys for the help, ill get back to it today and give it a good trial and error....ill msg back if there are any more problems notworthy.gif

Share this post


Link to post
Share on other sites

hey wolle,

one more question, how can i find out the individual id number of the buildings i want to use?

Share this post


Link to post
Share on other sites

click on the "Show IDs" button (it will change to read "Hide IDs"), then zoom in on your desired building.

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  

×