Page MenuHomeFeedback Tracker

If drop item while player stay on car, it falls to the ground under the car or in to textures of car under player in 1.08 Experemental
Closed, ResolvedPublic

Description

If player drop item while stay on car, item falls to the ground under the car or in to textures of car under player

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 7
Category
General
Steps To Reproduce

1.08 Experemental
Stay on car
Drop item from hands by press G or move from invenory
Item falls on any surface under car

Event Timeline

borizz.k created this task.Jun 24 2020, 9:56 AM
AXEL7 added a subscriber: AXEL7.Jun 24 2020, 2:31 PM

HaHa

Zombies walks through car textures :-)))) Good job...

Geez closed this task as Resolved.Jun 25 2020, 1:11 PM
Geez claimed this task.
Geez added a subscriber: Geez.

Hello borizz.k and thank you for the report.
The items cannot be dropped on top of a vehicle due to a technical limitation and there is not an easy solution to this at the moment.
Regards,
Geez


Zombies walks through cars

Lex added a subscriber: Lex.EditedJun 26 2020, 6:27 AM

Hello borizz.k and thank you for the report.
The items cannot be dropped on top of a vehicle due to a technical limitation and there is not an easy solution to this at the moment.
Regards,
Geez

How did it turn out to be complicated at a time when it worked well in 1.07?

I fix it for 1.08 exp
resolve of this issue have two very easy ways

  1. In itemBase class (better way)
  2. In HandActionDrop class (only for drop by G key)
borizz.k added a comment.EditedJun 26 2020, 10:43 PM

Demonstration
If need, i can publish code (after corrections)

Lex added a comment.Jun 27 2020, 12:02 AM

Demonstration
If need, i can publish code (after corrections)

Tell me, how long did it take you - creating code to change the task? I'm just wondering how much time you need to spend evaluating the problem and finding a fix to the problem.

This comment was removed by borizz.k.
borizz.k added a comment.EditedJun 28 2020, 1:03 PM

Code

modded class ItemBase extends InventoryItem
{
	
	override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
	{
		super.EEItemLocationChanged(oldLoc,newLoc);
		
		if (newLoc.GetType() == InventoryLocationType.GROUND)
		{
			if (oldLoc.GetParent())
			{
				PlayerBase player = PlayerBase.Cast(oldLoc.GetParent());
				if (player)
				{
					FixPositionIfDropOnCar(player);
				}
			}
		}
	}

	void FixPositionIfDropOnCar(PlayerBase player)
	{
		vector 		m_RayStart;
		vector 		m_RayEnd;

		m_RayStart = player.GetPosition();
		m_RayStart[1] = m_RayStart[1] + 0.5;
		m_RayEnd = m_RayStart;
		m_RayEnd[1] = m_RayEnd[1] - 1;
		
		RaycastRVParams m_RayCastInput = new RaycastRVParams(m_RayStart, m_RayEnd, this, 0.05);
		array<ref RaycastRVResult> m_RayCastResults = new array<ref RaycastRVResult>;
		m_RayCastInput.with = player;
		m_RayCastInput.flags = CollisionFlags.FIRSTCONTACT;

		if (DayZPhysics.RaycastRVProxy(m_RayCastInput, m_RayCastResults))
		{
			if (m_RayCastResults.Count() > 0)
			{
				Car car;
				if (Class.CastTo(car, m_RayCastResults[0].obj) || Class.CastTo(car, m_RayCastResults[0].parent))
				{
					this.SetPosition(m_RayCastResults[0].pos + (player.GetDirection() * 0.1));
				}
			}
		}
	}
}
Geez added a comment.Jun 29 2020, 12:32 PM

Hello borizz.k and thank you for the report.
The items cannot be dropped on top of a vehicle due to a technical limitation and there is not an easy solution to this at the moment.
Regards,
Geez

How did it turn out to be complicated at a time when it worked well in 1.07?

This is due to the recent changes implemented in 1.08.

nigel added a subscriber: nigel.Jun 29 2020, 6:02 PM
borizz.k added a comment.EditedJun 29 2020, 9:36 PM

Hello borizz.k and thank you for the report.
The items cannot be dropped on top of a vehicle due to a technical limitation and there is not an easy solution to this at the moment.
Regards,
Geez

How did it turn out to be complicated at a time when it worked well in 1.07?

This is due to the recent changes implemented in 1.08.

yeah, broke again
repair one but break another...

I think raycasting is very expensive and propably consume too much server power.