DICE PACKS BUNDLE
  1. #1

    Creating a different Initiative Extension for 5e/CoreRPG

    I've been trying to create an initiative sorting system for 5e primarily, but I suppose it could be applied to other rpgs easily. It's intended to be an implementation from this video by Taking20 (skip to 6:02 for the actual system): https://youtu.be/SXleyDvtqls.

    For those (understandably) disinclined to watch the video, the initiative is as follows: Roll the PCs and friendly NPCs as normal, roll only the highest Initiative value for the foes, then sort the two groups with the highest two placed on top, intersperse the groups together one-by-one (PC, NPC, and so on). There would be background randomization to the non-highest initiative foes and friendly NPCs. Any additional combatants added after initiative is rolled are added to the bottom of the initiative order, regardless of faction and without rolling their initiative.



    ---Example 1:
    PC A: 16
    PC B: 4
    PC C: 13

    FOE F: 16 (highest initiative)
    FOE G: -
    FOE H: -
    FOE I: -

    Result
    1. PC A
    2. FOE F
    3. PC C
    4. FOE G
    5. PC B
    6. FOE H
    7. FOE I

    ---Example 2:
    PC A: 15
    PC B: 17
    PC C: 19

    FOE K: 21
    FOE L: -

    Result
    1. FOE K
    2. PC C
    3. FOE L
    4. PC B
    5. PC A



    After a few hours of diving into the CoreRPG files and the 5e ruleset, I'm stumped because I do not know where to begin. My initial thought is to override (if possible in lua) the CombatManager.setCustomSort() but in reality I seek to preserve the order it provides and merely add a step to it. The use of the "friendfoe" value would also simplify the sorting process.

    Any suggestions, tutorials, or similar extensions?

    Thanks, DannyDM

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,291
    Welcome to the FG forums! I've moved this thread to The Workshop forum as that's the best place to ask about coding. The Armory -> Extensions sub-forum is primarily used for sharing completed extensions.

    CombatManager.setCustomSort() is probably where you'd need to do some coding. You'd also need to decide when to trigger the sorting using the windowlist control applySort function: https://fantasygroundsunity.atlassia...list#applySort

    As this initiative ordering relies on all initiatives being rolled before applying the sorting - but you'd also need some additional code to setup the values before the sorting. It might be easiest to add a button to the CT that does this - so the GM can wait for all initiatives to be rolled before the custom code to pre-sort and then actually sort the records in the CT.
    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!

  3. #3
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    26,638
    Blog Entries
    1
    in terms of applying the sort I wouldnt adjust the sort order.
    Id be doing something like:

    have players roll - collect the rolls - this would likely be a new button the charsheet
    have a gm button to roll - this would likely be a new button the ct
    compare the highest result

    If the GM result is highest,
    assign the first NPC 20 init
    assign the first PC 19 init
    assign the second NPC 18 init
    assign the second NPC 17 init etc

    this way you dont have to change the sort order, you have to manage applying an appropriate Init only

    thats at least how I think I would tackle it

  4. #4
    I have just completed writing the extension to accomplish this.
    I will be putting it on FG Forge, but because it is the first time for me to do this, I need to be verified, then the extension needs to be verified.
    I will update this thread along with one in the workshop when it is available.
    Original_Init.png
    AlternatingInit.png
    Last edited by lprchaun; March 3rd, 2023 at 20:46.

  5. #5

  6. #6
    Quote Originally Posted by damned View Post
    Well done lprchaun
    Thanks

    added a post here.
    https://www.fantasygrounds.com/forum...532#post680532
    Last edited by lprchaun; March 5th, 2023 at 22:08.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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