FG Spreadshirt Swag
Page 2 of 2 First 12
  1. #11
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,402
    Quote Originally Posted by darrenan View Post
    Considering it already outputs the list of extensions at startup...
    Just as an FYI - FG doesn't do that automatically, it relies on the developer of each extension to write code in their extension to output to the chat window on startup. Hence why dulux_oz is suggesting this code to register and retrieve extension info as there is nothing in FG at the moment to return the extensions loaded.

    Of course, it still relies on an extension developer coding a registerExtension command in their extension startup code. Catch-22!

    As a further FYI to people reading this thread - the Savage Worlds developers do something very similar to this with their /ver chat command that outputs the name and version of the loaded SW ruleset and extensions.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  2. #12
    Quote Originally Posted by Trenloe View Post
    Perhaps add a slash handler to output all registered extension names and versions to the chat window? /extensionlist maybe?
    Nice idea - I'll have a look at the Savage Worlds Code and see what I can come up with.

    Cheers
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  3. #13
    Here's another function devs can add to their Rulesets now that Moon has added the Extension.getExtensions() and Extension.getExtensionInfo() functions to the Extensions package
    Code:
    function fpIsExtensionLoaded(sExtensionName)
    	for nIndex,sName in pairs(Extension.getExtensions()) do
    	if sName == sExtensionName then
    		return true;
    		break;
    	end
    	return false
    end
    Note that this will only work with FGv3.0.8+ - maybe Moon will add this to the Extensions package as well.

    Cheers
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  4. #14
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383
    I was also playing slightly with v3.0.8 Extension package and come up this:

    Code:
    for _, sExt in pairs(Extension.getExtensions()) do
        local t = Extension.getExtensionInfo(sExt)
        local sName = ""
        if t.name ~= "" then sName = "[" .. t.name .."]:" end
        local sDesc = ""
        if t.description ~= "" then sDesc = t.description end
        local sVersion = ""
        if t.version ~= "" then sVersion = "(version " .. t.version ..")" end
        local sAuthor = ""
        if t.author ~= "" then sAuthor = "by " .. t.author end
        local sText = ""
        for _, s in pairs({sName, sDesc, sVersion, sAuthor}) do
        if s ~= "" then
                if #sText > 0 then sText = sText .. " " end
               sText = sText .. s    end    end
        Comm.addChatMessage({ font = "emotefont", text = sText })
    end
    Note that Extension package was not documented that time so I made wild guesses how would it work and ended up with this result

    Note: In case of Savage Worlds we are probably not going to use this as primary extension listing/showing because of one feature lacking: Extension properties does not support icon. In Savage Worlds ruleset when you load extension it's nice to see themed icon showing in the chat line next to extension description. Now extension properties does not contain that information, maybe that could be added there ?
    Last edited by Ikael; September 5th, 2014 at 07:53.
    "Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness

    Post your SavageWorlds ruleset feature requests and issue reports here!

  5. #15
    Hey Ikael, did you actually get your piece of code to work - because I can't.

    Its not throwing up any errors, its just not printing out any Extension details.

    Cheers
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  6. #16
    Ikael's Avatar
    Join Date
    Jan 2008
    Location
    Finland/Joensuu
    Posts
    2,383
    Quote Originally Posted by dulux-oz View Post
    Hey Ikael, did you actually get your piece of code to work - because I can't.

    Its not throwing up any errors, its just not printing out any Extension details.

    Cheers
    Are you using latest 3.0.8 version which introduces the Extension package?

    This piece of code is already included in current SW4 version as backup plan if developers are lazy to register launch messages for their extensions
    "Alright, you primitive screwheads, listen up: THIS... is my BOOMSTICK!" -- Ash Williams, Army of Darkness

    Post your SavageWorlds ruleset feature requests and issue reports here!

  7. #17
    Quote Originally Posted by Ikael View Post
    Are you using latest 3.0.8 version which introduces the Extension package?

    This piece of code is already included in current SW4 version as backup plan if developers are lazy to register launch messages for their extensions
    Yes, of course - but you're right and smart to ask.

    I'm still playing around with it - the Extension package seems to return both strings and tables... hmmmm....
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

  8. #18
    OK, got it sorted - will be posting some detailed documentation soon

    Cheers
    Dulux-Oz

    √(-1) 2^3 Σ Π
    ...And it was Delicious!


    Alpha-Geek
    ICT Professional
    GMing Since 1982
    NSW, Australia, UTC +10
    LinkedIn Profile: www.linkedin.com/in/mjblack

    Watch our games on Twitch: www.twitch.tv/dulux_oz

    Support Me on Patreon: www.patreon.com/duluxoz

    Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz

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
  •  
5E Character Create Playlist

Log in

Log in