I'm trying to add the possibility to enable/disable the talking into the transmitters (so that you can speak to people near you, but not on the radio) and it's not working.
ItemTransmitter.EnableBroadcast has no effect, client AND serverside.
Description
Details
- Severity
- Feature
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 10 x64
- Category
- General
Event Timeline
Unfortunately I can also confirm this bug.
Is it possible that the natives are merely stubs at this point? And if so, can we have them properly implemented?
Thank you for the report GrosTon1.
This is an issue we are aware of as EnableBroadcast/EnableReceive is currently not implemented.
Regards,
Geez
Hello everyone.
The EnableBroadcast/EnableReceive has been implemented and will appear in the next experimental patch.
Regards,
Geez
Hello Geez,
It seems to still not be working for PersonalRadio for example, which is a ItemTransmitter.
I'm seeing that Land_Radio_PanelBig extends the new class StaticTransmitter, and uses EnableBroadcast and EnableReceive in Land_Radio_PanelBig .OnWorkStart().
So my guess is that it's only been implemented for StaticTransmitter class and not ItemTransmitter... which doesn't include PersonalRadio for example.
And I just also found out that the frequencies aren't even working properly, I guess I'll need to link the game and Discord then.
GrosTon1,
I can confirm that it *does* work; we implemented Push To Talk on Kinship the day 1.10 was released. You need to ensure that you're calling SetSynchDirty() on the transmitter after setting the broadcast states.
ClientSide :
ItemBase handItem = PlayerBase.Cast(GetGame().GetPlayer()).GetItemInHands(); if (!handItem) { return; } TransmitterBase transmitter = TransmitterBase.Cast(handItem); if (!transmitter) { return; } GetRPCManager().SendRPC( "ProjetAthena", "ChooseFrequency", null, true, null, transmitter );
ServerSide :
void ChooseFrequency( CallType type, ref ParamsReadContext ctx, ref PlayerIdentity sender, ref Object target ) { if( type == CallType.Server ) { TransmitterBase transmitter = TransmitterBase.Cast(target); if (!transmitter) { return; } bool newState = !transmitter.IsBroadcasting(); transmitter.EnableBroadcast(newState); transmitter.SetSynchDirty(); } }
Is not working for me. I even tried syncing itmyself by sending back a RPC from Server to Client, and it didn't mattered.
Hmmm, what exactly are you trying to do?
With ours, we're handling the enable/disable of broadcast and receive on TransmitterBase itself, then calling SetSynchDirty after making the adjustment. No RPCs involved here, although if you're attempting to *remotely* activate the reception of broadcasts, I imagine you'd also have to turn the device on first. My advice would be to create a function in TransmitterBase which does the required work internally instead of calling transmitter.EnableBroadcast.