Jump to content
Sign in to follow this  
daimyo21

Placing houses on map anywhere.

Recommended Posts

Hi so I just downloaded a butt load of classnames for houses in the map that arent accessed through the editor. How could I place them through a trigger? for example I have this house named: Land_A_Minaret_Porto_EP1

Which is the Minaret Tower so not really a house.

Share this post


Link to post
Share on other sites

place a small object down like a skeet shoot, then in the int:-

bld="Land_A_Minaret_Porto_EP1" createvehiclelocal (getposasl this);bld setdir (getdir this);

that should do the trick !

Share this post


Link to post
Share on other sites

So i use this method alot to place buildings in random spots. Now I have another issue. Im trying to create a more dynamic mission and want to be able to place objects randomly in dynmiccally created buildings as ABOVE ^^^

So I began trying to use this code

object1 setPos ((nearestbuilding this) buildingPos (random 10)); 

This doesnt work, it gets the nearest building across the map because the dynamic building is technically a vehicle but has positions just like any other building.

How do I identify the Dynamic building as a BUILDING so I can use nearestBuilding code?

Share this post


Link to post
Share on other sites
It should probably be round (random(x)) or floor (random(x)).

For some reason it always chooses a buildingpos even when not rounding or using floor...

ill test further. BTW i got it working through a script.

for multiple buildings just place a gamelogic on map, name it bpos1, 2, 3 etc. and place it close to dynamic building.

then exec this script and your new position is bpos1, 2, 3 etc.. instead of player.

buildingpos.sqf:


_nObject = position player nearestObject "House";
player setPos (_nobject buildingpos (random 20));

this can be used to place objects/enemies in random places in your newly created building.

If someone has a more effecient way of declaring a object as a building please post! THANKS!

Share this post


Link to post
Share on other sites

You should probably use floor even if it works without.

In any case, try not to setpos to building positions, as some are bugged and will clip the AI through the building and kill them. Safer to place them outside the building and make them walk in. You'll have to make sure the building is in a good position - If it's not on flat ground often AI will not be able to path into the building at all.

You can spawn buildings by simply placing markers and from init.sqf call a script that will spawn those buildings, or you could download map_eu from armaholic which will allow you to simply place buildings in the editor, though that only works for A2 buildings, as far as I know no similar mod was released for OA unfortunately, and everyone playing your mission will need the addon. IIRC there was also another one that included less objects that didn't require everyone to download it to play your mission.

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  

×