Skip to content

Add Dynamic Support Menu (DSM)#167

Merged
ultranoobian merged 29 commits intoDUWS-R-Team:masterfrom
ultranoobian:master
Mar 14, 2018
Merged

Add Dynamic Support Menu (DSM)#167
ultranoobian merged 29 commits intoDUWS-R-Team:masterfrom
ultranoobian:master

Conversation

@ultranoobian
Copy link
Copy Markdown
Contributor

@ultranoobian ultranoobian commented Feb 20, 2018

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 Reviewable

ultranoobian and others added 29 commits December 30, 2017 10:43
'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
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
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
];
};

_itemsCount = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add private to private variables.

None.

Usage:
[] call "dynamic_menu.sqf";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This syntax is wrong.

};


_dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private keyword

player enableStamina false;
};

_dynam = [player,"DynamicSupportMenu"] call BIS_fnc_addCommMenuItem;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

support_exampleSupport_timeout = *now* + xyz seconds;
*/

support_mortar_timeout = 0;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never use _art

_art = [player1,"fob_support"] call BIS_fnc_addCommMenuItem;

// Land_Cargo_HQ_V1_F
_art = [player,"fob_support"] call BIS_fnc_addCommMenuItem;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private + params


params["_salvos", "_radius", "_interval", "_rps", "_supportype", "_cost", "_ammotype"];
_timer = 60;
_pos = [];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private

params["_salvos", "_radius", "_interval", "_rps", "_supportype", "_cost", "_ammotype"];
_timer = 60;
_pos = [];
clicked = false;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants