tophe 69 Posted December 26, 2007 I'm making a mission where a building will be marked in a city. That building should then be destroyed. I've figured out everything but how to randomly pick a building... I want to be able to set a number of buildings that will be available for my script to pick. I tried putting a gamelogic and grouping it to 12 markers on different houses, hoping that the game logic should move to one of the 12 positions randomly at the mission start. But 99% of the time the game logic stays where I put it in the editor. What I need is something that will be put randomly at one of 12 positions at the mission start. Then I'll run this script: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ; set house to destroy to_house = nearestBuilding houseLogic _w = getpos to_house _marker = createMarker["HQ",[_w select 0,_w select 1]] _marker setMarkerShape "ICON" _marker setMarkerType "Select" The problem is only to get that houseLogic to be put at one of 12 buildings at mission start. I hope I'm not too confusing here! I would really appreciate help in finding a sollution for this. Thank you // Tophe of Östgöta Ops, Sweden Share this post Link to post Share on other sites
Asuriel 0 Posted December 27, 2007 i am not familiar with using markers as random start positions. I tried it once, can't remember if it was OPF or ARMA and as far as i can remember it didn't work out. I can't test it now, might tomorrow, but if it works with normal units you could try a trigger. maybe that will work. Another way to do it would be to add all 12 building's objectIDs into an array and select one randomly using the script you have already written. Then again its a pain in the arse to write down 12 IDs and put them into an array. Not very flexible. I can't think of another way to do it right now. Might find one when i try it myself. Share this post Link to post Share on other sites