Jump to content
HazJ

[Abandoned] [Release] Notification System

Recommended Posts

On 5/9/2018 at 5:24 AM, HazJ said:

Uhh. Are you using the stringtable.xml which is included? If you are then... Not sure about saving stuff. Will need to look into it.

 

Sorry I didn't see your reply until today. It's easy to verify. Just load your sample mission in the VR, put this in the debug console:


["New notification", "This is a notification!", [0, 0, 0, 1], [1, 1, 0, 1]] spawn Haz_fnc_createNotification;

and the message appears fine. Save the game. Load the save. Open the debug and execute that code again, nothing happens.

 

Share this post


Link to post
Share on other sites

I have a working solution. Note the 2 sec delay. It doesn't work without a delay.

 


"layer_notifications" cutRsc ["rsc_notifications", "PLAIN"];

addMissionEventHandler ["Loaded",{
    [] spawn
    {
        sleep 2;
        "layer_notifications" cutRsc ["rsc_notifications", "PLAIN"];
    };
}];

  • Like 1

Share this post


Link to post
Share on other sites

Weird. I don't ever use save so never notice this shit. I'll add that to next release. Thanks for sharing!

  • Haha 1

Share this post


Link to post
Share on other sites

Yeah that's a single player problem. I added your scripts to my upcoming campaign and the first time I died and had to reload during testing, I was like "where are the notifications!?"

  • Like 1

Share this post


Link to post
Share on other sites

I was like "where are the notifications!?"

Then you were like... Oh yeah. ArmA :rofl:

  • Haha 2

Share this post


Link to post
Share on other sites

This bug has been fixed.

It will be released in the next patch along with @AZCoder's code snippet for load save fix and config options.

  • Like 2

Share this post


Link to post
Share on other sites
Quote

0.3

Added load save fix (thanks AZCoder)

Added functionality for the inactive customisable config options that were added last version (for example: positionOnScreen)

Fixed the bug with the key press toggle (expand/shrink control elements)

Fixed queue counter

https://github.com/HazJ/notificationSystem.VR

@foxhound

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites
On 20.05.2018 at 12:24 AM, AZCoder said:

I have a working solution. Note the 2 sec delay. It doesn't work without a delay.

 

Thats because the main interface is not initialized. In multiplayer the 2 sec delay may fail if the main interface is not initialized (low fps, much objects, long loading time).

 

It's better to wait for main interface with:

 

waitUntil {!isNull finddisplay 46};

 

addMissionEventHandler ["Loaded",{
    [] spawn
    {
        waitUntil {!isNull finddisplay 46};
        "layer_notifications" cutRsc ["rsc_notifications", "PLAIN"];
    };
}];

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks for posting that. The sleep was rather arbitrary "fix" I admit :)  I forgot about the display 46. Excellent. 

Share this post


Link to post
Share on other sites

I'm pushing this into my mission now :)

 

First two of many questions then;

 

How does the expand notification work? I've looked over your code and see actionkeys "help". but don't understand that at all

 

I see it needs to be run on the client. Any guidance as to how I might best remote exec it from the server?

  • Like 1

Share this post


Link to post
Share on other sites
6 minutes ago, Tankbuster said:

I see it needs to be run on the client. Any guidance as to how I might best remote exec it from the server?

 
["New notification", "This is a notification!", [0, 0, 0, 1], [1, 1, 0, 1]] remoteexec ["haz_fnc_createnotification", 0, false];

Run on the server appears to work. I'm just wondering if it's the best way to achieve this?

Share this post


Link to post
Share on other sites

de60c54b43.JPG

Can the top yellow line be made any bigger so that it can fit my mission logo, seen here in the lower box?

Share this post


Link to post
Share on other sites

remoteExec example from one of my projects:

[localize "STR_mission_captureVehicleTitle", format [localize "STR_mission_captureVehicleDescription", _vehicleDisplayName]] remoteExec ["client_fnc_createNotification", ([0, -2] select isDedicated), false];

drunk from club - Yes, it can - Adjust h value... Will reply tomorrow!

  • Like 2

Share this post


Link to post
Share on other sites
18 hours ago, HazJ said:

remoteExec example from one of my projects:


[localize "STR_mission_captureVehicleTitle", format [localize "STR_mission_captureVehicleDescription", _vehicleDisplayName]] remoteExec ["client_fnc_createNotification", ([0, -2] select isDedicated), false];

drunk from club - Yes, it can - Adjust h value... Will reply tomorrow!

I changed the h value, assuming its line 42 of rsc_notifications.hpp but the yellow part didn't change size. Am I changing the wrong bit?

Share this post


Link to post
Share on other sites
21 minutes ago, Tankbuster said:

I changed the h value, assuming its line 42 of rsc_notifications.hpp but the yellow part didn't change size. Am I changing the wrong bit?

 

It's in fn_createNotification, line 86. Try something like this:


_title ctrlSetPosition
[
    _safeZoneX,
    (0.185 + (_position * 0.16)) * safezoneH + safezoneY,
    0.2125 * safezoneW,
    0.0495 * safezoneH
];

The .185 line is the lower box size and the 495 line is the title bar.

  • Like 1

Share this post


Link to post
Share on other sites

Fine now lol! Yes, as @AZCoder said. Also remember to take into consideration the expand thing... You'll need to change that accordingly as well. See _posW I think it is. As for the expand. It is based off the key you use in your controls, "Help". Feel free to change it! I might add an configurable option in next patch, whenever that is...

 

EDIT:

Fixed the issue with black image showing in title bar. Fix:

color='#ffffff'

I think the cause of it is because image has no alpha channel or is not setup correctly. @Tankbuster

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Yes. You're a gent! :) Many thanks.

  • Like 1

Share this post


Link to post
Share on other sites

New bug. When using position right, the expand feature shrinks. Will patch soon and release update. Noticed and reported by @Tankbuster !

Share this post


Link to post
Share on other sites

Update pushed to GitHub.

Quote

0.3.1

Fixed expand/shrink positioning when using RIGHT config option (thanks to Tankbuster for reporting)

Added config option for expand/shrink key

Minor code tweaks

@foxhound

@Tankbuster - Sorry it is late and thanks again for reporting the bug.

expandShrinkKey = "help"; // The key which is used to expand/shrink notifications - https://community.bistudio.com/wiki/DIK_KeyCodes (you can also use action key names: https://community.bistudio.com/wiki/Category:Key_Actions)

Remember to update all files!

  • Like 2

Share this post


Link to post
Share on other sites
Quote

0.3.2

Fixed positioning issues

Added config option for expand display time which will show the notification on screen for longer if expanded

Code tweaks and fixes

Remember to replace all files, including macros and everything else!

Thanks again to @Tankbuster for bug report and feature request!

@foxhound

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites

Taking feature requests, etc.. Anyone? :dontgetit:

I want the next update to be a big one.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×