Add Dynamic Support Menu (DSM)#167
Merged
ultranoobian merged 29 commits intoDUWS-R-Team:masterfrom Mar 14, 2018
Merged
Conversation
'dynamic_menu.sqf' checks against purchased supports, creates and updates global menus
Populated root menu, submenus (offensive, logistics and transports), with both active and inactive menu types. Included proper function triggering for each support.
Watchdog time variables will replace internal `sleep` commands to prevent spamming of 'timed' supports
…tly to the comm menu
Fixed mission dialogue such that if FOB cannot be deployed due to nearby enemies, dialogue will now be shown. Added extra mission dialogue to intuitively show how many enemies are remaining inside the deployment zone.
Changed other instances of 'PAPABEAR sideChat ...' into proper format
Replaced with timeout logic using global variable
FLIR is a user action rather than CommMenuItem
Changed mistyped variable name
Added documentation and cleaned up code-style Made small refactors and optimizations to code flow Included new guard and countdown for prevention of artillery spam
…ssing support menu
dedmen
reviewed
Feb 20, 2018
| ]; | ||
| }; | ||
|
|
||
| _itemsCount = 0; |
| None. | ||
|
|
||
| Usage: | ||
| [] call "dynamic_menu.sqf"; |
| }; | ||
|
|
||
|
|
||
| _dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem; |
| player enableStamina false; | ||
| }; | ||
|
|
||
| _dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem; |
| support_exampleSupport_timeout = *now* + xyz seconds; | ||
| */ | ||
|
|
||
| support_mortar_timeout = 0; |
There was a problem hiding this comment.
optimally you would use a OFPEC tag for variables. But doesn't matter as much in mission scripts.
| _art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem; | ||
| ["info",["Not enough command points","Not enough Command Points (10CP required)"]] call bis_fnc_showNotification; | ||
| sleep 15; | ||
| _art = [player,"fob_support"] call BIS_fnc_addCommMenuItem; |
| _art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem; | ||
|
|
||
| // Land_Cargo_HQ_V1_F | ||
| _art = [player,"fob_support"] call BIS_fnc_addCommMenuItem; |
There was a problem hiding this comment.
NEVER end a script with a variable assignment. That will trigger the only real SQF language bug in existence.
| */ | ||
|
|
||
| _target = _this select 0; | ||
| _location = getpos _target; |
|
|
||
| params["_salvos", "_radius", "_interval", "_rps", "_supportype", "_cost", "_ammotype"]; | ||
| _timer = 60; | ||
| _pos = []; |
| params["_salvos", "_radius", "_interval", "_rps", "_supportype", "_cost", "_ammotype"]; | ||
| _timer = 60; | ||
| _pos = []; | ||
| clicked = false; |
There was a problem hiding this comment.
Does this really have to be a global variable? It has a very generic name. Chances are high that somebody else also uses that name. That's why you should use OFPEC tags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dynamic Support Menu (DSM) is meant to organize and fix the issues surrounding the Arma Communications menu.
Arma's Communications Menu can only support up to 10 items at one point in time, this new menu is meant to minimize the number of slots taken to one, and to categorise the supports into their respective menus.
It also addresses the issue of many players unknowingly purchase too many support items and preventing the mission logic from giving the player reward 'Deploy a FOB'
This change is