1. Hi, im trying to create a single clickable frame with the bg target. I already make some working comunication with ace3 lib :

    Select Target and send it to raid:

    BgCallTarget = LibStub("AceAddon-3.0"):NewAddon("BgCallTarget", "AceComm-3.0") BgCallTargetConsole = LibStub("AceConsole-3.0")

    function BgCallTargetConsole:CallTarget(input) local x, y = GetPlayerMapPosition("player") BgCallTarget:SendCommMessage("callTarget", "" ..UnitName("target"), "RAID") BgCallTargetConsole:Print("BGCallTarget - Target sent! ") end

    BgCallTargetConsole:RegisterChatCommand("callTarget", "CallTarget")

    Listen for new targets:

    BgGetTarget = LibStub("AceAddon-3.0"):NewAddon("BgGetTarget", "AceComm-3.0")

    function BgGetTarget:OnCommReceived(prefix, message, distribution, sender) BgCallTargetConsole:Print("New target: " ..message) end


    But i have no clue on how to create the clickable frame with the new target. I've tried a lot of samples but no one done it. I know, its a noob question but im new to wow programing.

    You cannot do it if you are in combat, so if that's your goal...

    I can't send the msg's while in combat?

    You can send the messages, you cannot create a frame that will allow you to click on it.

    Hummm... I may have to change the context. It would be possible to create the frames of all players on the opposing team as BattleGroundTargets and through mgs leave the target button highlighted?

    Yes, you can always change display (with the exception of size and visibility) based on the current situation, you just can't have 'contextual' buttons, basically.

    Thx a lot! I'll try to use bgt addon as base to my addon.

    Essentially, you want to loop through all players on the opposing team using the scoreboard API (most importantly GetBattlefieldScore) and create a frame with a /targetexact macrotext attribute for every opponent. Then have code that handles targets joining/leaving the BG and repositions frames accordingly, and make sure you make any target changes in combat merely queue a repositioning on PLAYER_REGEN_ENABLED.

    Exactly, that's what Battleground targets already do. I want to use it as base, and trough addonMessages i want to tell other playes who they should attack highlighting the the target name on their screen.