RHS Feedback - AFRF
View Issue Details
0003977AFRF[All Projects] Generalpublic2018-02-11 10:332018-02-11 13:54
0003977: Mi-24 9S475 script is unreliable
"\rhsafrf\addons\rhs_optics\scripts\RHS_sight_9s475.sqf" script becomes unreliable with plenty of other scripts producing script lag:
1. Weapons can randomly be deleted and not re-added, forever leaving gunner seat without minigun or atgm launcher (https://steamuserimages-a.akamaihd.net/ugc/930427026037180089/2B40C42303146FD33216135EE5769FFAC06A8E8C/ [^] notice no weapon in top right)
2. Gunner memory point doesn't animate instantly after view mode change due to script lag, making you see holo sight through scope for few seconds
I reviewed the script and decided to rewrite it to make it work in unscheduled environment to avoid being affected by script lag, as well as got rid of constant weapon deletion and re-addition. Instead of deleting weapons, it simply doesn't let you switch to guided weapons when you're not looking through scope and automatically switches when you change optics mode, script should be universal for any weapons in any cases as it checks for canLock config value.

https://pastebin.com/raw/ASnKkddu [^] (stabilization included)

Tested script in closed environment and it seems to work fine. Didn't test with AI or when saving\loading the game, though it should work fine.

Please feel free to use my script in the mod.
No tags attached.
Issue History
2018-02-11 10:33Sa-MatraNew Issue
2018-02-11 10:33Sa-MatraDescription Updatedbug_revision_view_page.php?rev_id=5063#r5063
2018-02-11 10:34Sa-MatraDescription Updatedbug_revision_view_page.php?rev_id=5064#r5064
2018-02-11 10:49reyhardNote Added: 0007440
2018-02-11 10:53reyhardNote Edited: 0007440bug_revision_view_page.php?bugnote_id=7440#r5066
2018-02-11 10:55reyhardNote Edited: 0007440bug_revision_view_page.php?bugnote_id=7440#r5067
2018-02-11 12:39Sa-MatraNote Added: 0007441
2018-02-11 13:44Sa-MatraNote Added: 0007442
2018-02-11 13:52Sa-MatraNote Edited: 0007442bug_revision_view_page.php?bugnote_id=7442#r5069
2018-02-11 13:54Sa-MatraAdditional Information Updatedbug_revision_view_page.php?rev_id=5071#r5071

2018-02-11 10:49   
(edited on: 2018-02-11 10:55)
I will take a look at it.
just a not about 2) - in tank dlc there is native support for multi gunner view point so animating gunner view point will be probably removed from script completely since there will be no need for that at all

another note is about execution of that script on each frame. I will probably simplify that and remove that loop and use key event handler instead.

Anyway, thanks for idea for using selectWeapon instead of add/removing weapons which indeed was quite problematic. Cheers!

2018-02-11 12:39   
Well, this each frame script is rather small and executes only when you're Mi-24 gunner, usual execution is few commands, unless mode or weapon changes, so performance impact should a drop in the ocean really, plus you need to animate angle control and per frame will always give 100% smooth picture.

Also, optimized script a tiny bit, moving few setVariables inside weapon or mode change condition: https://pastebin.com/raw/y1NBRBZt [^]
2018-02-11 13:44   
(edited on: 2018-02-11 13:52)
Added turret locking: https://pastebin.com/raw/ASnKkddu [^] (Tweaked)