DICE PACKS BUNDLE
  1. #1

    Sending the result into chat

    Hi

    I wrote an extension for fortification (some effect in 3.5e, not important now); there is a d100 involved, but for the first version I do not want to try a graphical display of this d100 and, thus, I just use math.number(100). But I would like to send the result of this random number into the Chat (best: to GM only if possible). How can I do this in lua? I always get error messages of different type when I try to use the deliverChatMessage(...) etc.

    (If it is important: That is happening while the damage roll is executed)

    Thank you in advance

    Best,

    Kelrugem

  2. #2

  3. #3
    Quote Originally Posted by damned View Post
    You are using Comm.deliverChatMessage(msg); right?
    Yes, that is what I tried Sorry, forgot the Comm. in my initial post but it was in my code

    This is basically what I try:

    local rRollFortif = math.random(100);
    local msg = {sender = "", font = "emotefont"};
    msg = "Fortification roll result" .. rRollFortif;
    Comm.deliverChatMessage(msg);

    But I get then the error message "deliverChatMessage: Invalid parameter" I guess I define msg somehow wrong

  4. #4
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,678
    Blog Entries
    1
    You need something more like this:

    local rRollFortif = math.random(100);
    local msg = {sender = "", font = "emotefont"};
    msg.text = "Fortification roll result " .. rRollFortif;
    Comm.deliverChatMessage(msg);

  5. #5
    Quote Originally Posted by damned View Post
    You need something more like this:

    local rRollFortif = math.random(100);
    local msg = {sender = "", font = "emotefont"};
    msg.text = "Fortification roll result " .. rRollFortif;
    Comm.deliverChatMessage(msg);
    Aaaah, thank you very much, this worked

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  
STAR TREK 2d20

Log in

Log in