Member
Join Date: Nov 2010
Posts: 70
|
one method you could try was rather than searching for what the katana is equivalent to, create a new weapon in the editor with the appropriate qualities, label it exotic (since it requires exotic prof. according to the DMG), and use the elven courtblade as an example of how to make it still use feats labeled for bastard swords.
then in the script you can look for the specific weapon using picks on hero rather than using the complicated look for magic item script. a little extra effort perhaps, but it makes the complicated stuff simpler. Edit: had some time so I created the katana and wakizashi, file attached item IDs for them are wKatana and wWakizashi respectively secondary edit: realized magic weapons cannot be modified, and changed them to regular weapon classes with a +1 attack roll modifier instead. Last edited by Bluephoenix; November 26th, 2010 at 09:20 AM. |
#11 |
Junior Member
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19
|
After spending some time on this I have come to the conclusion that the statement:
Code:
foreach pick in hero from BaseWep where "thingid.iMagWeapon & IsWeapon.wSwordBast" Code:
foreach pick in hero from BaseWep where "thingid.wSwordBast" I have also tried: Code:
foreach pick in hero from BaseWep where "thingid.iMagWeapon & thingid.wSwordBast" Attached is a copy of my file for the class as well as a second level samurai with regular Bastard Sword/ Shortsword and Masterwork version of each. you can see how it works. in my .user file i went with this code: Code:
~ Find a Katana equipped in the primary hand - if we don't find it, ~ get out now. var isfound as number foreach pick in hero where "thingid.wSwordBast" if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then isfound = 1 endif nexteach if (isfound = 0) then done endif ~ Now find a Wakizashi in the secondary hand - if we find it, ~ we can add the 'two weapon fighting' tag to the hero, then ~ get out. foreach pick in hero where "thingid.wShortswd" if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then perform hero.assign[Hero.TwoWep] done endif nexteach Thank You, mXcPotato |
#12 |
Junior Member
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19
|
@Bluepheonix
Thank you for doing this, I had already done it but reading your post made me think of something, so i tried reimplementation of my own wKatana & wWakizashi, and found something else interesting. If you just buy the Katana & Wakizashi as normal weapons (assuming base lvl2 Samurai, no stat alterations) then each weapon will be at +3(+2 BaB, +1mw). However if you attempt to make a magic item out of it by going to Magic,Custom & Masterwork Items, and stop after choosing either of them, you'll see that the attack bonus is only +2. Also even when replacing the thingIDs in my previous script with the new ones, it ceases to work if they become magic, Unless i also have the mundane equivalents equip as well. ^How do I do this? |
#13 |
Junior Member
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19
|
Is there a way to use "perform hero.assign[]" to add a feat? I looked on the Wiki to no avail, and perform hero.assign[Feat.ImpTwoWep] doesn't work.
I need to go about it this way because it has to go at the bottom of the same script i've been posting to grant Imp TWF, and Greater TWF. Good news is i figured out how to apply Kiai smite. yay! Thank You, mXcPotato |
#14 |
Senior Member
Volunteer Data File Contributor
Join Date: Jun 2010
Posts: 623
|
Assign adds tags, not feats.
Feats can only be bootstrapped, and you can't add feats via scripts. You could add a bootstrap to the feat in the ability and script the disabling of the feat (FtHide) and then script unhiding it when you want it unhidden. |
#15 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Or you could bootstrap the feat and give it a condition that looks for a User tag on the hero. Only if this condition is fulfilled (i.e the tag is present) will the feat be bootstrapped. The just write an eval script that assigns that User tag or not as appropriate.
|
#16 |
Senior Member
Volunteer Data File Contributor
Join Date: Jun 2010
Posts: 623
|
Quote:
Can you post an example? If I do anything that scripts adding the tag to the hero, it is always done later than the bootstrap. So it never gets bootstrapped. |
|
#17 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Sure thing. I could use a break from my current job anyway. Gimme a second here.
|
#18 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Alright, got it. I don't think bootstrapping the feat on and off is the best way to do this, although it could be done that way. I'd rather follow your original approach of applying the Hero.TwoWep tag.
It was mostly a timing issue, at First 100 when you were running the script I don't think the iMagWeapon thing had taken any information from it's gizmo. So even though you were asking if it was a bastard sword, the info hadn't been pulled yet. Here is the code, I tested it a bit but run it through it's paces yourself. Replace the current Eval Script for Two Swords as One with this. I would recommend you set the phase and priotity at Pre-Levels 10000 ~ Search through all base weapons for anything that is a Magical Weapon or a Bastard Sword var bastard as number foreach pick in hero from BaseWep where "thingid.iMagWeapon|IsWeapon.wSwordBast" ~ Are we a bastard sword? (automatically yes for normal bastard swords, but may be yes or no for magical weapons) if (eachpick.tagis[IsWeapon.wSwordBast] <> 0) then ~ Are we equipped in either hand? if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then bastard = 1 endif endif nexteach ~ Now find the same for short swords. var shorty as number foreach pick in hero from BaseWep where "thingid.iMagWeapon|thingid.wShortswd" if (eachpick.tagis[IsWeapon.wShortswd] <> 0) then ~ Are we equipped in either hand? if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then shorty = 1 endif endif nexteach ~ If we have any number of bastard swords equipped bastard will be 1, and if we have any number of short swords equipped shorty should be 1. If we have both short swords and bastard swords equipped they will be 2 when added, and we should apply the two weapon fighting tag. if (bastard + shorty = 2) then perform hero.assign[Hero.TwoWep] endif |
#19 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Bootstrap conditions are important though, so it'd be instructive to tell you about them here. I noticed that your 8th level "Improved Initiative" Class Ability has bootstrapped the Improved Initiative feat. Well without a bootstrap condition that feat and it's effects will be present on a 1st level Samurai (I see a similar issue with the Improved and Greater Two Swords as One).
Go the Improved Initiative Class Ability, click on the Bootstrap button. To the right of the feat, there are 3 buttons, click on Conditions. This is where you can set rules for the bootstrap, if everything checks out then the bootstrap will go through, otherwise it won't. Unfortunately, this "Tag Expression" window does not take kindly to the usual scripting... in fact I haven't quite figured it out myself. So far I know you can check for tags on the hero and the value of a field (maybe on the hero, maybe on the item itself?) The most common condition is a certain number of class levels. You can do that by running the below at First 500: count:Classes.WHATEVER >= SOMENUMBER Where Whatever is the name of the class in question (not the name of the Class Level or the Class Helper, add a level of the class in question and look at the tags on the hero) and Somenumber is the minimum level before the thing should be bootstrapped. So in the example of your Improved Initiative Feat the bootstrap condition would be count:Classes.Samurai >= 8 If you did want to do the above two weapon fighting thing via bootstrapping the feat rather than assigning the tag you could. You would have to make a new User tag and stick it on the class ability. You can make new User tags by scrolling to the bottom of most panels in the editor, clicking on the User Tags 'Edit' button, and then 'New Tag' at the top. Keep in mind that a tag must be on something for HL to know it exists, if you remove it from the last thing it is on (or delete that thing) HL will erase it the next time it loads, which will screw up any scripts you have written relying on the now disappeared User tag. For example you could make a tag called User.Winner on the Two Swords as One ability. Then you would want to move the phase and priority of the previous post's code up to maybe First 1000. Otherwise the code would be the same except instead of "perform hero.assign[Hero.TwoWep]" it would be "perform hero.assign[User.Winner]". Then the class ability would bootstrap fTwoWep with a condition at about First 10000 saying: count:User.Winner >= 1 Fascinating, no? |
#20 |
|
|