Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Dimwhit
Junior Member
 
Join Date: Dec 2013
Posts: 22

Old December 8th, 2013, 07:28 AM
I'm pulling my hair out on this. I'm trying to teach myself the Editor and I'm muddling through, but I'm stuck on an issue I can't figure out. I'm working on adding a variant Fighter class (from an old Dragon Magazine), the Kensai. It picks a single martial or exotic melee weapon (got that figured out — I created a Kensai Weapon Proficiency feat that it gets for free at first level).

Anyway, at 1st level, a Kensai gets a +1 to hit and damage. I got that figured out. I create a Class Special with a lvl req of 1 and a source of Kensai. It hits on the Post-Level [User] phase. It works. The problem was the next one. I duplicated that ability and changed it to a lvl 5 Kensai requirement to give an additional +1 to hit and damage, running on the same phase. The problem is that the bonus is added at 1st level, not 5th. I'm sure I got everything changed from the duplication. But it's not waiting until 5th level to do it. Any idea why?

I also can't figure out (the tutorial doesn't go through things like my mind works, I think) how to have that bonus apply only to the weapon selected in the Kensai Weapon Proficiency feat I created. I have it applying to all melee damage. Anyone know how to explain that easily?

I have more questions, probably, but if I can figure out these two, it would help immensely. I went ahead and attached my .user file, in case that helps. It's a mess, though! Like I said, I'm still in the very early stages of learning all this.

Edit: I hope I have this in the right forum! Not sure if it should be here or the d20 forum.
Attached Files
File Type: zip whit.user.zip (1.4 KB, 2 views)
Dimwhit is offline   #1 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 9th, 2013, 06:11 AM
Ok, well, there's a lot going on here.

For starters, I noticed your pre-req for the Kensai Weapon Prof was incorrect. You'll want to do this:

Code:
child[Attack].field[tAtkBase].value >= 1
Notice the addition of the greater than symbol: ">". If you require that it = 1 then after 1st level, the requirement is no longer filled since you've increased your BAB. Whenever there is a minimum requirement, you'll want to use ">=".

Also, you don't need to use two specials to increase attack and damage. Here's an example of how to use one script to handle both plusses (drawing from your work):

Code:
if (#levelcount[K3nsai] >= 5) then
     hero.child[Attack].field[tAtkMelee].value = hero.child[Attack].field[tAtkMelee].value + 2
     hero.child[Damage].field[tDamBonus].value = hero.child[Damage].field[tDamBonus].value + 2
else
    hero.child[Attack].field[tAtkMelee].value = hero.child[Attack].field[tAtkMelee].value + 1
     hero.child[Damage].field[tDamBonus].value = hero.child[Damage].field[tDamBonus].value + 1
endif
Also, you can short-hand the above code as follows:

Code:
if (#levelcount[K3nsai] >= 5) then
     hero.child[Attack].field[tAtkMelee].value +=  2
     hero.child[Damage].field[tDamBonus].value +=  2
else
    hero.child[Attack].field[tAtkMelee].value +=  1
     hero.child[Damage].field[tDamBonus].value +=  1
endif
I believe there is a way to do this on the feat and to only add this to the weapon chosen, but I'm struggling with it a little bit. As soon as I figure it out, I'll add to this post.
Sendric is offline   #2 Reply With Quote
Dimwhit
Junior Member
 
Join Date: Dec 2013
Posts: 22

Old December 9th, 2013, 08:06 AM
Thanks! I'll work on these today. A question. On combining the two specials into one script…I'll have more to do at higher levels. This should work, right?

Code:
if (#levelcount[K3nsai] >= 11) then
     hero.child[Attack].field[tAtkMelee].value = hero.child[Attack].field[tAtkMelee].value + 3
     hero.child[Damage].field[tDamBonus].value = hero.child[Damage].field[tDamBonus].value + 3
elseif (#levelcount[K3nsai] >= 5) then
     hero.child[Attack].field[tAtkMelee].value = hero.child[Attack].field[tAtkMelee].value + 2
     hero.child[Damage].field[tDamBonus].value = hero.child[Damage].field[tDamBonus].value + 2
else
    hero.child[Attack].field[tAtkMelee].value = hero.child[Attack].field[tAtkMelee].value + 1
     hero.child[Damage].field[tDamBonus].value = hero.child[Damage].field[tDamBonus].value + 1
endif
Dimwhit is offline   #3 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 9th, 2013, 09:14 AM
Yep. There may also be another option. You can create a variable and design it to get the correct bonus, then use that to increase those fields. For example, if you wanted to start at 1 then increase it at every 5 levels:

Code:
var bonus as number

bonus = 1 + #levelcount[K3nsai]/5
bonus = round(bonus, 0, -1)

hero.child[Attack].field[tAtkMelee].value +=  bonus
hero.child[Damage].field[tDamBonus].value +=  bonus
Note: you have to run this post-levels because you are counting class levels. Post-levels/10000 is what I would run it at.

For more on rounding and other math functions, see this thread: http://forums.wolflair.com/showthread.php?t=21668

It's for Pathfinder, but a lot of it applies to d20 as well.
Sendric is offline   #4 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 9th, 2013, 09:35 AM
Incidentally, I got the other problem worked out. I saw your script on the Feat you created, but I have to admit I have no idea what you were doing there. It's not something I've seen before. In any case, I borrowed some code from Weapon Focus, and came up with the following two scripts you could put on your feat (with whatever editing you might need for the bonuses:

Script 1 gives the character proficiency with the weapon of choice:
Code:
First/10000

doneif (field[fChosen].ischosen = 0)

var id as string
 id = field[fChosen].chosen.idstring

  foreach pick in hero where "IsWeapon." & id
    perform eachpick.assign[Broadcast.WepProf]
  nexteach

  perform field[fChosen].chosen.forward[WepProf.?]
Script 2 increases attack and damage bonus to weapon:
Code:
Post-Levels/10000

doneif (field[fChosen].ischosen = 0)

var id as string
 id = field[fChosen].chosen.idstring

var bonus as number
 bonus = 1 + #levelcount[K3nsai]/5
 bonus = round(bonus, 0, -1)

  foreach pick in hero where "IsWeapon." & id
    each.field[wBonus].value += bonus
  nexteach
You would use these in place of the scripts currently located in your feat and class specials.
Sendric is offline   #5 Reply With Quote
Dimwhit
Junior Member
 
Join Date: Dec 2013
Posts: 22

Old December 9th, 2013, 11:47 AM
Edit: Never mind on that. Had to re-add something that got lost.

Last edited by Dimwhit; December 9th, 2013 at 12:01 PM.
Dimwhit is offline   #6 Reply With Quote
Dimwhit
Junior Member
 
Join Date: Dec 2013
Posts: 22

Old December 9th, 2013, 12:10 PM
I can't seem to get the attack/damage bonus thing to work out. I used that last script you posted. I tried adding a bootstrap to the proficiency feat, but that's a shot in the dark, since the whole bootstrap concept baffles me. I do have it executing at Post-Levels/10000.

Any thoughts on what to do to get it to get the bonus added? It is showing as a class special on the sheet. Just not calculating.
Dimwhit is offline   #7 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 9th, 2013, 12:25 PM
Using the file you posted, I added these scripts to the feat (Kensai Weapon Proficiency), not the class special. With this method, your class special won't need any scripts...just a description explaining what it is.
Sendric is offline   #8 Reply With Quote
Dimwhit
Junior Member
 
Join Date: Dec 2013
Posts: 22

Old December 9th, 2013, 12:32 PM
Ah! I misread you at the end there. Perfect! It's actually working. Thanks so much. I actually do php coding, but this still feels like a foreign language to me.
Dimwhit is offline   #9 Reply With Quote
Sendric
Senior Member
 
Join Date: Jul 2010
Posts: 3,147

Old December 9th, 2013, 12:40 PM
No worries. You'll get used to it in time.
Sendric is offline   #10 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 04:26 PM.


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