Jump to content
KutPax

Requesting Help with Vehicle Scanning

Recommended Posts

Hi there,

I'm working on a script which detects all Air vehicles in a specific radius of a specific object, which then either results with a true which displays a hint saying "Vehicle in a 25m Radius!", or when it's false it will display a hint saying "There's no vehicle in a 25m radius!".

I also want to implement the ACE Cargo Framework into this, to be specific, [object, vehicle] call ace_cargo_fnc_loadItem, where object is going to refer to the array of the vehicle which is inside of the 25m radius (_x or something, I'm not too familiar with array's).

If there's anyone who reads this who has knowledge in this area, please do let me know!

Cheers.

 

Share this post


Link to post
Share on other sites
43 minutes ago, KutPax said:

I'm working on a script which detects all Air vehicles in a specific radius of a specific object, which then either results with a true which displays a hint saying "Vehicle in a 25m Radius!", or when it's false it will display a hint saying "There's no vehicle in a 25m radius!".

 

you can use nearEntities command for that

 

_list = player nearEntities ["Air", 25];

 

Share this post


Link to post
Share on other sites

It does not seem to want to recognise any air vehicle with "Air", any idea why?

Share this post


Link to post
Share on other sites
1 minute ago, KutPax said:

It does not seem to want to recognise any air vehicle with "Air", any idea why?

 

too short radius? player is the center pos

Share this post


Link to post
Share on other sites

I'm trying to get the radius from the point of an object with variable PositionSkeet

Share this post


Link to post
Share on other sites
2 minutes ago, KutPax said:

I'm trying to get the radius from the point of an object with variable PositionSkeet

 

put that instead of player then

Share this post


Link to post
Share on other sites

This is what I've got now:

 

if ( _ctrl2 lbText ( lbCurSel _ctrl2 ) isEqualTo "Test Listbox Item 1" ) exitwith 
{
    _nearestAirVeh = nearestObject [testskeet1, "Air"] select 0;

    if (!isNil _nearestAirVeh) then {
        hint "No Heli near testskeet1";
    }
    else
    {
        hint "Heli Found near testskeet1";
        [myObjectVarHere, _x] call ace_cargo_fnc_loadItem;
    };
};

Only I'm getting the following error:
error select: Type Object, expected Array.String,Config entry

Share this post


Link to post
Share on other sites

couple errors there, updated code:

 

if ( _ctrl2 lbText ( lbCurSel _ctrl2 ) isEqualTo "Test Listbox Item 1" ) exitwith 
{
    _nearestAirVeh = nearestObject [testskeet1, "Air"];

    if (isNull _nearestAirVeh) then {
        hint "No Heli near testskeet1";
    }
    else
    {
        hint "Heli Found near testskeet1";
        [myObjectVarHere, _x] call ace_cargo_fnc_loadItem;
    };
};

 

note: the ace line looks buggy

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

×