Thread: Retreiving Extension Info
-
August 29th, 2014, 21:59 #11
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!
-
August 30th, 2014, 09:36 #12
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
-
September 5th, 2014, 07:39 #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
CheersDulux-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
-
September 5th, 2014, 07:46 #14
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: 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!
-
September 18th, 2014, 09:25 #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.
CheersDulux-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
-
September 18th, 2014, 09:42 #16"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!
-
September 18th, 2014, 09:46 #17
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
-
September 18th, 2014, 10:12 #18
OK, got it sorted - will be posting some detailed documentation soon
CheersDulux-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