Having trouble learning to script
I am trying to code the water rat feat from savage tide adventure path. I am trying to get it to disable the feat if you are in medium/heavy armor, encumbered, or fatigued or exhausted. I got most of it to work but am having trouble with the fatigue and exhausted line. This is the code I used. On a second note I have no education in programing. Where is a good book/web resorce I could use to learn the basics to program herolab?
elseif (hero.tagis[pcnFatigue] + hero.tagis[pcnExhaust] <> 0) then result = assign[Helper.SpcDisable] done The full code is listed below. ~ If we're disabled, do nothing doneif (tagis[Helper.FtDisable] <> 0) var result as number ~ If we fail the test for being speedy, get out if (hero.tagis[Encumbered.Heavy] + hero.tagis[Encumbered.Medium] <> 0) then result = assign[Helper.SpcDisable] done elseif (hero.tagis[Hero.MedArmor] + hero.tagis[Hero.HeavyArmor] <> 0) then result = assign[Helper.SpcDisable] done elseif (hero.tagis[pcnFatigue] + hero.tagis[pcnExhaust] <> 0) then result = assign[Helper.SpcDisable] done endif #skillbonus[skSwim] += 2 if (#skillranks[skSwim] >= 10) then #skillbonus[skSwim] += 2 endif |
Here is the fix for the line in trouble.
Code:
elseif (hero.childfound[pcnFatigue].field[pIsOn].value + hero.childfound[pcnExhaust].field[pIsOn].value <> 0) then Otherwise you where really close to having it... Hope that helps. |
Quote:
You can access the Authoring Kit via the Windows Start menu, as it is listed in the group of shortcuts next to Hero Lab itself. Alternately, you can go there directly via the URL below: http://hlkitwiki.wolflair.com/index.php5?title=Home The most important sections are "Basic Concepts and Terminology" and "Kit Reference". Hope this helps! |
Thank you both for the info. I am now tryimg to add a swim speed that is equal to your land speed. I know how to bootstrap it but I need it to turn off if in armor or encumbered. This is the code I tryed with many varibles of the same.
hero.child[xSwim].field[Value].value = hero.child[Speed] I am not even sure if this will give the special ability of swim if I figured out the value error. |
Go to the "R Cust Spec" tab, and make a copy of the "Additional Movement: Swim (rcEiSwim)" ability - that ability gives Animated Objects a swim speed equal to their land speed, so copy that (including its timing - there's a limited window between when land speed is finished and when swim speed is finished).
Also, take a close look at how that ability bootstraps swim - it adds an abValue of 5, so that there is a positive swim speed when it comes time to check whether the swim skill should be a class skill at +8 (which has to happen before the land speed is calculated). |
All times are GMT -8. The time now is 09:00 PM. |
Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.