ssm4862 10 Posted February 3, 2012 (edited) http://img4.imageshack.us/img4/1687/arma2oa2012020313574215.jpg >100kb! I want Unit into a House and Two Room Random Place. See the screenshot and Please help me. Edited February 3, 2012 by Foxhound removed image over 100kb Share this post Link to post Share on other sites
twirly 11 Posted February 3, 2012 Here are some links that might help you... just two of many results. Searching does wonders! http://forums.bistudio.com/showthread.php?123191 http://forums.bistudio.com/showthread.php?110368 Share this post Link to post Share on other sites
ssm4862 10 Posted February 3, 2012 thank you. but I want desired position. (See the Screenshot) Share this post Link to post Share on other sites
demonized 20 Posted February 3, 2012 make yourself a teamleader, and have 1 ai in your group, press space and look at the positions, you should then see the position number to use with the links from twirly. Share this post Link to post Share on other sites
ssm4862 10 Posted February 3, 2012 No. The unit is a one hostage. I was put directly House. Once again, See screenshot as I want to put the unit(Hostage) in the desired Place. See screenshot as Its location is just two place. I want Unit into a room left or right placement and just a random Share this post Link to post Share on other sites
CaptainBravo 0 Posted February 3, 2012 No. The unit is a one hostage. I was put directly House. Once again, See screenshot as I want to put the unit(Hostage) in the desired Place. See screenshot as Its location is just two place. I want Unit into a room left or right placement and just a random Group the unit to 2 different markers and place each marker on one side of house. Put this setPos [getPos this select 0, getPos this select 1, 0] in unit init field to make sure it goes inside room not on top of house. Now when game starts it will move unit to location of one of the two markers. You will have to test with amrkers movement to make sure it is inside room placement. Share this post Link to post Share on other sites
kylania 568 Posted February 3, 2012 Load up the Visual House Position Module while editing to find what the two buildingPos locations are nearest to where you want your guys to spawn then simply use those locations in your random spawning script. Share this post Link to post Share on other sites
ssm4862 10 Posted February 3, 2012 Sincere thanks to all. Other problems resolved. But Not solved a single one. I want game starts two locations(See the ScreenShot) and unit random placement. But I do not know the command. Share this post Link to post Share on other sites
kylania 568 Posted February 3, 2012 Where exactly is that house? Which map, which objectID, which coords? Share this post Link to post Share on other sites
ssm4862 10 Posted February 3, 2012 Built-in map is not the House. I was added Immediate house object. ---------- Post added at 06:35 PM ---------- Previous post was at 06:32 PM ---------- Where exactly is that house? Which map, which objectID, which coords? Built-in map is not the House. I was added Immediate house object. Share this post Link to post Share on other sites
kylania 568 Posted February 3, 2012 In that case you're going to have to physically place the units based on the house's location I think. I don't believe placed objects have valid buildingPos locations? Share this post Link to post Share on other sites
ProfTournesol 956 Posted February 3, 2012 In that case you're going to have to physically place the units based on the house's location I think. I don't believe placed objects have valid buildingPos locations? Why ? Buildingpos are inheriting from pathway lod. Share this post Link to post Share on other sites
kylania 568 Posted February 3, 2012 That'll be helpful than. I guess just figure out which buildingPos is each room and use those. Share this post Link to post Share on other sites
ssm4862 10 Posted February 4, 2012 I think Unit Random placement of the "maker" would be nice... But I do not know the command. Share this post Link to post Share on other sites
kylania 568 Posted February 4, 2012 Ok, figured out which house it is. There are three buildingPos locations in each of those rooms. To have a hostage spawn in a random position do this: Place your hostage on the map anywhere you'd like and name him hostage. Place your building on the map by putting down a gameLogic where you want it and spawning it with this in the gameLogic's init field: myHouse = "Land_HouseV2_02_Interier" createVehicle getPos this; hostage setPos (myHouse buildingPos ([2,3,4,5,6,7] select random 5)); That will create that building where the game logic is and move the pre-placed hostage into one of the 6 random locations in those two rooms. Share this post Link to post Share on other sites
ssm4862 10 Posted February 4, 2012 Answer the questions given our heartfelt thanks. But "hostage setPos (myhouse buildingPos ([2,3,4,5,6,7] select random 5))" use command has not been resolved. Link : http://imageshack.us/photo/my-images/638/92066045.jpg/ This screenshot is an object I directly insert the House. Link : http://imageshack.us/photo/my-images/853/78868514.jpg/ But, Can I use the above command and occurs frequently a hostage not exist. Link : http://imageshack.us/photo/my-images/62/47836361.jpg/ In other cases, When there is a hostage exist. What I want to tell the mean, Hostages must be present. but, House Object is on the water. Source Gamelogic (House) : myBuilding = "Land_HouseV2_02_Interier" createVehicle position this; deleteVehicle this;myBuilding setdir 90;mybuilding setPos [getPos this select 0, getPos this select 1, (getPos this select 2) +3]; mybuilding setVectorUp [0,0,1]; mybuilding allowdamage false; hostage setPos (mybuilding buildingPos ([2,5] select random 5)); Share this post Link to post Share on other sites
kylania 568 Posted February 4, 2012 Ahh yeah! If you only want to use position 2 or 5 change to this: hostage setPos (mybuilding buildingPos ([2,5] select random [b]1[/b]) Share this post Link to post Share on other sites
twirly 11 Posted February 4, 2012 I think this line is supposed to be... hostage setPos (mybuilding buildingPos ([2,5] select floor (random 2))); Share this post Link to post Share on other sites
kylania 568 Posted February 4, 2012 Either way works to get you a 50/50 chance but you're right, select floor is great if you're looking for a whole number because it would return specifically either a 0 or a 1 and not the floating numbers you get with random 1. random is always such a pain. :P Share this post Link to post Share on other sites
shuko 59 Posted February 4, 2012 If he wants to select between two (non preset building positions), why not just do copytoclipboard getposasl instead of using buildingpos? Share this post Link to post Share on other sites
ssm4862 10 Posted February 4, 2012 Link : http://img208.imageshack.us/img208/8795/arma2oa2012020420022882.jpg Answer the questions given our heartfelt thanks. Very Very Very Thank you all. The photo above is the result. Share this post Link to post Share on other sites
kylania 568 Posted February 4, 2012 Really happy it worked for you! Looks great. Share this post Link to post Share on other sites