Junior Member
Join Date: Dec 2013
Posts: 22
|
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. |
#1 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
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 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 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 |
#2 |
Junior Member
Join Date: Dec 2013
Posts: 22
|
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 |
#3 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
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 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. |
#4 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
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.?] 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 |
#5 |
Junior Member
Join Date: Dec 2013
Posts: 22
|
Edit: Never mind on that. Had to re-add something that got lost.
Last edited by Dimwhit; December 9th, 2013 at 12:01 PM. |
#6 |
Junior Member
Join Date: Dec 2013
Posts: 22
|
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. |
#7 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
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.
|
#8 |
Junior Member
Join Date: Dec 2013
Posts: 22
|
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.
|
#9 |
Senior Member
Join Date: Jul 2010
Posts: 3,147
|
No worries. You'll get used to it in time.
|
#10 |
|
|