Jump to content

Recommended Posts

private _cardir = getDir _car;
private _delta = [getDir _frontcar, _cardir] call BIS_fnc_getAngleDelta; //180º-0ºR -180º-0ºL

if (abs _delta > 150) exitWith{ //oncoming traffic at < 30º rotation
	//they're coming towards us
};

private _reldir = (_carfrontpos getDir _frontcar) - _cardir;
private _heading = [abs _reldir, 360 - (abs _reldir)] select (abs _reldir > 180);
if ((_heading + abs _delta) % 360 < 90 ) then{ //Facing both left and right
	//we're behind them
};

I'm sure it can be done in other/better ways but that's what it is right now.

You gotta debug those values to be sure they work for you.

I built most of the script placing a car with Zeus in front of my debug car and reading the output until it worked, moving and rotating it around with the mouse.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/23/2020 at 3:51 PM, RCA3 said:

private _cardir = getDir _car;
private _delta = [getDir _frontcar, _cardir] call BIS_fnc_getAngleDelta; //180º-0ºR -180º-0ºL

if (abs _delta > 150) exitWith{ //oncoming traffic at < 30º rotation
	//they're coming towards us
};

private _reldir = (_carfrontpos getDir _frontcar) - _cardir;
private _heading = [abs _reldir, 360 - (abs _reldir)] select (abs _reldir > 180);
if ((_heading + abs _delta) % 360 < 90 ) then{ //Facing both left and right
	//we're behind them
};

I'm sure it can be done in other/better ways but that's what's it is right now.

You gotta debug those values to be sure they work for you.

I built most of the script placing a car with Zeus in front of my debug car and reading the output until it worked, moving and rotating it around with the mouse.

 

Thank you for sharing! 

 

This is another way of finding who is in front and who is behind but will not check the dir. Still useful:

vAiDriving_isInFrontFnc = {
	params ["_vehicle", "_nearVehicle"];
	private _inFrontArc= false;
	_inFrontArc=[getPosATL _vehicle,(getDir _vehicle)-0,90,getPosATL _nearVehicle]call BIS_fnc_inAngleSector;
	_inFrontArc
};

vAiDriving_isBehindFnc = {
	params ["_vehicle", "_nearVehicle"];
	private _inBehindArc = false;
	_inBehindArc=[getPosATL _vehicle,(getDir _vehicle)-180,90,getPosATL _nearVehicle]call BIS_fnc_inAngleSector;
	_inBehindArc
};

 

  • Like 1

Share this post


Link to post
Share on other sites

Changelog:

v2.6.5 - Fixed: Addon and script versions were initializing twice per vehicle! (Init EH and GetIn EH). Sorry about that. Script version also changed initPlayerLocal.sqf.

                Added: "Motorcycle" class to addon version.

                Added: CUP patch for some APC's not initializing on addon version ("CUP_LAV25_Base","CUP_BTR80_Base","CUP_BTR80A_Base","CUP_BTR90_Base","CUP_AAV_Base").

  • Like 3

Share this post


Link to post
Share on other sites

Hi ^ ^
you may want to move aidrivingcontrol_CUP to an optional folder, because am getting error at the start up and RPT error as i dont have Cup in my load ; ) 

  • Like 1

Share this post


Link to post
Share on other sites

Hi @AirShark,

 

I always have "No Logs" on so I wasn't getting that popup message. Repackaged and updated. Thanks for the heads up!

Share this post


Link to post
Share on other sites

hello there ^ ^

i have found that your mod sets the fuel in vehicles to 0 when close by units

may i ask to disable it for players vehicle, and an option to disable it because sometimes the Ai disembark when the fuel is off especially with the unarmed vehicles 

however im using Ai mods so i dont know if it is the same case in vanilla .

  • Like 1

Share this post


Link to post
Share on other sites

Hi,

AIDC is only setting fuel 0 on tanks and when men are inside it's bounding box, it's a workaround to forceSpeed 0 not working 100% on tanks. As soon as people leave it's area, the fuel is restored.

If the crew disembarks it might be an mission setting, or an addon, but from my early tests it didn't happen in vanilla.

I'll add a variable you can pass to the vehicles you choose to disable removing the fuel (of tanks), but beware they will not stop as well. In a few days or so.

Cheers.

  • Thanks 2

Share this post


Link to post
Share on other sites
9 hours ago, RCA3 said:

Hi,

AIDC is only setting fuel 0 on tanks and when men are inside it's bounding box, it's a workaround to forceSpeed 0 not working 100% on tanks. As soon as people leave it's area, the fuel is restored.

If the crew disembarks it might be an mission setting, or an addon, but from my early tests it didn't happen in vanilla.

I'll add a variable you can pass to the vehicles you choose to disable removing the fuel (of tanks), but beware they will not stop as well. In a few days or so.

Cheers.

the only thing that bothers me in addition to mission breaks, is that it happens with the player vehicle as well,  i mean for the ai may be understandable but when i drive the tank and suddenly the fuel set to 0 its just annoying sometimes :))

 

edit: besides it happens with every iskindof tank, which includes IFVs and some APCs 😛

  • Like 1

Share this post


Link to post
Share on other sites

v.2.6.6 - Added: Ability to move vehicle, after it's fuel was removed, from men approaching vehicle.

                 Fixed: Script version wasn't initializing for vehicles with crew already in it.

 

Usage:

  • Hold movement keys for (up to) 3 seconds if your vehicle's fuel was removed and you're the commander.

- -

@AirShark,

Thanks again for reporting stuff, AirShark, as I wasn't aware of this problem.

I found a fix which keeps the best of both worlds, you can send your AI by clicking somewhere and they'll be alert, but when you key press command the vehicle the fuel won't be removed anymore will be restored 😁.

edit: i'm using vehicleMoveInfo.

 

On 12/4/2020 at 10:57 AM, AirShark said:

edit: besides it happens with every iskindof tank, which includes IFVs and some APCs 😛

Tracked only I believe, so they need that workaround too.

 

Cool, thanks.

Cheers!

  • Like 2

Share this post


Link to post
Share on other sites
On 12/12/2020 at 2:50 AM, 2LT Miller said:

I was wondering if you would put this up on steam workshop at any point? 🙂

 

Unfortunately, there's a couple of reasons I cannot upload to Steam (and it's not a cracked version of A3 😒). I appreciate the interest though, thank you.

Cheers!

Share this post


Link to post
Share on other sites
On 12/4/2020 at 5:12 AM, RCA3 said:

Hi,

AIDC is only setting fuel 0 on tanks and when men are inside it's bounding box, it's a workaround to forceSpeed 0 not working 100% on tanks. As soon as people leave it's area, the fuel is restored.

If the crew disembarks it might be an mission setting, or an addon, but from my early tests it didn't happen in vanilla.

I'll add a variable you can pass to the vehicles you choose to disable removing the fuel (of tanks), but beware they will not stop as well. In a few days or so.

Cheers.

 

Hi, RCA3! Thanks for your mod! it does great improvement of dumb vanilla A3 driving AI. very appretiate your work on it!

Is there any chance to get version of your mod with completely disabled "setting_fuel_to_0" workaround? sorry, but it seems, in large scenarios in heavy modded game it doesnt work 100% relyable. and it is better get a one or thwo dead pedestrians than one disabled tank. :) besides, there is Rydygier`s small mod "Liability Insurance" that really helps in such situations. 

maybe, you even could include its code in your mod as it is a kind of "open source".

  • Thanks 1

Share this post


Link to post
Share on other sites

i have found a bug, your mod is conflicting with GM CDLC for some reason, your mod makes their T-55 smoke shells and smoke generator invisible 

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

×