Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ploturo
Member
 
Join Date: May 2021
Posts: 84

Old August 6th, 2022, 06:48 PM
Pulling tags copies them to the current pick (the one running the script) from whatever other pick/container you've have navigated to as part of the pull command.

Pushing tags copies them from the current pick to whatever other pick/container you've navigated to as part of the push command.

We don't actually need the foreach to pull tags from all the picks on the hero, since they have all already been added to the hero container at the timing we are interested in.

One minor issue is that the class helper will already have one class tag for your Gestalt class on it already, so that has to be taken into account to make sure the number of tags doesn't get screwed up.

This code assumes (pretty safely, I hope?) that there will always be at least one Classes.S2Gestalt tag on the hero, because I'm assuming the helper wouldn't be loaded if there are no levels of its class.

Pre-levels:4999
Code:
    ~ if there is only one class tag on the hero, we don't need to do anything
    doneif (hero.tagcount[Classes.?] <= 1)
    
    ~ attempt to calculate the actual level of the character
    var nClasses as number
    var nGestalt as number
    nClasses = hero.tagcount[Classes.?]
    nGestalt = hero.tagcount[Classes.S2Gestalt]
    nClasses = nClasses - (nGestalt * 2)

    ~ our minimum level is the number of gestalt class tags added, even if
    ~  the player hasn't chosen which classes to use for gestalt levels
    nClasses = maximum(nClasses, nGestalt)

    ~ delete the existing Classes.S2Gestalt tag on this helper to avoid extra tag
    perform delete[Classes.S2Gestalt]

    ~ copy all the existing Classes.? tags from the hero to this helper
    ~  and then delete those tags from the hero
    perform hero.pulltags[Classes.?]
    perform hero.delete[Classes.?]

    ~ add the correct number of temporary class tags back to the hero
    var iX as number
    iX = 0
    while (iX < nClasses)
        iX += 1
        perform hero.assign[Classes.S2Gestalt]
    loop
Pre-levels:5001
Code:
    ~ if only one class tag on this helper, we don't need to copy anything back
    doneif (tagcount[Classes.?] <= 1)
    
    ~ delete the temporary class tags we added to the hero at Pre-levels:4999
    perform hero.delete[Classes.?]
    
    ~ copy the tags on this helper back to the hero and delete them from here
    perform hero.pushtags[Classes.?]
    perform delete[Classes.?]
    
    ~ add back the original class tag that is supposed to be on this helper
    perform assign[Classes.S2Gestalt]
You could add the timing requirement that the 4999 script needs to run before "Component Totals: Eval Script #40" and the 5001 needs to run after it, just to document why the timings were selected for anyone else working on the code later.
ploturo is offline   #11 Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:25 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.