Grampz 10 Posted June 30, 2009 Is it possible to put a unit inside of a building? And even then is it possible to place them at specific points of the building? For example I wanted to do the cliche thing of putting a sniper inside of a church tower, however he'd just mill around below the church outside. I threw down some deer stands and tried to put riflemen inside but they'd just stand below them. Share this post Link to post Share on other sites
manzilla 1 Posted June 30, 2009 (edited) Of course there's a way to script units in any building, not quite sure how to do it but I know it's posted somewhere on these forums. It's probably in the ArmA1 section, I think it's still done the same way. Also I believe Mr. Murray's Editor Guide for ArmA1 also discusses how. I'm not quite sure how to do it or I'd just give you an example. You can also use waypoints. If you create a unit and then create a wp over the building you'd like the unit to move to, a new drop down menu will appear in that wp and it lets you choose the position in the building you want the unit to go. I use this method but knowing the proper position in the house is a pain for me to figure out. EDIT: Here's a link to Mr Murray's ArmA editing guide. It's very useful since much of the stuff still applies in A2. Mr. Murray and crew are working on an updated A2 version but it's probably safe to say we have some time to wait until it is ready for release. It's gotta be a monumental job creating something of this magnitude. http://www.armaholic.com/page.php?id=4847 Edited June 30, 2009 by Manzilla Share this post Link to post Share on other sites
Grampz 10 Posted June 30, 2009 Thanks for the quick reply, I'll have another glance at Mr. Murray's guide. I didn't notice anything about garrisoning at first but I'll definitely give it a more thorough look. Share this post Link to post Share on other sites
Tajin 349 Posted June 30, 2009 We've had the same topic only a few days ago, please use the search next time. Enjoy: http://forums.bistudio.com/showpost.php?p=1328174&postcount=4 Share this post Link to post Share on other sites
Grampz 10 Posted June 30, 2009 Thanks for the reply Tajin, I however did use the search function and it didn't come up with the particular results I was looking for. Considering that topic's title is "Putting AI on top of objects and how to disarm them?" it's not hard to understand why it was overlooked. I appreciate the assumption however. :p Share this post Link to post Share on other sites
dai-san 0 Posted July 3, 2009 Thanks for the placement explanation, this works great. However, the AI I am placing in a building is a unit your team has to rescue and extract. Before I used the placement script the unit was outside and quite often got shot by enemy patrols but if he survived I had a trigger that when a group player got near he joined that player and followed. Now it seems that the placement script is preventing him from joining the group player. The trigger still works because the text is appearing when you enter the building he is in but he wont join the group player. Sorry if the answer is really obvious, but I am just learning the editor and scripting. Share this post Link to post Share on other sites
Leving 10 Posted August 28, 2009 I've been trying to make this work - pasted the script in an sqf file, but the guy still just stands outside the building. Are their only specific buildings? I tried replacing x with 1 but nothing happened - any more help? Share this post Link to post Share on other sites
Vega064 10 Posted August 28, 2009 Hey guys this is what I have been doing to set my AI in a building that I want. Put this in the Initialization line of your units: this setpos [(getpos this select 0), (getpos this select 1), .1]; The only thing you have to mess with is the ".1" number. That number is the height, I use it when they are on level groun in a building. But if he is on steps like in a church or something you can make it like .6 to increase, or even put units in towers with 6 or whatever height you need. You can go as high as you want just have to play with it to see how high or low you need it. You can also use it to lower things into the ground more or seomthing like that with a -.1 or lower. Hope this helps, and oh yeah you just have to place the unit on the building where you want it and it will apear exactly where it is on the map, this might be a bit easier than scripting it and give you more control. Share this post Link to post Share on other sites
Tom1 10 Posted June 12, 2011 hey guys this is what i have been doing to set my ai in a building that i want.Put this in the initialization line of your units: This setpos [(getpos this select 0), (getpos this select 1), .1]; the only thing you have to mess with is the ".1" number. That number is the height, i use it when they are on level groun in a building. But if he is on steps like in a church or something you can make it like .6 to increase, or even put units in towers with 6 or whatever height you need. You can go as high as you want just have to play with it to see how high or low you need it. You can also use it to lower things into the ground more or seomthing like that with a -.1 or lower. Hope this helps, and oh yeah you just have to place the unit on the building where you want it and it will apear exactly where it is on the map, this might be a bit easier than scripting it and give you more control. thankyou so much Share this post Link to post Share on other sites
2nd ranger 282 Posted June 12, 2011 I can't remember where I got this, I think it was Celery. But the easiest way to get a unit where you want him is to do the following. Put down a radio trigger, and in the Activation box, put this: copyToClipboard format ["this setPosATL %1;this setDir %2",getPosATL player, getDir player] Now in game, move to the exact spot and face the exact direction you want to put your unit. Activate the radio trigger, then simply go back into the editor and Ctrl+V the result into the unit's init line. It will paste in the code for setPos'ing your unit to the position you were in and the direction you were facing. Share this post Link to post Share on other sites