Jump to content
  • 0
TolH

call Epoch_message;

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!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
  • 0

well thanks it is working without the bracket now.. Tested it without before and it wasn't working so i wasn't sure.

18 minutes ago, He-Man said:

The "" are standard in this messages.

cheers!

Thank you.

Share this post


Link to post
Share on other sites
  • 0
16 minutes ago, vbawol said:

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

yes, even better! works great.

Thank you.

Share this post


Link to post
Share on other sites
  • 0

In a publicVariable there are a few this values. The incoming looks like this:

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

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

Should be (_this select 1) select 0;

I see you have it solved though.

Share this post


Link to post
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,[]];

 

 

 

Share this post


Link to post
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."

Share this post


Link to post
Share on other sites
  • 0
_msg = (_this select 1) select 0; // Would equal "New mission availible. Check Map."

Thats great, thanks alot. Actually didn't know you could do = (_this select 1) select 0;  Make sense now!

Share this post


Link to post
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.

 

Share this post


Link to post
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
  • Donation Box

    Please donate to support the community.
    We appreciate all donations!
  • Advertisement
  • Supporters
  • Latest Donations

  • Advertisement
  • Discord

×