![]() |
Member
Join Date: May 2021
Posts: 79
|
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 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] |
![]() |
![]() |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
That code works great. I made a couple of tiny changes for what I wanted but yeah, thanks heaps!
![]() 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 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.?] Thanks for the help everyone. I really do appreciate it. |
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|