Page 2 of 3

Re: Head Swaying from damage

Posted: Wed Apr 04, 2018 11:38 pm
by MeteoricDragon
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.

Re: Head Swaying from damage

Posted: Thu Apr 05, 2018 4:16 am
by Interkarma
There's no need to rotate the player object for this effect is there? You should just need to manipulate the camera transform. :)

Re: Head Swaying from damage

Posted: Thu Apr 05, 2018 2:16 pm
by R.D.
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?
The latter. The only value passed to the function that sets the "head-shaking amount" is the damage amount.

Re: Head Swaying from damage

Posted: Thu Apr 05, 2018 5:23 pm
by MeteoricDragon
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. :)
That worked!

Re: Head Swaying from damage

Posted: Fri Apr 06, 2018 1:20 am
by MeteoricDragon
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

Re: Head Swaying from damage

Posted: Fri Apr 06, 2018 2:30 am
by MeteoricDragon
For some reason, I am getting several null reference exceptions.

They stop occuring if I comment out this line in SettingsManager:

Code: Select all

 CameraRecoil = GetBool(sectionControls, "CameraRecoil");
EDIT: it didn't have the default value in the defaults.ini file

Re: Head Swaying from damage

Posted: Fri Apr 06, 2018 4:13 am
by MeteoricDragon
First version has been submitted via PR.

Re: Head Swaying from damage

Posted: Fri Apr 06, 2018 7:23 am
by Interkarma
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.

Re: Head Swaying from damage

Posted: Sat Apr 07, 2018 11:38 pm
by MeteoricDragon
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.

Re: Head Swaying from damage

Posted: Sun Apr 08, 2018 12:02 am
by Interkarma
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.