Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - User Projects
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old August 9th, 2010, 11:12 AM
I just tried it, and it seems to be the same. It might be that the if statement to determine if the character is a monk is failing, though I don't know why since it works for the Monk's Belt.
Sendric is offline   #11 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 9th, 2010, 11:45 AM
Timing is VERY important to this kind of advanced scripting. Does the timing off your new script run at the same timing or later than the Monk's Belt script? To test for the Class tag you would have to be running AFTER the class tag is applied to the hero.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #12 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 9th, 2010, 11:50 AM
FYI timing is when a script is run compared to other scripts. Its listed just above the Script itself in the window. The window actually calls it Phase: and Priority:. The first value Phase controls when so like Post-Abilities would be scripts that need to use the values of Str or Dex has been calculated. Priority is actually the timing inside of that specific phase. With lower values done first.

Hope that helps.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #13 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old August 9th, 2010, 11:51 AM
Wouldn't that only matter if you have the monk's belt equipped? I don't. Incidentally, I removed the initial if statement and just did one line for the script:

Quote:
hero.child[cMnkUnarm].field[xExtraLev].value += 4
This works.

I haven't gone through all the feats, but so far I don't see any others that really use an if statement like this. Could it be that it doesn't know how to handle an if statement for feats? I copied over the script from the Monk's Belt directly, and that didn't work either. It skipped over the stuff that should have been applied if the character was a monk.

FYI, phase = First and Priority = 100
Monk's Belt is First and 500, respectively. Both have a 1 as index. Not sure what that all means exactly.

Edit: Changed phase to Post-Levels and Post-Levels (Users), then tried Final Phase. Still nothing.

Edit 2:

Just to clarify the above:

This script works:
Quote:
hero.child[cMnkUnarm].field[xExtraLev].value += 4
This script doesn't work:
Quote:
if (tagcount[Classes.Monk] <> 0) then
hero.child[cMnkUnarm].field[xExtraLev].value += 4
endif
This is true for both Pathfinder and d20.

Last edited by Sendric; August 9th, 2010 at 12:34 PM.
Sendric is offline   #14 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old August 9th, 2010, 12:48 PM
For the original poster, to get around the problem I'm having with the if statement to determine if the character is a monk, you could create two feats, one that requires the character have monk levels and one that doesn't.
Sendric is offline   #15 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 9th, 2010, 01:13 PM
Quote:
Originally Posted by Sendric View Post
Code:
if (tagcount[Classes.Monk] <> 0) then
hero.child[cMnkUnarm].field[xExtraLev].value += 4
endif
This should be changed to:
Code:
if (hero.tagcount[Classes.Monk] <> 0) then
   hero.child[cMnkUnarm].field[xExtraLev].value += 4
endif
Otherwise you are checking the tagcount of the Thing the script is on and not the Hero(ie character) for the Classes.Monk tag.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #16 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old August 9th, 2010, 01:29 PM
Right. At some point I had that in there. Not sure how it came out. Thanks. Unfortunately, that doesn't solve the problem.

Last edited by Sendric; August 9th, 2010 at 01:35 PM.
Sendric is offline   #17 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 9th, 2010, 03:36 PM
So I just copy/pasted the script with the above fixes into HL on a new feat. I then created a new monk who had a Unarmed Strike that did 1d6. I added the feat and it changed it correctly to 1d8.

I then created a new Cleric and added the feat. It changed the damage to 1d4 and then when I added 4 more levels it was changed to 1d6 damage.

Maybe I am not getting it but what is not working?

Here is the script. Its Phase First Priority 500. Now this is in Pathfinder as I don't have d20 but they should be pretty similar.
Code:
~First 500
var level as number
level = herofield[tLevel].value
var result as number
var dice as string

if (hero.tagis[Classes.Monk] <> 0) then
  hero.child[cMnkUnarm].field[xExtraLev].value += 4

else
  result = hero.child[wUnarmed].delete[wMain.?] 
  if (level < 4) then
    result = hero.child[wUnarmed].assign[wMain.1d4_4]
    dice = "1d4"
  elseif (level < 8) then
    result = hero.child[wUnarmed].assign[wMain.1d6_5]
    dice = "1d6"
  elseif (level < 12) then
    result = hero.child[wUnarmed].assign[wMain.1d8_6]
    dice = "1d8"
  elseif (level < 16) then
    result = hero.child[wUnarmed].assign[wMain.1d10_304]
    dice = "1d10"
  else
    result = hero.child[wUnarmed].assign[wMain.2d6_104]
    dice = "2d6"
  endif

  field[livename].text = field[name].text & " (" & dice & ")"
endif

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #18 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old August 9th, 2010, 03:59 PM
Well, it works now. Obviously, I must have had a typo somewhere. /sigh. Thanks for your help.
Sendric is offline   #19 Reply With Quote
asvaldson
Senior Member
 
Join Date: Mar 2010
Posts: 184

Old August 9th, 2010, 06:21 PM
You guy are all awesome. I appreciate everything you guys have done, this has shown me some more information i have to watch out for to do these scripts. Thank you.
asvaldson is offline   #20 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:37 AM.


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