Page MenuHomeFeedback Tracker

Plase make attacking to players by AI more moddable when player in vehicle
Feedback, UrgentPublic

Description

Right now is attacking completely disabled. Modding is possible, but when multiple mods trying to do, it can very easy leads to conflicts.

Why I am proposing this improvement?

We have opened vehicles like bicycles, motorcycles, or even cars where are doors not attached.

So its logical that AI can hurt crew.

Please make in carsript something like this:

in CarScript:

bool CanBeCrewTargettedbyAI()
{
	return false;
	//or detect if all doors are present and not opened
}

in PlayerBase:

	override bool CanBeTargetedByAI(EntityAI ai)
	{
		#ifdef DIAG_DEVELOPER
		if (!m_CanBeTargetedDebug)
		{
			return false;
		}
		#endif
		
		return super.CanBeTargetedByAI(ai) && !IsUnconscious() && !IsInVehicle();
		// modify this and instead detecting if he is crew of vehicle detect also if crew can be targetted by methid above
	}

in ZombieBase:

bool FightAttackLogic(int pCurrentCommandID, DayZInfectedInputController pInputController, float pDt)
	{
		// always update target - it can be destroyed		
		m_ActualTarget = pInputController.GetTargetEntity();
		
		//! do not attack players in vehicle - hotfix
		PlayerBase pb = PlayerBase.Cast(m_ActualTarget);
		if (pb && pb.GetCommand_Vehicle())
			return false;
		//modify this and use proposed method in CarScript to detect if crew can be attacked
		
same in chase attack logic

bool ChaseAttackLogic(int pCurrentCommandID, DayZInfectedInputController pInputController, float pDt)
	{
		// always update target - it can be destroyed		
		m_ActualTarget = pInputController.GetTargetEntity();
		
		//! do not attack players in vehicle - hotfix
		PlayerBase pb = PlayerBase.Cast(m_ActualTarget);
		if ( pb && pb.GetCommand_Vehicle() )
		{
			return false;
		}
		//modify this and use proposed method in CarScript to detect if crew can be attacked

As you can see, that main reason is that hotfix in ZombieBase which is not easy moddable, when you want allow be modded by multiple mods.
My proposal will solve that problem and allow us to mod AI behaviour better and without conflicting with other mods.

Please think about this improvement.

Details

Severity
Tweak
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10
Category
General
Steps To Reproduce

enter vehicle
check if AI can attack you, when door missing

Additional Information

Will be very useful for vehicles like quadbike, bikes, bicycles which are already added by modders.

Event Timeline

Hunterz created this task.May 26 2024, 8:17 AM
Tyson added a subscriber: Tyson.May 26 2024, 9:20 AM
Geez changed the task status from New to Feedback.May 27 2024, 11:10 AM