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)
-   -   A few more script questions (http://forums.wolflair.com/showthread.php?t=59825)

Bob G December 27th, 2017 07:26 PM

A few more script questions
 
Hi everyone,

I've got a few more questions about scripts that are confounding me. Any help would be very appreciated.

1. Trying to put a class ability that grants fast healing when current hit points are below 50% of total hit points. I'm having trouble locating the child that current hit points are stored. Can anyone help direct me?

2. Another problem is a custom expression I am trying to write that does a foreach on memorized spells. I found a tag group name 'Memorized', so I used the following script:
Code:

foreach pick in hero from BaseSpell where "Memorized.?"
    field[usrCandid1].text = splice(field[usrCandid1].text, eachpick.tagids[thingid.?], " | ")
    nexteach

But the results produced all spells in the hero's spellbook, not just the ones they had memorized. What's the correct tag to use in the custom expression?

3. Lastly (same ability as #2), once the user selects a memorized spell, I want to change the tag or field to reflect that it has been cast. I found the field 'sCastCount', but that produced an error message, so I tried decreasing the field 'sCastLeft', which didn't error, but did not produce the desired result. Guidance on this would be great.

Thanks as always, and happy holidays to all of you.

Bob G December 28th, 2017 05:25 AM

Update to question 1: I found the child by using the 'Show Task List (Active Hero)' floating info window in the Develop menu! Total and current hit points are stored in the child "Totals".

I hope this helps anyone with similar problems.

Minous December 28th, 2017 10:23 AM

The spells cast is tracked in the in play or spells tab.

Bob G December 29th, 2017 04:14 AM

Quote:

Originally Posted by Minous (Post 260712)
The spells cast is tracked in the in play or spells tab.

Right, I found those, but none of the fields that I tried accomplish the goal. I tried 'sCastCount', but that produced an error message, so I tried decreasing the field 'sCastLeft', which didn't error, but did not produce the desired result. Not sure where to go from here.:confused:

Minous December 29th, 2017 06:48 AM

What are you trying to do with the loop/script?

Bob G December 29th, 2017 12:48 PM

Quote:

Originally Posted by Minous (Post 260736)
What are you trying to do with the loop/script?

I am trying to write that does a foreach on memorized spells. I found a tag group name 'Memorized', so I used the following script:

Code:

foreach pick in hero from BaseSpell where "Memorized.?"
    field[usrCandid1].text = splice(field[usrCandid1].text, eachpick.tagids[thingid.?], " | ")
    nexteach

But the results produced all spells in the hero's spellbook, not just the ones they had memorized. What's the correct tag to use in the custom expression?

The goal is to create a usr field where the candidates are memorized spells.

Aaron December 29th, 2017 05:38 PM

Is this limited to just spellbook casters, or should it be catching, for example, spells memorized by a cleric? Should it not be iterating through spells known, like a sorcerer gets?

Bob G December 29th, 2017 07:13 PM

Quote:

Originally Posted by Aaron (Post 260781)
Is this limited to just spellbook casters, or should it be catching, for example, spells memorized by a cleric? Should it not be iterating through spells known, like a sorcerer gets?

Just spellbook casters, this is a class ability for a class that memorizes arcane spells.

Aaron December 29th, 2017 07:53 PM

SpellType.cHelpXXX (replace XXX with whatever is appropriate for your class) and CasterType.MemBook

Bob G December 30th, 2017 08:07 AM

Quote:

Originally Posted by Aaron (Post 260783)
SpellType.cHelpXXX (replace XXX with whatever is appropriate for your class) and CasterType.MemBook

Thanks Aaron. I got an invalid tag expression when I used this script:
Code:

foreach pick in hero from BaseSpell where "SpellType.cHelpArn" &  "CasterType.MemBook"
I get the feeling it's because the tag "SpellType.cHelpArn" isn't located in the BaseSpell component.


All times are GMT -8. The time now is 06:01 AM.

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