10. Guild Channel with Guild Component {{ currentPage ? currentPage.title : "" }}

Create Channels

1. Go to your Game State and listen to following Events (Found inside the Details Panel of the SP8_GameState_GuildComponent):

  • Initialized

  • Guild Added

  • Guild Removed

2. First of all we need to create a Channel for each Guild which exists on start.

Go to the Event Initialized and do following:

  • Call getAllGuildNames on the SP8_GameState_GuildComponent

  • Create for each Guild a new Channel called GUILD_<GuildName>.

  • Important: Visible to everyone should be false, because only the Members of the Guild should be able to Listen to it.

3. Of course we have to do the same, when a new Guild was created.

Go to the Event GuildAdded and do following:

  • Create a new Channel called GUILD_<GuildName>

  • Important: Visible to everyone should be false, because only the Members of the Guild should be able to Listen to it.

4. And as last we have to remove a Channel, if a Guild was removed.

Go to the Event GuildRemoved and call RemoveChannel.

Listen to the Channel

The Player Template already include this feature.

You still can look into it, to understand how you can listen to Channels.

1. Go to your Player BP and listen to following Events (Found inside the Details Panel of the SP8_GuildComponent):

  • Initialized

  • Guild Changed

2. First of all we need to add a Listener on start, if the Player is Member of a Guild.

Go to the Event Initialized and do following:

  • Call getCurrentGuild

  • Check with a Branch, if he is inside a Guild.

    • If yes, call AddChannelListener on the ChatComponent.

3. Of course we have to do the same, when the Guild changes at runtime.

Go to the Event GuildChanged and do following:

  • Check with a Branch, if he is inside a Guild.

    • If true, call AddChannelListener for this new Guild.

    • If false, remove all Guild Channels.

Now if the Player enters a Guild, he will listen to the Guild Channel and if he leaves the Guild, he will stop listen to it.

{{{ content }}}