Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Suggested Wealth for Level [Help] (http://forums.wolflair.com/showthread.php?t=67287)

ploturo 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.

Arkadious August 7th, 2022 02:23 AM

That code works great. I made a couple of tiny changes for what I wanted but yeah, thanks heaps! :) It's kinda frustrating how close it looked like I was to solving this myself and just not knowing what I was doing wrong.

Pre-levels, 4999
Code:


      ~ If we are under level 3 don't do anything as we will cause errors
      ~ Once we have three classes then we can modify it down to two.
      doneif (hero.tagcount[Classes.?] < 3)

      ~ Test to see if this does anything useful
      var nHitDice as number
      var nClasses as number
      var nGestalt as number
      var iX as number

      nHitDice = hero.tagcount[Hero.HitDice]
      nClasses = hero.tagcount[Classes.?]
      nGestalt = hero.tagcount[Classes.S2Gestalt]
      nHitDice = nHitDice - (nGestalt * 2)
      nClasses = nClasses - (nGestalt * 2)

      perform delete[Classes.S2Gestalt]
      perform hero.pulltags[Classes.?]
      perform hero.delete[Classes.?]

      iX = 0
      while (iX < nClasses)
        iX += 1
        perform hero.assign[Classes.S2Gestalt]
      loop

Pre-levels 5001
Code:


      ~ If we are under level 3 don't do anything as we will cause errors
      ~ Once we have three classes then we can modify it down to two.
      doneif (hero.tagcount[Classes.?] < 3)

      ~ Test to see if this does anything useful
      perform hero.delete[Classes.?]
      perform hero.pushtags[Classes.?]
      perform delete[Classes.?]

Really I should just stop here for now. Maybe once I get better at Hero Lab programming I'll try to fix the issue with the incorrect level showing for the mouseinfo section.

Thanks for the help everyone. I really do appreciate it.


All times are GMT -8. The time now is 12:54 PM.

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