• New in-game notifications

    Eichi

    24 comments · 17499 views

    This post covers the new notifications that we have implemented into Exile. The following is mainly targeted to add-on authors of Exile.

    In the current implementation of Exile (and Arma), there are many different ways of informing the player about something. May it be information, a warning, an event - you probably know them all. There are hints, silent hints, dynamic text, notifications, task messages, system chat messages and so on. Our goal here was to offer a way of informing the user about something in a unified way. The result is what we call the toaster. Yes, toaster.

    You have probably seen the notifications we had at the bottom right of the screen. These and the respective CfgNotifications are now removed completely! If you have been using these, please switch over the our new system. It is very similar to what we have had before, but it looks so much better.

    Basically, it is a structured text that can be defined on the fly or as a template in a config. Instead of using symbolic icons, we are using classic mood colors. The color can be defined by you, but we offer three template colors for you. Blue for informative messages, red for warnings or errors and green for success messages. 

    A single toast is about 60px in height. If you pass a text to it that is smaller, it will center the text vertically within the toast. If your text is larger than that, it will dynamically scale the toast to cover all of your text.

    By default, we offer two types of toasts as a template. "Title only" template that, well, just have a one-line message. "Title and Text" toasts can be seen in the video. They offer a title and a small description for that. The title is always a bit brighter to catch the users eye faster. It also supports images. Check out our trader toasts. We use the pop tab icon there.

    You can trigger a toast from the client or from the server. Please find some examples here:

    #define TOAST_COLOR_RED			[0.780, 0.149, 0.318, 1]
    #define TOAST_COLOR_RED_CONFIG		{0.780, 0.149, 0.318, 1}
    #define TOAST_COLOR_BLUE		[0.247, 0.831, 0.988, 1]
    #define TOAST_COLOR_BLUE_CONFIG		{0.247, 0.831, 0.988, 1}
    #define TOAST_COLOR_GREEN		[0.627, 0.874, 0.231, 1]
    #define TOAST_COLOR_GREEN_CONFIG	{0.627, 0.874, 0.231, 1}
    
    
    class CfgExileToasts
    {
    	///////////////////////////////////////////////////////////////////////////
    	// INFO
    	///////////////////////////////////////////////////////////////////////////
    	class InfoEmpty
    	{
    		template = "%1";
    		color[] = TOAST_COLOR_BLUE_CONFIG;
    	};
    
    	class InfoTitleOnly
    	{
    		template = "<t size='22' font='PuristaMedium'>%1</t>";
    		color[] = TOAST_COLOR_BLUE_CONFIG;
    	};
    
    	class InfoTitleAndText
    	{
    		template = "<t size='22' font='PuristaMedium'>%1</t><br/><t color='#ff979ba1' size='19' font='PuristaLight'>%2</t>";
    		color[] = TOAST_COLOR_BLUE_CONFIG;
    	};
    
    	///////////////////////////////////////////////////////////////////////////
    	// SUCCESS
    	///////////////////////////////////////////////////////////////////////////
    	class SuccessEmpty
    	{
    		template = "%1";
    		color[] = TOAST_COLOR_GREEN_CONFIG;
    	};
    
    	class SuccessTitleOnly
    	{
    		template = "<t size='22' font='PuristaMedium'>%1</t>";
    		color[] = TOAST_COLOR_GREEN_CONFIG;
    	};
    
    	class SuccessTitleAndText
    	{
    		template = "<t size='22' font='PuristaMedium'>%1</t><br/><t color='#ff979ba1' size='19' font='PuristaLight'>%2</t>";
    		color[] = TOAST_COLOR_GREEN_CONFIG;
    	};
    
    	///////////////////////////////////////////////////////////////////////////
    	// ERROR
    	///////////////////////////////////////////////////////////////////////////
    	class ErrorEmpty
    	{
    		template = "%1";
    		color[] = TOAST_COLOR_RED_CONFIG;
    	};
    
    	class ErrorTitleOnly
    	{
    		template = "<t size='22' font='PuristaMedium'>%1</t>";
    		color[] = TOAST_COLOR_RED_CONFIG;
    	};
    
    	class ErrorTitleAndText
    	{
    		template = "<t size='22' font='PuristaMedium'>%1</t><br/><t color='#ff979ba1' size='19' font='PuristaLight'>%2</t>";
    		color[] = TOAST_COLOR_RED_CONFIG;
    	};
    };

    Code examples:

    ///////////////////////////////////////////////////////////////////////////
    // CLIENT
    ///////////////////////////////////////////////////////////////////////////
    ["InfoTitleAndText", ["Snap Mode", "Look at the object you want to snap to, press SPACE to lock on it and then move your object next to a snap point. Press SPACE again to place the object."]] call ExileClient_gui_toaster_addTemplateToast;
    
    ["SuccessTitleAndText", ["Placed safe!", "The PIN has been set to 0000."]] call ExileClient_gui_toaster_addTemplateToast;
    
    ["ErrorTitleAndText", ["Failed to repair!", _exception]] call ExileClient_gui_toaster_addTemplateToast;
    
    ["ErrorTitleAndText", ["Construction aborted!", "You cannot build during a combat."]] call ExileClient_gui_toaster_addTemplateToast;
    
    ["ErrorTitleOnly", ["Your knife broke!"]] call ExileClient_gui_toaster_addTemplateToast;
    
    ["SuccessTitleAndText", ["Family registered!", format ["-%1<img image='\exile_assets\texture\ui\poptab_inline_ca.paa' size='24'/>", _registrationFee]]] call ExileClient_gui_toaster_addTemplateToast;
    
    ["<t size='22' font='PuristaMedium'>Hello, World!</t>", [1, 0, 0, 1]] call ExileClient_gui_toaster_addToast;
    
    ///////////////////////////////////////////////////////////////////////////
    // SERVER
    ///////////////////////////////////////////////////////////////////////////
    [_sessionID, "toastRequest", ["ErrorTitleAndText", ["Failed to add lock!", _exception]]] call ExileServer_system_network_send_to;
    
    [_sessionID, "toastRequest", ["SuccessTitleOnly", ["Supply box installed!"]]] call ExileServer_system_network_send_to;
    
    ["toastRequest", ["InfoTitleAndText", ["Supply drop incoming!", "A Heart for Inmates is going to drop a supply crate in about ten minutes. Check your map for the location."]]] call ExileServer_system_network_send_broadcast;

    You you want to discuss the technical implementation of the new toasts, please do so over here:

     


    • Like 13
      Report Devblog Entry


    User Feedback

    Recommended Comments

    Thank you.... Thank you thank you thank you! 

    This is so much better than the old notifications, these are stunning. 

    This really is shaping up to be one of the best updates yet. 

     

    Good luck with release!

    Share this comment


    Link to comment
    Share on other sites

    can this be like a shout out for people there cant/wont download the app and know the flag has been kidnapped by running a script or something where upon loggeing in and get a notification that its gone or would this overload/sort of overload the server on logging in? 

    Share this comment


    Link to comment
    Share on other sites
    1 hour ago, Metalman10 said:

    Can we put images inside the said "Toast"?

    hupWBTE.png

    It is structured text after all. You can pretty much put in anything that ArmA supports.

     

     

    @kimse That would be up to the server owner to implement. This is simply a new method for notifying players.

    EDIT: They will apparently notify you on login either way :P

    Edited by eraser1

    Share this comment


    Link to comment
    Share on other sites
    20 minutes ago, kimse said:

    can this be like a shout out for people there cant/wont download the app and know the flag has been kidnapped by running a script or something where upon loggeing in and get a notification that its gone or would this overload/sort of overload the server on logging in? 

    Yes, sir! Working on that!

    Share this comment


    Link to comment
    Share on other sites
    45 minutes ago, Eichi said:

    Yes, sir! Working on that!

    What also would be nice maybe, that if a player log's in he sees until when his territory is protected ( have seen a script somewhere, not sure where :P )

    Share this comment


    Link to comment
    Share on other sites

    Just a heads up, the ExileClient_gui_notification_event_addNotification function will not be used in this new patch. So for example:

    ["Whoops",["You cannot deploy a bike!"]] call ExileClient_gui_notification_event_addNotification;};

    Would be

     ["ErrorTitleAndText", ["Deploy bike", "You cannot create a bike in safezones!"]] call ExileClient_gui_toaster_addTemplateToast;

    Where ErrorTitleAndText is red, SuccessTitleAndText is green and InfoTitleAndText is light blue.

    Share this comment


    Link to comment
    Share on other sites

    Hey, is there any place where I can add my own "CfgExileToasts" templates? I've tried it in the server config.cpp and the mission one but got everytime the message "UNKNOWN TOAST TEMPLATE:". I've found the place where it sends the message in the client but how can I solve this?

    Share this comment


    Link to comment
    Share on other sites
    On 3.7.2016 at 10:54 PM, Pandabeard said:

    Hey, is there any place where I can add my own "CfgExileToasts" templates? I've tried it in the server config.cpp and the mission one but got everytime the message "UNKNOWN TOAST TEMPLATE:". I've found the place where it sends the message in the client but how can I solve this?

    The CfgExileToasts functions are defined in config.bin of the exile_client.pbo. Looks like there is no chance at the moment to override or add new classes.

    Share this comment


    Link to comment
    Share on other sites
    6 hours ago, StrokeR said:

    Is there any chance to change position of new notifications?

    Look into the file ExileClient_gui_toaster_addToast.sqf (exile_client.pbo)

    Share this comment


    Link to comment
    Share on other sites
    20 hours ago, Eichi said:

    You want the option to add new templates? Because that is how you get the option to do so... :) 

    Would it possible to add them without editing the exile client? Like a second place in the mission config or something like this?

    Share this comment


    Link to comment
    Share on other sites

    Personally I think it works loose, with the pve servers works well . Try then one is smarter

    Ich denke das klappt wunderbar , den mit den PVE server ( AntiPVP  ) klappte das auch sehr gut . Versuchen halt dann ist man schlauer . :)

     

    zb. ExileClient_object_player_event_onHandleDamage.sqf   (  ANtiPVP ) ;)

    Edited by Mythbustar

    Share this comment


    Link to comment
    Share on other sites

    So how can I pass a string from  a variable and append it to a string... something like this:

            ["SuccessTitleAndText", ["Done!", "You have buried" _name]] call ExileClient_gui_toaster_addTemplateToast;

    where _name is the name of the dead player.  What I get in my client.rpt is:

    Error in expression <leAndText", ["Done!", "You have buried" _name]] call ExileClient_gui_toaster_add>
    17:27:50   Error position: <_name]] call ExileClient_gui_toaster_add>
    17:27:50   Error Missing ]
    17:27:50 File mpmissions\__CUR_MP.Tanoa\Addons\HideBody\HideBody.sqf, line 36

    I've tried several variations but cannot come up with any combinations of brackets, quotes, semicolons; etc. that seem to work.  The example above isn't missing a bracket and if I just remove the _name, it works fine.  I just want to be able to display the dead player's name, too.

    Share this comment


    Link to comment
    Share on other sites

    Is there any way i can run a toast on command from an RCON program that lets me run scripts while the server is running?

    If it helps, i am using the mARMAcp RCON web tool

    Edited by ProfessorBAG

    Share this comment


    Link to comment
    Share on other sites
    On 14/08/2016 at 11:39 PM, Bob_the_K said:

    So how can I pass a string from  a variable and append it to a string... something like this:

            ["SuccessTitleAndText", ["Done!", "You have buried" _name]] call ExileClient_gui_toaster_addTemplateToast;

    where _name is the name of the dead player.  What I get in my client.rpt is:

    Error in expression <leAndText", ["Done!", "You have buried" _name]] call ExileClient_gui_toaster_add>
    17:27:50   Error position: <_name]] call ExileClient_gui_toaster_add>
    17:27:50   Error Missing ]
    17:27:50 File mpmissions\__CUR_MP.Tanoa\Addons\HideBody\HideBody.sqf, line 36

    I've tried several variations but cannot come up with any combinations of brackets, quotes, semicolons; etc. that seem to work.  The example above isn't missing a bracket and if I just remove the _name, it works fine.  I just want to be able to display the dead player's name, too.

    Looking at the examples above, try doing:

            ["SuccessTitleAndText", ["Done!", "You have buried", _name]] call ExileClient_gui_toaster_addTemplateToast;

    Share this comment


    Link to comment
    Share on other sites


    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now