Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - D&D 5th Edition SRD (http://forums.wolflair.com/forumdisplay.php?f=89)
-   -   Either Or Pre-Requisite (http://forums.wolflair.com/showthread.php?t=61616)

xWhiteGodx November 21st, 2018 01:59 PM

Either Or Pre-Requisite
 
Hello all,

I'm trying to set up some chain-type things within HeroLab for a custom class. I'll keep it as to the point as possible:

Custom Ability is Telekinetic Blast [cTelekinWildTal]
Requirement for Custom Ability is the Custom Ability "Aether" [cTelekinet]
Next step progression is the Custom Ability "Aether" (It's the 2nd tier) [cEE1AetherKinet]
Final step progression is the Custom Ability "Aether" (It's the final tier) [cEE2AetherKinet]

I need[cTelekinWildTal] to be selectable within a Configure tab if either [cTelekinet] and [cEE1AetherKinet] are on the hero, or just [cTelekinet] or just [cEE1AetherKinet], or just [cEE2AetherKinet]

I suck at understanding and working the code system, and thus resort to finding alike things that I'm going for and copy/pasting until everything works as intended. This is what I have, and I don't think it's entirely right:

Code:

~ define a work variable of Valid Count
var ValidCnt as number

~ Set to initially a value of zero
ValidCnt = 0

~ If level 7+ and Expanded Element then we are valid
If (herofield[xTotalLev].value >= 7) Then
  ~ we also need Expanded Element to be valid
  If (#hasability[cEE1AetherKinet] <> 0) Then
      ValidCnt += 1
  Endif
Endif

~ If Elemental Focus and Expanded Element then we are also valid
If (#hasability[cTelekinet] + #hasability[cEE1AetherKinet] <> 0) Then
  ValidCnt += 1
Endif

~ If either test conditions above are VALID then we are valid
validif (ValidCnt > 0)


EDIT: Also, is there a way to make an eval script give an error in a panel if a per-requisite wasn't met?
EDIT2: How to set level requirements with an Eval Script?

I appreciate any and all help, thanks!

xWhiteGodx November 26th, 2018 09:19 AM

I figured out how to do it. I spend the past 48 hours researching and making everything good. When it comes to hierarchical setup, I had to set it up in a stepping method. This is what I ended up doing (with a different ability):

Code:

~ define a work variable of Valid Count
var ValidCnt as number

~ Set to initially a value of zero
ValidCnt = 1

~ If other elements, then invalid
If (#hasability[cGeokinet] + #hasability[cPyrokinet] + #hasability[cAirKinet] <> 0) Then
  ValidCnt -= 1
endif
~ If Hydro then we are valid
If (#hasability[cHydroKinet] <> 0) Then
  ValidCnt += 1
endif

If (#hasability[cEE1PyroKinet] + #hasability[cEE1GeoKinet] + #hasability[cEE1AirKinet] <> 0) Then
  ValidCnt -= 1
Endif

~ If Fire Element or Water then we are also valid
If (#hasability[cEE1HydroKinet] <> 0) Then
  ValidCnt += 1
endif

If (#hasability[cEE2PyroKinet] + #hasability[cEE2GeoKinet] + #hasability[cEE2AirKinet] <> 0) Then
  ValidCnt -= 1
Endif

If (#hasability[cEE2HydroKinet] + #hasability[cEE1HydroKinet] + #hasability[cHydroKinet] <> 0) Then
  ValidCnt += 2
endif

If (#hasability[cWaterWildTal] <> 0) Then
  ValidCnt -= 3
endif

If (#hasability[cEE2HydroKinet] + #hasability[cEE1HydroKinet] <> 0) then
  ValidCnt += 2
endif

If (#hasability[cEE2PyroKinet] + #hasability[cEE2GeoKinet] + #hasability[cEE2AirKinet] <> 0) Then
  ValidCnt -= 1
Endif

If (#hasability[cEE1PyroKinet] + #hasability[cEE1GeoKinet] + #hasability[cEE1AirKinet] <> 0) Then
  ValidCnt -= 1
Endif

~ If either test conditions above are VALID then we are valid
validif (ValidCnt >= 1)

Hopefully this helps anyone figure out how to self-solve an either-or for prerequisites.


All times are GMT -8. The time now is 04:41 PM.

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