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)
-   -   Having trouble learning to script (http://forums.wolflair.com/showthread.php?t=10816)

jkthomsen9 July 10th, 2010 11:47 AM

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

ShadowChemosh July 10th, 2010 12:10 PM

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
result = assign[Helper.SpcDisable]
done
endif

The fatigue and Exhausted are not tags they are actually Things with scripts attached to them. You can find them under the "Adjustment" tab in the editor. So what I did was check to see if A) they where found on the hero and B) to see if their was a check mark placed next to the ability or not.

Otherwise you where really close to having it...

Hope that helps.

rob July 10th, 2010 12:28 PM

Quote:

Originally Posted by jkthomsen9 (Post 41052)
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?

Hero Lab's design is not like a traditional programming language, since it does something very specialized. Consequently, there is no good book on how to use it. We've put together all the critical documentation within the Authoring Kit Wiki, which is available online.

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!

jkthomsen9 July 10th, 2010 05:40 PM

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.

Mathias July 10th, 2010 07:03 PM

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.