• 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

Need help with Class Special Ability

Dimwhit

Member
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.
 

Attachments

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.
 
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
 
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.
 
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.
 
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.
 
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.
 
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. :)
 
Back
Top