Jump to content
Sign in to follow this  
Smurf

Check: Buildings,flat tires?

Recommended Posts

Hi,

theres is any way to check how many positions a building has?

For the command:

_a = round(random 13);
downpilot setpos (getMarkerPos "kidnap");
Downpilot setPos ((nearestBuilding downpilot) buildingPos _a);

Right now the marker "kidnap" is static and I know how many positions that given building have. But if I didn´t know, there is a way to check to use in the "random" line?

AND

There is a way to check if a unit have a flat tire?

Or even better, there is a way to force an AI to stay inside a vehicle thats very damaged or with a flat tire?

Tried disableAI "Move" but didnt worked =\

Thanks.

Share this post


Link to post
Share on other sites

This may help you with the building positions man....adapt it to your needs.

//*** finds number of positions in nearst house
_house = position leader esqd1 nearestObject "Building";

_posarray = [];
_rndpos = [];
_pos = [];

_cnt = 0;

while {format ["%1", _house buildingPos _cnt] != "[0,0,0]" } do {
_pos = _house buildingPos _cnt;
_posarray = _posarray + [[_pos]];
_cnt = _cnt + 1;
sleep 0.02;
};

Then "_posarray" will contain all the positions in "_house".

Edited by twirly

Share this post


Link to post
Share on other sites

Thank you, will have a look at that today.

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  

×