DICE PACKS BUNDLE
  1. #1

    Couple extension questions

    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.

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,649
    Blog Entries
    1
    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 ?

  3. #3

  4. #4
    Quote Originally Posted by damned View Post
    It might as simple as:

    Code:
    <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?

    Quote Originally Posted by damned View Post
    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
    Last edited by daddyogreman; February 26th, 2021 at 23:53.

  5. #5
    Tracked down the post. Thanks for pointing me in the right direction.

    Quote Originally Posted by dulux-oz View Post
    OK, I've got the data retrieval sorted - all except Ruleset Dependencies. The following is in the Extensions.xml file:

    Code:
    <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>

  6. #6
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,649
    Blog Entries
    1
    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.

  7. #7
    Quote Originally Posted by damned View Post
    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.

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