Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync fire extinguishers FX #1884

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tornac1234
Copy link
Collaborator

@tornac1234 tornac1234 commented Oct 28, 2022

Only issue is player rotation. On the local player, we are able to turn around as much as we want and spray the fire extinguisher everywhere. But remote players don't have this rotation thing. They can only rotate to the lower side (a little angle is possible only). So we'll always see the extinguisher facing downwards.

EDIT: The fix is to only rotate the FX

And this branch is built on #1878

https://youtu.be/LyenVi8g9fk

To be reviewed and looked at after #2012

@Jannify
Copy link
Member

Jannify commented Oct 30, 2022

Needs rebase since #1878 is merged

@tornac1234
Copy link
Collaborator Author

I'll probably look a bit more into it concerning the fire extinguisher's rotation

@tornac1234 tornac1234 force-pushed the sync-fire-extinguishers branch 2 times, most recently from d3c1491 to a88dff2 Compare October 30, 2022 20:59
@dartasen dartasen marked this pull request as draft November 14, 2022 14:01
…ffect rotation according to where the player is really aiming
@tornac1234 tornac1234 marked this pull request as ready for review August 7, 2023 13:31
using NitroxModel.DataStructures.Util;
using NitroxModel.Helper;
using NitroxModel.Packets;
using System;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong sorting

public static bool Prefix(FireExtinguisher __instance)
{
// Only for remote players' fire extinguishers
if (__instance.transform.TryGetComponentInAscendance(12, out RemotePlayerIdentifier identifier))
Copy link
Member

@Jannify Jannify Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason one is 12 and the other 2?

using NitroxClient.Unity.Helper;
using NitroxModel.DataStructures;
using NitroxModel.Helper;
using System.Reflection;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong sorting

@@ -0,0 +1,17 @@
using NitroxModel.DataStructures;
using System;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong sorting

using NitroxClient.GameLogic.PlayerLogic;
using NitroxModel.DataStructures;
using NitroxModel.Packets;
using System.Collections.Generic;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong sorting

Comment on lines +73 to +86
// Equivalent of UpdateTarget but with references to the remote player
fireExtinguisher.fireTarget = null;
Vector3 vector = default;
GameObject gameObject = null;

TraceRemotePlayerTargetPosition(identifier.transform.position, playerRotation, identifier.gameObject, 8f, ref gameObject, ref vector, true);
if (gameObject)
{
Fire componentInHierarchy = UWE.Utils.GetComponentInHierarchy<Fire>(gameObject);
if (componentInHierarchy)
{
fireExtinguisher.fireTarget = componentInHierarchy;
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for vfx and sound?

@tornac1234
Copy link
Collaborator Author

tornac1234 commented Nov 15, 2023

Will wait for a movement fix PR to be merged before continuing this one

@tornac1234 tornac1234 added the Area: player Related to player character actions label Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: player Related to player character actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants