Jump to content
Sign in to follow this  
Thom47

Defining a house with ID - for NearestBuilding

Recommended Posts

Aight yo,

here's the deal. I'm trying to create a basic CQB mission where a team will raid a hotel and clear it out of enemy units. So, I need to set units to patrol inside the house from Position #1 to Pos #3 and so on, but using just normal waypoints didn't work. A unit walked to the position, but froze there instead of continuing to waypoint 2.

Then, I came against the housepatrol script (thanks Tophe) which basically gets an unit to patrol in random positions in the nearest house. It works but the problem is, the hotel I'm basing the mission on is victim of the bug and the units don't realize it as nearest. They patrol inside a farm 500 meters from the hotel, which is obiviously not the idea.

So, my question is, is it possible to 'define' NearestBuilding to be X?

The hotel

hotelid.jpg

EDIT: never mind, found it out myself. The hotel is a victim of the bug so it doesn't work in Sara island.

The script

*/

sleep 0.5;

if (!isServer) exitWith {};

// Setting variables

_unit = _this select 0;

_beh = if (count _this > 1) then {_this select 1} else {"SAFE"};

_wtime = if (count _this > 2) then {_this select 2} else {30};

if (_wtime < 0) then {_wtime = 30};

_position = getPos _unit;

_house = nearestBuilding _unit;

_x = 0;

_y = 0;

_t = 0;

_timeout = 0;

_notbugged = true;

_name = vehicleVarName _unit;

if (isNil _name) then {_name = "guard"};

So basically I need to put the id 20879 to the right place, so that the game reads it correctly. Where would it be? Buildingname buildingid; ?

Thanks,

Thom

Edited by Thom47

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  

×