Skip to content

Conversation

@ExtraDrowsy
Copy link

@ExtraDrowsy ExtraDrowsy commented Jan 12, 2022

This is to address issue #106 for head waving/bobbing. Based on the discussion that already took place:

  • The head and weapon wave/bob together.
  • In the original game (and TFE) both can be disabled together using the F6 key.
  • A request was made to allow the head wave to be disabled but keep the weapon wave on.

To do this I added a new checkbox type setting to the "Hud" settings that controls weapon waving independently/separately from head waving.

At first I considered making this a hotkey like "head wave" but decided it was not ideal for the following reasons:

  • Separate weapon wave functionality are not part of the original game, the hotkeys are.
  • The hotkeys appear to rely on original game files (I might be wrong), like Strings in .msg files that render as on/off messages to the screen when the F6 hotkey is pressed. Those Strings belong to the game not the source engine/port and I think original/base game files should always be utilized in a read-only manner which means rather than running through the same code that looks through the parsed .msg files, we'd have to have something that sources the Strings from literals in code or some other file.
  • Having two hotkeys for waving seemed a bit excessive.

- Dark Forces: add new setting for weapon wave under "Hud" settings
- Dark Forces: apply new weapon wave setting to separate from head wave
@ExtraDrowsy ExtraDrowsy force-pushed the feat_separateWeaponWave branch from fd4caa7 to 885f36b Compare January 12, 2022 06:18
@@ -1830,69 +1830,76 @@ namespace TFE_DarkForces
//s_282344 = 34 - dH;
}

Copy link
Author

Choose a reason for hiding this comment

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

This diff below looks big but all of the lines from this point to :1844 are unchanged except for the following:

  • I removed the if block that starts on line :1836 and thus all of the code within that block down to :1885 was indented left-ward (hence why the diff looks large). I removed it because we now need to run these calculations regardless of whether head waving is on since these are used for weapon waving.
  • Any assignments to s_headwaveVerticalOffset in this range of code now assign to a new local variable headwaveVerticalOffset (see :1835). I essentially avoid modifying s_headwaveVerticalOffset until I know the head waving is on and needs to be applied since modifying s_headwaveVerticalOffset alters how player projectiles (like lasers from the blaster) are calculated.

}
}
setCameraOffset(0, s_headwaveVerticalOffset, 0);

Copy link
Author

Choose a reason for hiding this comment

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

The code below is where the condition was moved to and what ultimately separates the head waving and weapon waving, as well as applying the new setting.

@luciusDXL
Copy link
Owner

Hello, thanks for all the work with this. I have been focused on the GPU Renderer and version 1.0 but I will take a look at what you did here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants