Jump to content
  • 0

call Epoch_message;


TolH

Question

Hello,

Ive got a question about the epoch_message notification.

I really like the notification epoch uses and wanted to add it to my mission to notify player but i am having format problem.

this is what i did:

Client:

	//"Epoch_Message1" 
	"Epoch_Message1" addPublicVariableEventHandler
	{
		private ["_Epoch_msg"];
		_Epoch_msg = _this select 1;
		[_Epoch_msg, 10] call Epoch_message;
	};

And server uses this to use it:

Epoch_Message1 = ["New mission available. Check map."]; publicVariable "Epoch_Message1";

Epoch_Message.jpg.b33cd2cd3dd2da22e2a8c6e6d619154d.jpg

But as you can see on the picture below, the message copy the  [  and the  " "How can i get ride of it without breaking it. If i remove anything it doesn't work.

Thanks!

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 1

Even better way is to use RemoteExec from the server, like so:

["New mission available. Check map.", 10] remoteExec ["Epoch_message",-2]; // -2 targets everyone but the server

This way there are no client side changes needed.

Also, this is the function:
https://github.com/EpochModTeam/Epoch/blob/e16ee710ae7cd909fa4f9b1eae569a182e8cc10d/Sources/epoch_code/gui/scripts/messaging/Epoch_message.sqf

Link to comment
Share on other sites

  • 0
9 hours ago, TheVampire said:

["PublicVariableName",[value1,value2,etc]]

So you were doing select 1 which selects the value array adding the brackets to the message.

Just so i understand for future reference, from my first exemple:

Epoch_Message1 = ["New mission available. Check map."]; publicVariable "Epoch_Message1";

                ^                                                              ^

      _this select 0                                          _this select 1

Then to remove the bracket i used this from above:

Epoch_Message1 = "New mission available. Check map."; publicVariable "Epoch_Message1";
Now, let's say i want to write a text in there but add a , in the text like so :  "New mission available, Check map.";

now without the [] my text should only be returning  "New mission available  ? and not the Check map also ?

I know it's newb work for you guys, but it would really great if i can get it for future things.

Thanks again.

 

Oh and almost forgot, is the epoch_message accept color code to change it and font and size ?

Nevermind, found the color part , third params for epoch message. _customCol = param[2,[]];


 

 

 

Link to comment
Share on other sites

  • 0

In your example you would be getting this in return:

["Epoch_Message1",["New mission availible. Check Map."]]

So your selections:

_var = (_this select 0); // Would Equal "Epoch_Message1"
_msg = (_this select 1) select 0; // Would equal "New mission availible. Check Map."

If you wanted to pass an array of strings you would have to either take the entire array and forEach it or select each element of the array for different variables.

So:

Epoch_Message1 = ["New mission available.","Check map."]; publicVariable "Epoch_Message1";

And then:

_var = (_this select 0); // Would Equal "Epoch_Message1"
_msg = (_this select 1) select 0; // Would equal "New mission availible."
_msg2 = (_this select 1) select 1; // Would equal "Check map."
Link to comment
Share on other sites

  • 0

Just to add to this, after using:

["A new mission is now available.", 10] remoteExec ["Epoch_message",-2]; // -2 targets everyone but the server

But in server rpt, this show up for each message send this way:  (4:33:51 Wrong color format) .

Edit:

Also tried this:  ["Mission starting in 5 seconds...", 5, [[0,0,0,0.2],[1,1,1,0.95]]] remoteExec ["Epoch_message",-2];

Still get Wrong color format in rpt

Another script was doing it.

 

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
  • Advertisement
  • Discord

×
×
  • Create New...