Jump to content
Sign in to follow this  
daimyo21

Createvehicle with random "Classname";

Recommended Posts

Here mate... I made a demo mission for you. There seems to be a few quirky things when creating objects in buildings.

Now remember this is not going to be exactly what you need but it is tested and works.... it is also heavily commented.

I tried to get it as close as possible to what I think you need.

Demo mission here.

EDIT: Oh yeah... 5 "Fuel_cans" will be hidden in the buildings in front of you. There's hints that output the values of the arrays etc.

Hope it helps!

I truly appreciate all the help, especially from you Twirly. Finding out about the "" in the array alot sooner wouldve saved me hours of time though at the same time I learned alot more stressing about it (thanks so much Demonized too for noticing the array error).

I got the While loop of finding the buildingpos to work with some small tweaks and just following the instructions further and with all the help etc.

I saw your test mission scripting and I see some helpful things I could use like the "check to see if any positions are available". Though since im creating dynamic buildings for this mission if i were to use _randbuilds = nearestObjects [player,["Building"],50];

it seems to grab only the buildings that started on the map so this would be great for missions involving static buildings. Instead i have every building named and listed so im going to simply just add them to the array which brings me to my next question. Whats the max amount of variables allowed in an array? I have about 100-150 unique building names so im just wondering.

Ill test further if the code has any problems and let you know. Much thanks again.

EDIT*** one last thing, is there a way to check if one building has too many objects inside? that can go along with the While Loop command or seperate quick check before it initiates the while loop. If too complicated honestly dont worry about it.

Edited by Daimyo21

Share this post


Link to post
Share on other sites

I have a variation of the script working with the Town Generator in Arma2 OA. So I'm not sure why it won't work with your placed buildings.

Regarding too many objects in each building..... hmmmm.... not sure how you would go about given the existing code.... but just about anything is possible with enough thought.

Another problem might be that more than one object is placed in the same position! To get around this you can remove any used positions from _posarray.

Share this post


Link to post
Share on other sites

just to add to Twirlys last post, you could assign a variable using setVariable to the building with how many objects were in it and then you have control of how many objects that are "allowed" into your buildings.

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  

×