PDA

View Full Version : Couple extension questions



daddyogreman
February 26th, 2021, 21:54
Is there a way to import another extension? If so, how would I go about doing that? And if so, is overriding functions in the imported extension as easy as it is to override functions in the rulesets?
Example:
I've got a CoreRPG Wound Overlay extension. Say I want to make a 5E specific Wound Overlay extension that takes the CoreRPG version and modifies it slightly. As opposed to copy/pasting, I want to import the code from the CoreRPG version.
If the CoreRPG version has a function named updateWoundOverlay maybe I want to call the CoreRPG version of that in my 5E, but insert some additional code. Or maybe I want to override that function entirely. How would I go about that?

Another question:
What's the best practice approach to documenting that an extension adds a slash command in the chat window? It's not showing up in /help when I've added one.

damned
February 26th, 2021, 23:30
There are some posts (somewhere) by Dulux-Oz where he shows how to prevent an extension from being selected on the campaign window unless the required extension is also selected. Its several years ago.

Add an Announcement ?

damned
February 26th, 2021, 23:34
It might as simple as:



<dependency>
<name>BaseExtension</name>
</dependency>

daddyogreman
February 26th, 2021, 23:37
It might as simple as:



<dependency>
<name>BaseExtension</name>
</dependency>


But how about within the new extension code itself when dealing with the dependency extension code? Is it just the same as say dealing with CoreRPG code in an extension?



Add an Announcement ?


Just wasn't sure if this was the way to go about it. Particularly if you happen to have a bunch of slash commands being added. Also not sure if there's a way to get them to show up when you type /help

daddyogreman
February 26th, 2021, 23:52
Tracked down the post. Thanks for pointing me in the right direction.


OK, I've got the data retrieval sorted - all except Ruleset Dependencies. The following is in the Extensions.xml file:



<properties>
<name>Test Extension</name>
<version>1.0</version>
<author>Matthew James BLACK.</author>
<description>An Extension to Test the Extensions Module.</description>
<ruleset>
<name>d20</name>
<minrelease>12</minrelease>
</ruleset>
<ruleset>
<name>My Ruleset</name>
<minrelease>2</minrelease>
<maxrelease>12</maxrelease>
</ruleset>
<dependency>
<name>Locations</name>
<minversion>1</minversion>
<maxversion>3</maxversion>
</dependency>
</properties>

damned
February 27th, 2021, 00:16
Your code doesnt know if the underlying code was loaded by CoreRPG, 5E (example) or an extension. The code it sees is all code that has been loaded to that point.

daddyogreman
February 27th, 2021, 00:18
Your code doesnt know if the underlying code was loaded by CoreRPG, 5E (example) or an extension. The code it sees is all code that has been loaded to that point.

Thanks for the help!
Still new to ALL of this - including lua.