Jump to content
Sign in to follow this  
odium

Propability of presence for specific class types like infantry or manned vehicles

Recommended Posts

Hi guys,

acutally I'm working on a train module for my clan and I need some help. So far I placed a few hundred units in a city at specific positions and I want to to spawn about 10% of them. So someone made me this:

null = [] spawn {{if (side _x == East) then { if (round(random 100) > 10) then { deleteVehicle _x; };}} forEach allUnits};

Works pretty good for the whole side east. Now, how can I change this line into something, that vehicles and their crews are not affected by this. By now, my only workaround is to place IND-Vehicles. Any idea? I know, there is something like TYPEOF but actually I'm not so good at this ^^

Greetings and thanks in advance,

Odium

Share this post


Link to post
Share on other sites

Something like this should do the trick:

null = [] spawn {
{
	if (side _x == East && vehicle _x == _x) then 
	{
		if (round(random 100) > 10) then 
		{
			deleteVehicle _x; 
		};
	}
} forEach allUnits;
};

Share this post


Link to post
Share on other sites

For infantry only:

null = [] spawn {{if (side _x == East && _x isKindOf "man") then { if (round(random 100) > 10) then { deleteVehicle _x; };}} forEach allUnits};

EDIT: ninja'd

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  

×