Head Swaying from damage
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
Re: Head Swaying from damage
I've refined and adjusted the recoil formula with great smooth improvements, and in doing so I found out that whenever the playerObject is rotated about the x axis, it affects the object's position, and he starts moving back or forward some. If i rotate it about the y axis, no unwanted movement happens. I suspect it's the playermotor class trying to readjust the player, thinking he's supposed to slide.
- Interkarma
- Posts: 7253
- Joined: Sun Mar 22, 2015 1:51 am
Re: Head Swaying from damage
There's no need to rotate the player object for this effect is there? You should just need to manipulate the camera transform.
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: Head Swaying from damage
The latter. The only value passed to the function that sets the "head-shaking amount" is the damage amount.Al-Khwarizmi wrote: ↑Wed Apr 04, 2018 6:13 pm Aren't there damage types in Daggerfall? (e.g. the thing that makes blunt weapons more damaging to skeletons). Couldn't that have an influence? Or does reverse engineering indicate that it's definitely just damage amount?
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
Re: Head Swaying from damage
That worked!Interkarma wrote: ↑Thu Apr 05, 2018 4:16 am There's no need to rotate the player object for this effect is there? You should just need to manipulate the camera transform.
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
Re: Head Swaying from damage
The script is completely working now. It scales based on damage. It recoils on a random axis each time.
However, it's not configurable yet. I need to research how to put it in the pre-launch gameplay settings because I don't know which cs class has those settings. yet.
EDIT: I found the windows. And decided on using the Controls Section to store the value
However, it's not configurable yet. I need to research how to put it in the pre-launch gameplay settings because I don't know which cs class has those settings. yet.
EDIT: I found the windows. And decided on using the Controls Section to store the value
Last edited by MeteoricDragon on Fri Apr 06, 2018 2:31 am, edited 1 time in total.
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
Re: Head Swaying from damage
For some reason, I am getting several null reference exceptions.
They stop occuring if I comment out this line in SettingsManager:
EDIT: it didn't have the default value in the defaults.ini file
They stop occuring if I comment out this line in SettingsManager:
Code: Select all
CameraRecoil = GetBool(sectionControls, "CameraRecoil");
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
Re: Head Swaying from damage
First version has been submitted via PR.
- Interkarma
- Posts: 7253
- Joined: Sun Mar 22, 2015 1:51 am
Re: Head Swaying from damage
Thanks for your work on this! I will check it out and merge as soon as I get a chance. Will let you know any feedback via comments on git.
- MeteoricDragon
- Posts: 141
- Joined: Mon Feb 12, 2018 8:23 pm
Re: Head Swaying from damage
I notice that you are testing. Coincidentally I made a version with a slider in advanced settings (instead of tick mark in first page) where you can scale how severe the camera sways, with settings "Off, Low, Medium, High, and Very High" which scale the sway 0%, 25%, 50%, 75%, and 100% respectively.
If you launched a game with the first version I gave you, the settings.ini file will have CameraRecoil = True which will cause an exception when launching. can easily be fixed by setting CameraRecoil to a number from 0 to 4.
If you launched a game with the first version I gave you, the settings.ini file will have CameraRecoil = True which will cause an exception when launching. can easily be fixed by setting CameraRecoil to a number from 0 to 4.
- Interkarma
- Posts: 7253
- Joined: Sun Mar 22, 2015 1:51 am
Re: Head Swaying from damage
That sounds great!
If you remove the default setting from defaults.ini, it should be removed from the player's live settings.ini. This makes it possible to add and remove settings or change the name to force a new version type.
So instead of changing CameraRecoil setting from a bool to a float type setup, you can just change the name to something like CameraRecoilAmount (or whatever makes sense to you here as the creator). Then the old setting should sync out and the new setting take over in current code without an exception.
When you're done, send the changes to my "camera-recoil" branch. I won't merge this into master until you're done.
If you remove the default setting from defaults.ini, it should be removed from the player's live settings.ini. This makes it possible to add and remove settings or change the name to force a new version type.
So instead of changing CameraRecoil setting from a bool to a float type setup, you can just change the name to something like CameraRecoilAmount (or whatever makes sense to you here as the creator). Then the old setting should sync out and the new setting take over in current code without an exception.
When you're done, send the changes to my "camera-recoil" branch. I won't merge this into master until you're done.