{"name":"Arma 3: Notification","title":"Arma 3: Notification","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_Notification","revid":338475,"updated":"2023-03-10T10:55:30Z","aliases":["Arma 3 Notification","Notification"],"markdown":"Arma 3 allows to show mission or system notification using BIS_fnc_showNotification function:\n\n```sqf\n[\"TaskSucceeded\", [\"\", \"Disable the nuke\"]] call BIS_fnc_showNotification;\n[\"ScoreAdded\", [\"\", \"Disabled the nuke without triggering an alarm.\", 5]] call BIS_fnc_showNotification;\n```\n\nInstead of defining every single param over and over again in multiple missions, it is possible to reference a template defined in `CfgNotifications` class either in mission / campaign *Description.ext* or in global *config.cpp*.\n\n> [!NOTE]\n> BIS_fnc_showNotification only offers possibility to change:\n>\n> - title\n> - description\n> - iconPicture\n> - iconText\n> - soundRadio\n>\n> The rest is `CfgNotifications`-dependent.\n\n```cpp\nclass CfgNotifications\n{\n    class Default\n    {\n        title = \"\";                // Title displayed as text on black background. Filled by arguments.\n        iconPicture = \"\";        // Small icon displayed in left part. Colored by \"color\", filled by arguments.\n        iconText = \"\";            // Short text displayed over the icon. Colored by \"color\", filled by arguments.\n        description = \"\";        // Brief description displayed as structured text. Colored by \"color\", filled by arguments.\n        color[] = {1,1,1,1};    // Icon and text color\n        duration = 5;            // How many seconds will the notification be displayed\n        priority = 0;            // Priority; higher number = more important; tasks in queue are selected by priority\n        difficulty[] = {};        // Required difficulty settings. All listed difficulties has to be enabled\n    };\n\n    // Example 1\n    class TaskAssigned\n    {\n        title = \"TASK ASSIGNED\";\n        iconPicture = \"\\A3\\ui_f\\data\\map\\mapcontrol\\taskIcon_ca.paa\";\n        description = \"%1\";\n        priority = 7;\n    };\n\n    // Example 2\n    class ScoreAdded\n    {\n        title = \"Score bonus\";\n        iconText = \"+%2\";\n        description = \"%1\";\n        color[] = {0.5,1,1,1};\n        priority = 0;\n        difficulty[] = {\"netStats\"};\n    };\n};\n```\n\nArma 3 v2.06 Default version:\n\n```cpp\ncolor[] = {\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])\"\n};\ncolorIconPicture[] = {\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])\"\n};\ncolorIconText[] = {\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])\"\n};\ndescription = \"\";\ndifficulty[] = {};\nduration = 3;\niconPicture = \"\";\niconText = \"\";\npriority = 0;\nsound = \"defaultNotification\";                // Sound to be played upon notification is created. (cfgSounds)\nsoundClose = \"defaultNotificationClose\";    // Sound to be played upon notification is collapsed. (cfgSounds)\nsoundRadio = \"\"; // Radio message to be played upon notification is created. HQ entity of player side is used. (cfgRadio)\ntitle = \"\";\n```","sections":[{"heading":null,"level":1,"markdown":"Arma 3 allows to show mission or system notification using BIS_fnc_showNotification function:\n\n```sqf\n[\"TaskSucceeded\", [\"\", \"Disable the nuke\"]] call BIS_fnc_showNotification;\n[\"ScoreAdded\", [\"\", \"Disabled the nuke without triggering an alarm.\", 5]] call BIS_fnc_showNotification;\n```\n\nInstead of defining every single param over and over again in multiple missions, it is possible to reference a template defined in `CfgNotifications` class either in mission / campaign *Description.ext* or in global *config.cpp*.\n\n> [!NOTE]\n> BIS_fnc_showNotification only offers possibility to change:\n>\n> - title\n> - description\n> - iconPicture\n> - iconText\n> - soundRadio\n>\n> The rest is `CfgNotifications`-dependent.\n\n```cpp\nclass CfgNotifications\n{\n    class Default\n    {\n        title = \"\";                // Title displayed as text on black background. Filled by arguments.\n        iconPicture = \"\";        // Small icon displayed in left part. Colored by \"color\", filled by arguments.\n        iconText = \"\";            // Short text displayed over the icon. Colored by \"color\", filled by arguments.\n        description = \"\";        // Brief description displayed as structured text. Colored by \"color\", filled by arguments.\n        color[] = {1,1,1,1};    // Icon and text color\n        duration = 5;            // How many seconds will the notification be displayed\n        priority = 0;            // Priority; higher number = more important; tasks in queue are selected by priority\n        difficulty[] = {};        // Required difficulty settings. All listed difficulties has to be enabled\n    };\n\n    // Example 1\n    class TaskAssigned\n    {\n        title = \"TASK ASSIGNED\";\n        iconPicture = \"\\A3\\ui_f\\data\\map\\mapcontrol\\taskIcon_ca.paa\";\n        description = \"%1\";\n        priority = 7;\n    };\n\n    // Example 2\n    class ScoreAdded\n    {\n        title = \"Score bonus\";\n        iconText = \"+%2\";\n        description = \"%1\";\n        color[] = {0.5,1,1,1};\n        priority = 0;\n        difficulty[] = {\"netStats\"};\n    };\n};\n```\n\nArma 3 v2.06 Default version:\n\n```cpp\ncolor[] = {\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])\"\n};\ncolorIconPicture[] = {\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])\"\n};\ncolorIconText[] = {\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_R',0])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_G',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_B',1])\",\n    \"(profilenamespace getvariable ['IGUI_TEXT_RGB_A',0.8])\"\n};\ndescription = \"\";\ndifficulty[] = {};\nduration = 3;\niconPicture = \"\";\niconText = \"\";\npriority = 0;\nsound = \"defaultNotification\";                // Sound to be played upon notification is created. (cfgSounds)\nsoundClose = \"defaultNotificationClose\";    // Sound to be played upon notification is collapsed. (cfgSounds)\nsoundRadio = \"\"; // Radio message to be played upon notification is created. HQ entity of player side is used. (cfgRadio)\ntitle = \"\";\n```"}],"categories":["Arma 3: Editing"],"groups":["General"]}