-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement mouse movement lock #1
Comments
Either update the mouse at fixed intervals in the frame function/hook (not every iteration). var int lastMouseUpdate;
const int mouseUpdateInterval = 50; // Time interval (ms) to update mouse
func void Spell_Invest_Blink(var int casterId) {
if (MEM_Timer.totaltime > lastMouseUpdate + mouseUpdateInterval) {
lastMouseUpdate = MEM_Timer.totaltime;
if (!aimModifier) { aimModifier = FLOATEINS; };
updateHeroYrot(aimModifier); // Outsourced since it might be useful for other spells/weapons as well (free aim)
};
// ...
}; Or create a separarte frame function for that. // A little redunant but, aimModifier changes and needs to be updated before every call
func void updateMouse() {
if (!aimModifier) { aimModifier = FLOATEINS; };
updateHeroYrot(aimModifier); // Outsourced since it might be useful for other spells/weapons as well (free aim)
};
const int mouseUpdateInterval = 50; // Time interval (ms) to update mouse
func void Spell_Invest_Blink(var int casterId) {
if (!FF_Active(updateHeroYrot) { FF_ApplyExt(updateMouse, mouseUpdateInterval, -1);
// ...
}; |
The modifier for different interframe intervals needs to be adjusted. (Lower frame-rate causes to fast movement at the moment). |
This modifier must be adjusted and tested: var int frameAdj; frameAdj = divf(MEM_Timer.frameTimeFloat, mkf(100)); // Adjust speed to fps (~= frame lock)
turnDeg = mulf(turnDeg, frameAdj); |
The above works for high frame rates (IFI 6), but is to fast for low frame rates (IFI 30). |
It does not help to hook the mouse movement directly. These are the data collected in-game:
|
Fix #1, #2, #5, #9 implements stable version The FX scripts are added and changed: Now the aiming FX is managed by The focus vob is no set to the aim vod which is an oCItem. This works The mouse is not really frame locked but rather scaled to the fps. The mouse sensitivity issue seems to be resolved by #1. (See #9) |
1 similar comment
Fix #1, #2, #5, #9 implements stable version The FX scripts are added and changed: Now the aiming FX is managed by The focus vob is no set to the aim vod which is an oCItem. This works The mouse is not really frame locked but rather scaled to the fps. The mouse sensitivity issue seems to be resolved by #1. (See #9) |
Mouse movement speed is different in different environments. It needs to be locked with framerame.
The text was updated successfully, but these errors were encountered: