• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

How to enter custom data

asvaldson

Well-known member
I'm trying to insert the Superior Unarmed Strike feat from the Tomb of Battle, and I'm having a LOT of difficulty. Is there a printed guide on HOW to enter custom information? It is very obtuse for me at this point.
 
Last edited:
I'm still figuring it out myself, but I would start with the Monk's Belt (go to the Wonderous tab and select New (Copy) to select it) and copy the eval scripts. That should get you at least half way there. For the rest, you might go to the Class Special tab and use New (Copy) to get Improved Unarmed Damage (cMnkUnarmed) and copy that eval script. Both scripts would probably need to be edited to match the Superior Unarmed Strike feat, but that part should be relatively easy.

Hope this helps.
 
Those are both good places to start. Once you have some code, feel free to post it here for others to look at and help with, along with whether it is working or what issues you are having.
 
I think that part of the problem I'm running into, is that I don't know what language the code is supposed to be in. I took 2 years of High School Programming, which was Microsoft Quick Basic, and 1 semester of college programming, which was C+, and that was 10 years ago. I familiar with the theory of coding, but NOT the details. That's like knowing that there are nouns, verbs, and adjectives in a language, but not knowing the words or the order they are supposed to be in lol.

If someone could tell me what I should study on, to familiarize myself with the format, I can at least feel a little more comfortable.


Anyway, I snatched the Eval Script from Monk's Unarmed Strike, and then edited it for the feat, and this is the script I came up with.

if (field[xIndex].value <= 1) then
field[listname].text = "Unarmed Strike 1d4"
elseif (field[xIndex].value = 2) then
field[listname].text = "Unarmed Strike 1d6"
elseif (field[xIndex].value = 3) then
field[listname].text = "Unarmed Strike 1d8"
elseif (field[xIndex].value = 4) then
field[listname].text = "Unarmed Strike 1d10"
elseif (field[xIndex].value = 5) then
field[listname].text = "Unarmed Strike 2d6"
endif

~only perform the rest on the first copy
doneif (tagis[Helper.FirstCopy] = 0)

~ Get our unarmed strike pick, delete the damage tag from it, and assign
~ a new damage tag.
var dice as string
perform hero.child[wUnarmed].delete[wMain.?]
if (field[xAllLev].value < 4) then
perform hero.child[wUnarmed].assign[wMain.1d4_5]
dice = "1d4"
elseif (field[xAllLev].value < 8) then
perform hero.child[wUnarmed].assign[wMain.1d6_6]
dice = "1d8"
elseif (field[xAllLev].value < 12) then
perform hero.child[wUnarmed].assign[wMain.1d8_304]
dice = "1d10"
elseif (field[xAllLev].value < 16) then
perform hero.child[wUnarmed].assign[wMain.1d10_104]
dice = "2d6"
elseif (field[xAllLev].value < 20) then
perform hero.child[wUnarmed].assign[wMain.2d6_204]
dice = "2d8"
endif
field[livename].text = field[name].text & " (" & dice & ")"

It errors out when I test it, my theory is that when I changed the ELSEIF statements, when it assigns to [wMain.#d#_###], the part after the underline needs to be altered too, but I don't know what it is refering to. For instance, I changed

if (field[xAllLev].value < 4) then
perform hero.child[wUnarmed].assign[wMain.1d6_5]

to

if (field[xAllLev].value < 4) then
perform hero.child[wUnarmed].assign[wMain.1d4_5]
 
Now, the other option, since the feat works similar to the Monk's Robe, is to edit this script.

if (field[gIsEquip].value <> 0) then
~ If we're a monk, our AC and unarmed damage abilities get
~ 5 extra levels
if (hero.tagis[Classes.Monk] <> 0) then
hero.child[cMnkAC].field[xExtraLev].value += 5
hero.child[cMnkUnarm].field[xExtraLev].value += 5

~ Otherwise, we get 3 upgrades to our unarmed damage, and an AC bonus
~ assigned below
else
perform hero.child[wUnarmed].assign[Helper.DamageUp]
perform hero.child[wUnarmed].assign[Helper.DamageUp]
perform hero.child[wUnarmed].assign[Helper.DamageUp]
endif
endif

Again, though, I don't know where to begin. The initial IF statement would have to be changed, since it is a feat and not a piece of equipment, but I don't know what I should change it to. I know to cut the AC portion OUT of the script entirely, and to change the += to 4 instead of 5, but I don't even know HOW to begin the ELSE statement for if the user is not a monk. Do I splice in the script from the monk's unarmed damage with whatever corrections I need to make it workable?

I should have just stayed in college and pursued my computer science degree, who would have ever thought I'd want it 10 years later for gaming purposes lol.
 
Update: Ok, this isn't working for monk characters, but it does work for non-monk characters. I'll update if I figure it out. Also, you could probably put these two scripts together as one with an else (duh).

Ok, I think I got it working. Here's what I did:

First eval script:
if (hero.tagis[Classes.Monk] <> 0) then
hero.child[cMnkUnarm].field[xExtraLev].value = hero.child[cMnkUnarm].field[xExtraLev].value + 4
endif
Second eval script:
if (hero.tagis[Classes.Monk] = 0) then
~ Calculate our total character level
~ assigned to us
var level as number
level = herofield[tLevel].value

~ Get our unarmed strike pick, delete the damage tag from it, and assign
~ a new damage tag.
var result as number
var dice as string
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"
elseif (level < 20) then
result = hero.child[wUnarmed].assign[wMain.2d6_104]
dice = "2d6"
else
result = hero.child[wUnarmed].assign[wMain.2d6_104]
dice = "2d6"
endif
field[livename].text = field[name].text & " (" & dice & ")"
endif

First Expr-Req:
child[Attack].field[tAtkBase].value >= 3

Second Expr-Req:
#hasfeat[fImpUnarm] <> 0


The section that actually determines damage dice seems to be the [wMain.xxx_xxx]. I fiddled around with these until they stopped giving me errors, so the damage dice for 1d4 is [wMain.1d4_4]. I don't know how to determine what they should be beyond trial and error, but maybe someone else does.

Also, you'll see I put in if statements at the beginning of each eval script. The first only functions if you are a monk, and the second only functions if you aren't. The Expr-Req lines at the bottom are, of course, the prerequisites for the feat.

As for what language it is, I have no idea. I have a very limited background in programming. I taught myself html, but most other languages I can only edit.
 
Last edited:
I've reduced the eval scripts to one script, but unfortunately, I can't figure out why the first part doesn't work. It seems to be the same as the monk's belt, but it isn't getting used. Anyone have any idea?

var level as number
level = herofield[tLevel].value
var result as number
result = hero.child[wUnarmed].delete[wMain.?]
var dice as string

if (hero.tagis[Classes.Monk] <> 0) then
hero.child[cMnkUnarm].field[xExtraLev].value = hero.child[cMnkUnarm].field[xExtraLev].value + 4
else
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
 
Last edited:
Right. Forgot to put that in. Thanks. Unfortunately, that doesn't help the first section for if the character is a monk. It still doesn't add 4 levels for the purposes of Unarmed Damage as it should.
 
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.
 
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.
 
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.
 
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:

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:
hero.child[cMnkUnarm].field[xExtraLev].value += 4

This script doesn't work:
if (tagcount[Classes.Monk] <> 0) then
hero.child[cMnkUnarm].field[xExtraLev].value += 4
endif

This is true for both Pathfinder and d20.
 
Last edited:
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.
 
Code:
if (tagcount[Classes.Monk] <> 0) then
hero.child[cMnkUnarm].field[xExtraLev].value += 4
endif
This should be changed to:
Code:
if ([b][COLOR="Blue"]hero[/COLOR][/b].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.
 
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:
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
 
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.
 
Back
Top