DICE PACKS BUNDLE
  1. #1
    GMBazUK's Avatar
    Join Date
    May 2006
    Location
    Gloucestershire, England
    Posts
    148

    Reskinning version notification

    With reference to Trenloe's earlier post in the RMC forum:
    Quote Originally Posted by Trenloe
    I've also found it quite handy to add a startup message to the chat window (so you know which extensions are loaded - and which versions) when you start. Good for us checking what version we're running and also good for other's reporting issues!

    It's pretty simple code, create a new .lua file (I usually call it "manager_extension.lua"), put the following onInit function in the file and call this file in the scripts section of your extension.

    Code:
    function onInit()
    	--Send extension startup text
    	RMCConstants.CopyrightText[#RMCConstants.CopyrightText+1]="*** Put your startup text here! ***";
    end
    Using #RMCConstants.CopyrightText+1 will add this to any existing copyright text and so allow multiple extensions to all add their own startup text to the chat window.

    I've successfully completed an extension to modify the look of my CoC ruleset and, in a similar vein to the RMC ruleset extension I've begun, I wanted to display the version of my CoCskin in the chat box on start up. Unfortunately... I'm stumped.
    I think it has something to do with the "addmessage instruction" as used in the chatmanger lua, but whilst I can call my cocskin.lua in the cocskin extension.xml, I cannot figure out what to put after function oninit(). Clever people... help!

    Thanks in advance,
    Baz

  2. #2
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    ChatManager.addMessage(...) I think
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  3. #3
    The chat manager master script for the ruleset needs to support the ability to register notification messages. I'm guessing that CoC does not have at this point, but could potentially be added by building an extension that uses the original CoC chatmanager script, and adds the launch notifications from 3.5E/4E.

    Regards,
    JPG

  4. #4
    GMBazUK's Avatar
    Join Date
    May 2006
    Location
    Gloucestershire, England
    Posts
    148
    Thank you Valarian for your advice. I did try your idea, but to no avail.
    I will try to figure out your suggestion tomorrow moon wizard. Again, thank you.
    Baz.

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,429
    Quote Originally Posted by GMBazUK
    Thank you Valarian for your advice. I did try your idea, but to no avail.
    I will try to figure out your suggestion tomorrow moon wizard. Again, thank you.
    Baz.
    I don't have the CoC ruleset so can't give specific advice. But, do a search in the ruleset for some of the copyright text that comes up when CoC starts (perhaps "trademark of Chaosium") and see how it is being displayed on startup. This will give you an idea of what to do in your extension.

    Note: Use a text editor like Notepad++ to "find in files". If the CoC ruleset is in a .pak file you'll need to unzip it first.

  6. #6
    GMBazUK's Avatar
    Join Date
    May 2006
    Location
    Gloucestershire, England
    Posts
    148
    Thanks Trenloe for the excellent suggestion, unfortunately I have already tried that very method. Using the "find in folder" function I sort of unravelled where everything was connected, and tried various methods, from simply adding another start up "copyright message" to the add message lua script, to modifying one of the existing copyright messages in an attempt to gain some insight.
    In short, I've put my ambition to see one side for the moment, but I'm still determined.
    From what Moon_wizard was suggesting, I'm inclined to agree that the mere functionality of adding any additional text to the chat box just hasn't been allowed for.
    The 3.5 launcher notification functionality is another lesson in lua yet to be understood, but it's good fun and not a priority, so I'll come back to it.
    Baz

  7. #7
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    I had a try this morning and have attached a couple of extensions for you. The first one is how I thought it would work, using the existing chat manager to add the message and just creating a script that would call it. This, as you found, doesn't work.

    The second overrides the whole of the chat manager script, adding in the additional message. This is what MoonWizard was suggesting and does work.
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  8. #8
    GMBazUK's Avatar
    Join Date
    May 2006
    Location
    Gloucestershire, England
    Posts
    148
    Wow! You're a gentleman Valarian. Thank you very much. I will try to understand what it is you have done, so you've not only provided me with a solution, but afforded me the opportunity to increase my understanding as well.
    Thanks to everyone.
    Baz.

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
  •  
FG Spreadshirt Swag

Log in

Log in