Page MenuHomeFeedback Tracker

customChat command doesn't do anything...
Closed, ResolvedPublic

Description

Using customChat to display a message in the debug console.
Custom Channels have been declared (and are fully useable / customisable in game) through channels 6-12.

Entering "player customChat [6, 'test'];" into debug console returns nothing.
No event log errors for syntax. Tried using unit names, different channel numbers, different commands... nothing works.

Details

Legacy ID
1711444925
Severity
None
Resolution
No Bug
Reproducibility
Always
Category
Multiplayer
Steps To Reproduce
  • Create a custom channel on the server.
  • use customChat command to send a message to the channel.

Event Timeline

3LGStevo edited Steps To Reproduce. (Show Details)Jan 21 2016, 9:59 AM
3LGStevo set Category to Multiplayer.
3LGStevo set Reproducibility to Always.
3LGStevo set Severity to None.
3LGStevo set Resolution to No Bug.
3LGStevo set Legacy ID to 1711444925.May 8 2016, 1:32 PM

It works here. Have you added player to the list when you created the channel on the server? Also number 6, the channel number, is this the number you got from radioChannelCreate command or some other number?

Yep, channel 6 effectively replaces the side channel for West, but also adds in a couple of other players and renames it.
Players can talk freely in this channel (and all other custom channels, upto 12).
Each ID was obtained from when they were created on the server, but I've also confirmed the channel numbers by selecting the custom radio channel and then opening the debug console and typing hint format["%1",currentChannel];

So what you are saying that essentially what you are doing is:

player customChat [currentChannel, 'test'];

or did I misunderstand you?

I've tried several ways; using all custom channels I've created 6-12, different test strings, tried sending text through too, used player as the object, a gamelogic, a player assigned in a local variable, global variable... the actual player name.

None have returned any text in the channels.
I'm basically setting up a scenario where when a player accepts a task assignment, and they automatically post an update to their commander where they're heading for the task.

When the channels are first created, they're created empty, and players are adding into this on joining the server.

On server;
life_radio_west = radioChannelCreate [[0, 0, 0.8, 0.8], "Police Channel", "%UNIT_NAME", [], false]; ID 6
life_radio_civ = radioChannelCreate [[0.5, 0, 0.6, 0.8], "Civilian Channel", "%UNIT_NAME", [], false];
ID 7
life_radio_indep = radioChannelCreate [[0, 1, 0.2, 0.8], "EMS Channel", "%UNIT_NAME", [], false]; ID 8
life_radio_rebel = radioChannelCreate [[0.5,0,0,0.8], "Rebel Channel", "%UNIT_NAME", [], false];
ID 9
life_radio_corp = radioChannelCreate [[0,0.8,0,0.8], "Army Channel", "%UNIT_NAME", [], false]; ID 10
life_radio_bh = radioChannelCreate [[0, 0.95, 1, 0.8], "Bounty Hunter Channel", "%UNIT_NAME", [], false];
ID 11
life_radio_global = radioChannelCreate [[0.8,0.8,0.8,0.8], "Global Channel", "%UNIT_NAME", [], false]; // ID 12

On server when player joins (inside switch based on playerside);
case west:
{

		if(_bool) then
		{
			life_radio_west radioChannelAdd [_unit];
			life_radio_global radioChannelAdd [_unit];
		}
			else
		{
			life_radio_west radioChannelRemove [_unit];
			life_radio_global radioChannelRemove [_unit];
		};

};

The same section of code also handles the removal, should the correct circumstances occur.

there are 2 conditions that must be fulfilled for custom channel to work correctly:

  1. It has to have correct units assigned to it. If unit is not assigned to the custom channel it cannot broadcast or listen on it
  1. The correct channel index should be used. Channel id (currentChannel) is not the index. The index is the id returned by radioChannelCreate. It starts from 1. when 1st time radioChannelCreate is executed it will be 1 not 6 or 7 or 8.

So

<unit assigned to this channel> customChat [<number from radioChannelCreate>, "whatever"]

works. If it doesn't work for you, you must be doing something wrong.

life_radio_west = radioChannelCreate [[0, 0, 0.8, 0.8], "Police Channel", "%UNIT_NAME", [], false]; // ID 6

There you go, as per my previous post.

  1. you use wrong id, you should use life_radio_west which will be 1 not 6

so

player customChat [6, 'test']; should not work

but

player customChat [1, 'test']; should

Does indexing start at 0 or 1?

It starts from 1. Anyway, I'm going to resolve this as it works just fine when I tested. I'm sure you will figure out what you are doing wrong eventually ;)