Skip to content

Commit

Permalink
Beta 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilsnd committed Oct 24, 2020
1 parent cd91c92 commit b7a1132
Show file tree
Hide file tree
Showing 104 changed files with 7,117 additions and 1,380 deletions.
28 changes: 26 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,29 @@ SmoothCam/bin
SmoothCam/bin-obj
enc_temp_folder/

MCM/SmoothCamMCM.psc
CodeGen/gen_addrmap/*.txt
SmoothCamMCM.psc
CodeGen/gen_addrmap/*.txt
/blend
*.blend
*.blend1
*.bin

.dub
docs.json
__dummy.html
docs/
CodeGen/ModelBaker/ModelBaker
CodeGen/ModelBaker/*.bin
CodeGen/ModelBaker/*.obj
CodeGen/ModelBaker/compiled_libs
CodeGen/ModelBaker/compiled_libs_debug
ModelBaker.so
ModelBaker.dylib
ModelBaker.dll
ModelBaker.a
ModelBaker.lib
ModelBaker-test-*
*.exe
*.o
*.obj
*.lst
37 changes: 36 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
## Beta 1.2
* Bumped module and MCM version number to 11

**Fixes:**
* Added some extra sanity checking in crosshair update code to try and prevent a crash when using bows.
* Fixed mouse buttons not responding to the shoulder switch command.
* Fixed broken ranged kill moves.
* Fixed sneaking offsets taking precedence over bow-aiming offsets.
* Staves now correctly enable the magic crosshair and offset modes.
* Fixes for Wrath of Nature, Apocalypse and Triumvirate (And possibly others).
* Better IFPV compat.
* Made the HUD code less aggressive about setting crosshair parameters, should hopefully be more compatible with HUD mods.
* Added loading-screen detection to prevent manipulation of the HUD during cell transitions - Might reduce the chances of a strange Scaleform crash from happening.
* Fixed camera jitter when closing the tween (inventory) menu.
* Reduced extreme position change when dismounting horse - now preventing the transition camera from running.
* Better detection of POV slide mode (Holding F while in third-person), slide mode no longer interferes with the 3D crosshair position.
* Corrections to crosshair trajectory patch when on horseback.
* Corrected transitions to free cam mode having the wrong position/rotation (maybe).

**New Stuff:**
* Added a new system to allow users to specify a list of bone names for the camera to search for, useful for mods that replace the player skeleton with one using names that don't match the regular skeleton. A more detailed description can be found in the new file "SmoothCam_FollowBones_Default.txt".
* Added smoothing between states when the old state has interpolation enabled and the new one doesn't.
* Added arrow trajectory prediction to the 3D crosshair (Will now account for gravity over longer distances). This option is separate from the normal raycasting method - If you feel like this option is cheating, you can simply ignore it.
* Added an arrow trajectory visualization option, drawing an arc that shows where your arrows should go (Requires enabling new option 'EnableArrowPrediction' combined with the 3D ranged crosshair being enabled, Color can be changed in MCM).
* New 3D crosshair system, independent from the HUD crosshair - Draws genuine 3D crosshair models in game space. A few different styles are included. You can either use this new system or the HUD crosshair - by default, the HUD crosshair is used.
* Added a D utility to convert a 3D mesh into a text-based hex array, for pasting in header files (Note: Building this is not required in any way to build the mod - If you wish to build this tool, at a minimum you'll need dub, DMD, CMake and a built copy of assimp, statically linked).
* Debug overlay (with correct build defines set in pch) to help visualize issues.

**Changes:**
* There has been some confusion about the inclusion of the address library binary file - As of 1.2b, SmoothCam no longer includes this file for you - It is now a genuine dependency.
* Removed the crosshair size hit character setting (for now), until we can better determine if a ray hit a character.
* Located the dxgi swapchain global, dropped the memory scanner.
* Dropped old debug drawing code, wrote new D3D utility code for more general purpose use.
* Random code base housekeeping. Consolidated MCM code generator with rest of the generators.

## Beta 1.1
* Bumped module and MCM version number to 10
* Added a compatibility patch for Immersive First Person View.
Expand All @@ -24,7 +59,7 @@
* Bumped module and MCM version number to 8
* Added a "group edit" tab in the MCM, allowing users to edit all offset groups at once.
* Increased the maximum slider range for "MinFollowDistance" from 64 to 256.
* Fixed the crosshair position being wrong with ultrawide aspect ratios - TEST WITH ULTRATALL
* Fixed the crosshair position being wrong with ultrawide aspect ratios.
* Config now reads Skyrim.ini and will use user supplied `f3PArrowTiltUpAngle` and `f3PBoltTiltUpAngle` if found.
* Opt-in option for crosshair size manipulation.
* Added "ZoomOffset" settings to offset groups, allowing the camera to offset the zoom level in/out on different state transitions.
Expand Down
File renamed without changes.
Binary file added CodeGen/MCM/SmoothCamMCM.pex
Binary file not shown.
122 changes: 111 additions & 11 deletions MCM/mcm.psc → CodeGen/MCM/mcm.psc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Import SKSE

string[] interpMethods
string[] presets
string[] crosshairTypes

Function SmoothCam_SetIntConfig(string member, int value) global native
Function SmoothCam_SetStringConfig(string member, string value) global native
Expand All @@ -21,13 +22,13 @@ string Function SmoothCam_SaveAsPreset(int index, string name) global native
bool Function SmoothCam_LoadPreset(int index) global native
string Function SmoothCam_GetPresetNameAtIndex(int index) global native

int Function GetCurrentInterpIndex(string setting)
int Function GetCurrentArrayIndex(string setting, string[] array)
string value = SmoothCam_GetStringConfig(setting)

Int i = interpMethods.Length
Int i = array.Length
While i
i -= 1
if (interpMethods[i] == value)
if (array[i] == value)
return i
endIf
endWhile
Expand Down Expand Up @@ -117,20 +118,21 @@ endFunction
string settingName = ""
string displayName = ""
string desc = ""
LITERAL arrayType = 0

MACRO implControl = {
this->ref = AddMenuOption(this->displayName, interpMethods[GetCurrentInterpIndex(this->settingName)])
this->ref = AddMenuOption(this->displayName, this->arrayType[GetCurrentArrayIndex(this->settingName, this->arrayType)])
}

MACRO implOpenHandler = {
SetMenuDialogStartIndex(GetCurrentInterpIndex(this->settingName))
SetMenuDialogStartIndex(GetCurrentArrayIndex(this->settingName, this->arrayType))
SetMenuDialogDefaultIndex(0)
SetMenuDialogOptions(interpMethods)
SetMenuDialogOptions(this->arrayType)
}

MACRO implAcceptHandler = {
SetMenuOptionValue(a_option, interpMethods[a_index])
SmoothCam_SetStringConfig(this->settingName, interpMethods[a_index])
SetMenuOptionValue(a_option, this->arrayType[a_index])
SmoothCam_SetStringConfig(this->settingName, this->arrayType[a_index])
}

MACRO implDesc = {
Expand Down Expand Up @@ -223,7 +225,7 @@ endFunction
}

ScriptMeta scriptMetaInfo -> {
version: 10
version: 11
}

; Presets
Expand Down Expand Up @@ -366,26 +368,31 @@ ListSetting interpMethod -> {
settingName: "InterpolationMethod"
displayName: "Interpolation Method"
desc: "The scalar method to use for camera smoothing."
arrayType: interpMethods
}
ListSetting sepZInterpMethod -> {
settingName: "SeparateZInterpMethod"
displayName: "Sep. Z Interpolation Method"
desc: "The scalar method to use for smoothing the camera height (If enabled)."
arrayType: interpMethods
}
ListSetting sepLocalInterpMethod -> {
settingName: "SepLocalInterpMethod"
displayName: "Local-Space Interpolation Method"
desc: "The scalar method to use for local-space smoothing (If enabled)."
arrayType: interpMethods
}
ListSetting offsetInterpMethod -> {
settingName: "OffsetTransitionMethod"
displayName: "Offset Interpolation Method"
desc: "The scalar method to use for offset transition smoothing (If enabled)."
arrayType: interpMethods
}
ListSetting zoomInterpMethod -> {
settingName: "ZoomTransitionMethod"
displayName: "Zoom Interpolation Method"
desc: "The scalar method to use for zoom transition smoothing (If enabled)."
arrayType: interpMethods
}

SliderSetting minCameraFollowRate -> {
Expand Down Expand Up @@ -574,6 +581,22 @@ ToggleSetting crosshair3DMagicEnabled -> {
displayName: "3D Magic Crosshair Enabled"
desc: "Enable the raycasted 3D crosshair when using magic."
}
ToggleSetting crosshair3DWorldEnabled -> {
settingName: "UseWorldCrosshair"
displayName: "Use World-Space Crosshair"
desc: "When your crosshair ray has hit something, use a crosshair mesh rendered in-world, not on the HUD."
}
ListSetting worldCrosshairType -> {
settingName: "WorldCrosshairType"
displayName: "Crosshair Type"
desc: "Select the style of world-space crosshair to use, if world-space crosshair is enabled."
arrayType: crosshairTypes
}
ToggleSetting worldCrosshairDepthTest -> {
settingName: "WorldCrosshairDepthTest"
displayName: "Crosshair Occlusion"
desc: "When using the world-space crosshair, disable this option to make it draw on top of everything rather than allow other geometry to cover it."
}
ToggleSetting hideCrosshairOutOfCombat -> {
settingName: "HideCrosshairOutOfCombat"
displayName: "Hide Non-Combat Crosshair"
Expand Down Expand Up @@ -616,6 +639,66 @@ SliderSetting crosshairMaxDistSize -> {
min: 8
max: 32
}
ToggleSetting enableArrowPrediction -> {
settingName: "EnableArrowPrediction"
displayName: "Enable Arrow Prediction"
desc: "When the 3D crosshair is enabled for ranged combat, the crosshair will account for gravity when aiming with a bow."
}
ToggleSetting drawArrowArc -> {
settingName: "DrawArrowArc"
displayName: "Draw Arrow Prediction Arc"
desc: "When the 3D crosshair is enabled for ranged combat and 'Enable Arrow Prediction' is selected, an arc will be drawn while aiming with bows which indicates the flight path your arrow will take."
}
SliderSetting maxArrowPredictionRange -> {
settingName: "MaxArrowPredictionRange"
displayName: "Max Arrow Prediction Distance"
desc: "The furthest distance to allow arrow prediction, if enabled, to function."
defaultValue: 10000
interval: 1
min: 500
max: 12000
displayFormat: "{0}"
}
SliderSetting arrowArcColorR -> {
settingName: "ArrowArcColorR"
displayName: "Arrow Arc Color: Red"
desc: "The amount of red coloration to add to the arrow arc."
defaultValue: 255.0
interval: 1
min: 0.0
max: 255.0
displayFormat: "{0}"
}
SliderSetting arrowArcColorG -> {
settingName: "ArrowArcColorG"
displayName: "Arrow Arc Color: Green"
desc: "The amount of green coloration to add to the arrow arc."
defaultValue: 255.0
interval: 1
min: 0.0
max: 255.0
displayFormat: "{0}"
}
SliderSetting arrowArcColorB -> {
settingName: "ArrowArcColorB"
displayName: "Arrow Arc Color: Blue"
desc: "The amount of blue coloration to add to the arrow arc."
defaultValue: 255.0
interval: 1
min: 0.0
max: 255.0
displayFormat: "{0}"
}
SliderSetting arrowArcColorA -> {
settingName: "ArrowArcColorA"
displayName: "Arrow Arc Color: Transparency"
desc: "The amount of transparency coloration to add to the arrow arc."
defaultValue: 127.0
interval: 1
min: 0.0
max: 255.0
displayFormat: "{0}"
}

; Standing
SliderSetting standing_sideOffset -> {
Expand Down Expand Up @@ -1387,6 +1470,13 @@ event OnConfigInit()
"circularEaseInOut", "exponentialEaseIn", "exponentialEaseOut",
"exponentialEaseInOut"
}
crosshairTypes = new string[] -> {
"Skyrim", "Dot"
}
endEvent

event OnVersionUpdate(int version)
OnConfigInit()
endEvent

event OnPageReset(string a_page)
Expand Down Expand Up @@ -1447,14 +1537,24 @@ event OnPageReset(string a_page)
elseIf (a_page == " Crosshair")
AddHeaderOption("3D Crosshair Settings")
IMPL_STRUCT_MACRO_INVOKE_GROUP(implControl, {
crosshair3DBowEnabled, crosshair3DMagicEnabled, enableCrosshairSizeManip,
crosshairNPCGrowSize, crosshairMinDistSize, crosshairMaxDistSize
crosshair3DBowEnabled, crosshair3DMagicEnabled,
crosshair3DWorldEnabled, worldCrosshairType, worldCrosshairDepthTest,
enableCrosshairSizeManip, crosshairMinDistSize,
crosshairMaxDistSize
})

AddHeaderOption("Crosshair Hiding")
IMPL_STRUCT_MACRO_INVOKE_GROUP(implControl, {
hideCrosshairOutOfCombat, hideCrosshairMeleeCombat,
})

SetCursorPosition(1)
AddHeaderOption("Archery Features")
IMPL_STRUCT_MACRO_INVOKE_GROUP(implControl, {
enableArrowPrediction, drawArrowArc, maxArrowPredictionRange,
arrowArcColorR, arrowArcColorG, arrowArcColorB,
arrowArcColorA,
})
elseIf (a_page == " Standing")
AddHeaderOption("Standing Offsets")
IMPL_STRUCT_MACRO_INVOKE_GROUP(implControl, {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Running the preprocessor:
lua do_preproc.lua path/to/my/script.psc path/to/my/output.psc
]]
package.path = "../../shared/?.lua;"

local args = { ... }
assert( args[1] )
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions CodeGen/ModelBaker/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/ModelBaker.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false
}
]
}
29 changes: 29 additions & 0 deletions CodeGen/ModelBaker/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "dub",
"run": true,
"compiler": "dmd",
"archType": "x86_64",
"buildType": "debug",
"configuration": "application-debug",
"_generated": true,
"problemMatcher": [
"$dmd"
],
"group": "build"
},
{
"label": "Build Release",
"type": "shell",
"command": "./build_rel.bat",
"problemMatcher": [
"$dmd"
],
"group": "build"
}
]
}
2 changes: 2 additions & 0 deletions CodeGen/ModelBaker/build_rel.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
C:\D\dmd2\windows\bin\dub.exe run --compiler=C:\D\ldc\bin\ldc2 --arch=x86_64 --build=release --config=application-release
Loading

0 comments on commit b7a1132

Please sign in to comment.