+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 28

  Click here to go to the first Rift Team post in this thread.   Thread: Need additional information on messaging

  1. #1
    RIFT Guide Writer Redcruxs's Avatar
    Join Date
    Jan 2011
    Posts
    3,935

    Default Need additional information on messaging

    I'm starting a player rating addon but am still learning Lua and have some questions. this is the information i have so far:

    Command.Message.Broadcast(type, target, identifier, data)

    type: The type of message to send. Valid types include "tell", "channel", "guild", "officer", "party", "raid", "say", "yell".

    target: The target of this message. Required for "channel" or "tell" message types, must be nil otherwise.

    identifier: The identifier type of the message. Used for the receiver to filter accepted messages via the Command.Message.Accept() function. Must be at least three characters long.

    data: The data to send. This parameter is binary-safe.

    my question is about the type parameter. according to the documentation it can only be broadcast nearby or in party/raid/guild, i was able to get yell, say, raid, and guild working correctly but it also says that it can broadcast to a channel and i can't seem to get it to accept anything i put in that parameter.

    i was just wondering how do we specify which channel to broadcast the message to, if its even possible, and would it still only broadcast to nearby players?

    for example say i want to broadcast through a custom channel or Level 50 channel (assuming players won't be able to see it)

    Edit: herp a derp i found it XD feel free to discuss any tips or tricks you might have to help with working with messages
    Last edited by Redcruxs; 03-28-2012 at 11:21 AM.

  2. #2
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    When you find the answer to a question, please post the answer so other people can use the information.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  3. #3
    RIFT Guide Writer Redcruxs's Avatar
    Join Date
    Jan 2011
    Posts
    3,935

    Default

    if you choose "tell" or "channel" as the type then you must also include the target parameter. if you don't use "tell" or "channel" then target is nil.

    i got confused because i didn't think broadcast would need a target, i thought that target was the specific player you wanted to send to.

    Command.Message.Broadcast("channel", "Level 50", "addonname", "data") worked but i have no clue if it will actually broadcast to all players in lvl 50 chat or just ones that are nearby
    Last edited by Redcruxs; 03-28-2012 at 11:38 AM.

  4. #4
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Excellent, thanks. I wasn't sure whether channel would be the name or number.

    Any clue whether you have to be joined to a channel to use that? e.g., if you leave Level 50 chat, can you still send to it?
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  5. #5
    RIFT Guide Writer Redcruxs's Avatar
    Join Date
    Jan 2011
    Posts
    3,935

    Default

    Quote Originally Posted by the_real_seebs View Post
    Excellent, thanks. I wasn't sure whether channel would be the name or number.

    Any clue whether you have to be joined to a channel to use that? e.g., if you leave Level 50 chat, can you still send to it?
    no clue, so far when i properly broadcast it it just doesn't show any error messages. i don't have anyone actually receiving the messages to test how it works. also when you broadcast a message it doesn't get broadcast to the sender as well (or i messed up my message receiving function)

    i tried sending a message to myself with command.message.send() but i couldn't figure out the callback parameter. i think i need to write a callback function with some specific parameters but i have no clue
    Last edited by Redcruxs; 03-28-2012 at 12:00 PM.

  6. #6
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Pop into #riftuidev at some point and we can have a little debugging festival later. I have both guardians and defiants on the PvE PTS shard, and was going to be working on this tonight.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  7. #7
    Plane Walker Kreiri's Avatar
    Join Date
    Feb 2011
    Posts
    402

    Default

    Did your message show in channel?
    Feminism is the radical notion that women are people.

  8. #8
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Zorba has previously said that these messages don't go to the game chat system in any visible way, so I'd assume not.
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  9. #9
    Sword of Telara DoomSprout's Avatar
    Join Date
    Apr 2011
    Posts
    876

    Default

    I got channel messages working, but I had to be joined to a custom channel to get it working. When I tried sending to "Level 1-29", it failed (my test char at the time was level 1).

    I used "/join testchan", and then channel messages sent to this channel were sent and received successfully. If you were able to successfully send to "Level 50", there's no reason it shouldn't also work though.

    I'll try to pull the relevant code out of my test addon...

    local _addonDetail, data = ...
    local ADDON_ID = _addonDetail.identifier

    function OnMessageReceived(from, type, channel, identifier, data)
    print("Message Rcvd: From=" .. from .. ", Type=" .. type .. ", Channel=" .. (channel or "N/A") .. ", Identifier=" .. identifier .. ", Data=" .. data)
    end

    -- Register the receive listener
    table.insert(Event.Message.Receive, { OnMessageReceived, ADDON_ID, ADDON_ID .. "_OnMessageReceived" })

    -- For testing, accept messages of any type and with any identifier
    Command.Message.Accept(nil, nil)


    With the above in place, you can use something like...

    /join testchan
    /script Command.Message.Broadcast("channel", "testchan", "myidentifier", "Hello there", print)

    If you see "nil nil" appear, it's sent successfully.

    If you received the message OK, you'll see "Message Rcvd: ..." with the details of your message.

    I have tried sending to "Trade", "Level 1-29", "Sanctum", all of these failed to send (true nil). From my testing, it really looks like it has to be a custom channel that you have previously joined for it to work.

  10. #10
    RIFT Guide Writer Redcruxs's Avatar
    Join Date
    Jan 2011
    Posts
    3,935

    Default

    Quote Originally Posted by DoomSprout View Post
    I got channel messages working, but I had to be joined to a custom channel to get it working. When I tried sending to "Level 1-29", it failed (my test char at the time was level 1).

    I used "/join testchan", and then channel messages sent to this channel were sent and received successfully. If you were able to successfully send to "Level 50", there's no reason it shouldn't also work though.

    I'll try to pull the relevant code out of my test addon...

    local _addonDetail, data = ...
    local ADDON_ID = _addonDetail.identifier

    function OnMessageReceived(from, type, channel, identifier, data)
    print("Message Rcvd: From=" .. from .. ", Type=" .. type .. ", Channel=" .. (channel or "N/A") .. ", Identifier=" .. identifier .. ", Data=" .. data)
    end

    -- Register the receive listener
    table.insert(Event.Message.Receive, { OnMessageReceived, ADDON_ID, ADDON_ID .. "_OnMessageReceived" })

    -- For testing, accept messages of any type and with any identifier
    Command.Message.Accept(nil, nil)


    With the above in place, you can use something like...

    /join testchan
    /script Command.Message.Broadcast("channel", "testchan", "myidentifier", "Hello there", print)

    If you see "nil nil" appear, it's sent successfully.

    If you received the message OK, you'll see "Message Rcvd: ..." with the details of your message.

    I have tried sending to "Trade", "Level 1-29", "Sanctum", all of these failed to send (true nil). From my testing, it really looks like it has to be a custom channel that you have previously joined for it to work.
    yes mine returned "true nil" i'm pretty sure that means that it failed. so i think i'll just have it send to yell, guild, and raid. it will take up 3 times as much bandwidth but thats the only way to ensure that it goes to as many people as possible

  11. #11
    Rift Chaser NerfedWar's Avatar
    Join Date
    Dec 2010
    Posts
    377

    Default

    Quote Originally Posted by Redcruxs View Post
    yes mine returned "true nil" i'm pretty sure that means that it failed. so i think i'll just have it send to yell, guild, and raid. it will take up 3 times as much bandwidth but thats the only way to ensure that it goes to as many people as possible
    I hope access to the default chat channels is blocked for addons to be honest. Getting spammed by 100s of people running an addon would be rather unfortunate and possibly affect performance for some people. If you consent and install an addon/join a custom channel then it's different of course.
    Last edited by NerfedWar; 03-28-2012 at 09:41 PM.
    ...the internet treats censorship as damage, and routes around it...
    NerfedWar Addons and Tutorials
    * Note: tutorials are currently being ported to the new site.

  12. #12
    RIFT Community Ambassador the_real_seebs's Avatar
    Join Date
    Jan 2011
    Posts
    16,859

    Default

    Quote Originally Posted by NerfedWar View Post
    I hope access to the default chat channels is blocked for addons to be honest. Getting spammed by 100s of people running an addon would be rather unfortunate and possibly affect performance for some people. If you consent and install an addon/join a custom channel then it's different of course.
    I want that access, for one simple reason:

    http://www.wowinterface.com/download...hatterbox.html

    Throttling is fine, and to some extent I think the community will deal with addons that are too annoying. But having the OPTION is really, really, useful. (In particular, people really love their resurrect macros, and an addon can clean that up a lot and make it less annoying.)
    You can play WoW in any MMO. You don't have to play WoW in RIFT. Oh, and no, RIFT is not a WoW clone. Not having fun any more? Learn to play, noob! I don't speak for Riftui, but I moderate stuff there. Just came back? Welcome back! Here's what's changed. (Updated for 2.5!)

  13.   Click here to go to the next Rift Team post in this thread.   #13
    Rift Team
    Join Date
    Oct 2010
    Posts
    927

    Default

    Quote Originally Posted by NerfedWar View Post
    I hope access to the default chat channels is blocked for addons to be honest. Getting spammed by 100s of people running an addon would be rather unfortunate and possibly affect performance for some people. If you consent and install an addon/join a custom channel then it's different of course.
    Quote Originally Posted by the_real_seebs View Post
    I want that access, for one simple reason:
    Access to default chat channels is blocked for the Message system - that's a bandwidth multiplier that we really don't want introduced. It may be available for a Chat API, but will likely require a hardware event to cut down on spam issues.

  14. #14
    Plane Walker Kreiri's Avatar
    Join Date
    Feb 2011
    Posts
    402

    Default

    Quote Originally Posted by ZorbaTHut View Post
    Access to default chat channels is blocked for the Message system - that's a bandwidth multiplier that we really don't want introduced. It may be available for a Chat API, but will likely require a hardware event to cut down on spam issues.
    So no Chatterbox in Rift, then.

    And for spam issues: I can make a bot which would spam chat using hardware events: two miniature shishi-odoshi toys hitting up arrow and enter.
    Last edited by Kreiri; 03-29-2012 at 12:52 AM.
    Feminism is the radical notion that women are people.

  15. #15
    Ascendant
    Join Date
    Jul 2011
    Posts
    1,551

    Default

    im glad this wont be going in the game


    its bad enough when people /sh their stupid interrupt macros and the lilke, my ignore list cant handle any more captain!

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts