-
Notifications
You must be signed in to change notification settings - Fork 117
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
Fix the POV button in spectator mode #611
Conversation
Looks good but I think it shouldn't need to be in a separate file, maybe modify |
global function SpectatorPovButtonFixInit | ||
|
||
void function SpectatorPovButtonFixInit(){ | ||
RegisterButtonPressedCallback(MOUSE_MIDDLE, SwitchPov) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button callback needs to be only registered when spectating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registering and deregistering it would be pain, especially because all of the possible combinations of spectating/respawning/joining a game/switching players etc., so unless I manage do find proper callbacks for that I'd leave it as it is, since it only does something when spectating
Northstar.Client/mod/scripts/vscripts/spectator_pov_button_fix.nut
Outdated
Show resolved
Hide resolved
I think ideally we put it in the same file as the spectator UI? I don't see a reason why this needs to be specifically on the CLIENT vm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works now in testing for me, and I did a formatting and code pass, so LGTM
(since I have commits on this PR now, another reviewer would be appreciated)
I now disagree with myself here, since this is more of a temp fix than a permanent solution (ideally we find the root cause of |
I found out that this can be fixed on pure server-side, by adding 0.1s spectator replay delay while in third person spec mode if ( target.IsPlayer() )
{
try
{
player.SetObserverTarget( target )
player.StartObserverMode( OBS_MODE_CHASE )
player.SetSpecReplayDelay( 0.1 ) // at least 0.1s specReplayDelay is required for client to know that player is spectating, and they can send "spec_mode" client command
}
catch ( ex ) { }
} the same file, in function bool function ClientCommandCallback_spec_mode( entity player, array<string> args )
{
// currently unsure how this actually gets called on client, works through console and has references in client.dll tho
if ( player.GetObserverMode() == OBS_MODE_CHASE )
{
// set to first person spectate
player.SetSpecReplayDelay( FIRST_PERSON_SPECTATOR_DELAY )
player.SetViewEntity( player.GetObserverTarget(), true )
player.StartObserverMode( OBS_MODE_IN_EYE )
}
else if ( player.GetObserverMode() == OBS_MODE_IN_EYE )
{
// set to third person spectate
player.StartObserverMode( OBS_MODE_CHASE )
player.SetSpecReplayDelay( 0.1 ) // at least 0.1s specReplayDelay is required for client to know that player is spectating, and they can send "spec_mode" client command
}
return true
} |
Recon you could do a small Pr with these changes ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be cool if the above suggestions get implemented.
@Khalmee is this PR stale? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superseded by #706
(will close once other one gets merged)
Pressing the Middle Mouse Button while spectating switches POV from 3rd to 1st person, just like how it works in vanilla.