STAR TREK 2d20
  1. #1

    Extension "rules of the road" I like to follow

    Note for extension devs - a list of things you should be aware of when coding any extension:

    Others may be overriding the same code you are, always code as if this is the case. The following rules are what I try to follow:

    1) Try to call the original code before or after you have done what you need to do and always preserve and return a valid return code if required in the original code. Sometimes this is not possible as FGU is not famous for breaking out logically separate things into functions but instead leave them buried inside other code forcing a direct copy to be made. Conflicts are sometimes unavoidable.

    2) Do your best not to override things that are frequently subject to change by FGU. Find some lower or higher more stable area of the code to put your stuff into (making sure to follow rule 1).

    3) Load order can resolve conflicts. If you have to copy code (not call original so others that override it will get their stuff called) then make sure your code is as low a load order in extension.xml that you can get away with. This allows others who did not have to copy code - but could make the callback of the original code - have you both working as their higher load order will be called and so will yours.

    If you use these rules you will be less likely to cause conflicts. Though you will be subject to them by others if they don't do basic safe coding when playing with others. And of course, sometimes you or they can't avoid the conflict - and they will just conflict.

    EXTENSIONS = RISK

    Live with them and accept things won't always work together or get broken by FGU/others changes... or don't use/write them.
    Last edited by SilentRuin; February 5th, 2024 at 19:40.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

  2. #2
    Thank you for this, I'm just getting into FG mod building and all the guidance is helpful.

  3. #3
    Quote Originally Posted by avermhir View Post
    Thank you for this, I'm just getting into FG mod building and all the guidance is helpful.
    Well the first thing to know is a .mod file (module) is data - and an .ext file (extension) is code.
    Free(Forums/Forge) Extension(FGU 5E):
    Paid (Forge) Extension(FGU 5E):

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
  •  
Starfinder Playlist

Log in

Log in