Jump to content
Whisperdrive

Dialog via custom Chat

Recommended Posts

I am setting up a zeus mission where my players will "overhear" enemy communication coming from a placed radio. So far, I have a HQ sidechat going on between the players and HQ (which shows up in blue obviously) and so I thought to distinguish rebel communication via a different text colour..which brings me to customChat.

into my init.sqf I placed:

_index = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Rebel Comms", "%UNIT_NAME", [P1, P2, R1, R2]];

P1 and P2 are my players and R1 and R2 are the two rebel officers (for testing purposes)

I also created a dialogue.sqf:

R1 customChat [1,"Hey, how's it going?" ];
sleep 4;

R2 customChat [1,"Yeah, I'm alright!" ];
sleep 3;

 
Then I setup a player activated trigger:

null = execVM "dialogue.sqf";

But.....when I step into the trigger area, nothing happens! I know the trigger does activate but I can't get my dialogue to appear on screen. Anyone have any ideas?

Share this post


Link to post
Share on other sites
5 hours ago, Whisperdrive said:

into my init.sqf I placed:


_index = radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Rebel Comms", "%UNIT_NAME", [P1, P2, R1, R2]];

Doing it in the init.sqf means server plus all joining clients try to create the channel. Just put it in initServer.sqf and broadcast the channel ID.

As per the Biki...

Quote

The radio channel needs to be created on the server before hand, with radioChannelCreate command.

 

//initServer.sqf

missionNamespace setVariable[ "RebelComsChan", radioChannelCreate [[0.96, 0.34, 0.13, 0.8], "Rebel Comms", "%UNIT_NAME", [P1, P2, R1, R2]], true ];
//dialogue.sqf

_rebelComsChan = missionNamespace getVariable[ "RebelComsChan", -1 ];

if ( _rebelComsChan > -1 ) then {
	
	R1 customChat [1,"Hey, how's it going?" ];
	sleep 4;
	
	R2 customChat [1,"Yeah, I'm alright!" ];
	sleep 3;
}else{
	"Rebel Coms Channel missing" call BIS_fnc_error;
};

Tested, works fine for me.

  • Like 3

Share this post


Link to post
Share on other sites

@Larrow Ok that makes sense. I am sure the code is fine but I just keep getting a generic error when I test it in the editor. Apparently there is an error in the dialogue.sqf  (Error Invalid number in expression) in line 1

I mean, I could be very slowly losing my mind but I don't see what it causing this error. Eitherway I will keep testing. Thanks for the help!

 


 

Share this post


Link to post
Share on other sites
7 minutes ago, Whisperdrive said:

Apparently there is an error in the dialogue.sqf  (Error Invalid number in expression)

Most likely the forum bug that adds invisible characters when posting/copying code blocks.

HERE is my test mission.

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

@Larrow Heya, so yeah the error from before has gone but..I have been testing this for the last 40 mins now and I can't seem to get the custom chat to appear. I replaced my mission folder with your 3 files and still couldn't get it to work. The trigger definitely activates (I put a hint in there to test and I do see the hint when I run the mission) but for whatever reason I can't get the chat to appear on the screen. I am quite stumped at this point 🤔
 

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

×