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
Bluephoenix
Member
 
Join Date: Nov 2010
Posts: 70

Old November 26th, 2010, 08:52 AM
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.
Attached Files
File Type: zip DMG - Katana.zip (521 Bytes, 3 views)

Last edited by Bluephoenix; November 26th, 2010 at 09:20 AM.
Bluephoenix is offline   #11 Reply With Quote
mxcpotato
Junior Member
 
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19

Old November 26th, 2010, 02:07 PM
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"
While valid, isn't working because the thingid.iMagWeapon tag is taking precedence over the IsWeapon.wSwordBast tag. I believe this is the case because even when I change the code to:
Code:
foreach pick in hero from BaseWep where "thingid.wSwordBast"
Which is a valid thingid on both a regular Bastard Sword and on the Magic/Masterworked version, it still ceases to function on the item as soon as you add the "thingid.iMagWeapon" tag by making it through the Custom/Magic Item option.

I have also tried:
Code:
foreach pick in hero from BaseWep where "thingid.iMagWeapon & thingid.wSwordBast"
which once again ceases to fuction at all on either type of wepon. Any help on why or what I may be missing would help

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
Sorry for such a lengthy post, just trying to clarify my findings.

Thank You,
mXcPotato
Attached Files
File Type: zip Samurai Test.zip (11.3 KB, 3 views)
mxcpotato is offline   #12 Reply With Quote
mxcpotato
Junior Member
 
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19

Old November 27th, 2010, 02:45 PM
@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.

Quote:
Originally Posted by Bluephoenix View Post
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.
^How do I do this?
mxcpotato is offline   #13 Reply With Quote
mxcpotato
Junior Member
 
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19

Old December 12th, 2010, 05:40 PM
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
mxcpotato is offline   #14 Reply With Quote
risner
Senior Member
Volunteer Data File Contributor
 
Join Date: Jun 2010
Posts: 623

Old December 12th, 2010, 09:47 PM
Quote:
Originally Posted by mxcpotato View Post
Is there a way to use "perform hero.assign[]" to add a feat?
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.
risner is offline   #15 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old December 13th, 2010, 01:29 AM
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.
Lawful_g is offline   #16 Reply With Quote
risner
Senior Member
Volunteer Data File Contributor
 
Join Date: Jun 2010
Posts: 623

Old December 13th, 2010, 01:32 AM
Quote:
Originally Posted by Lawful_g View Post
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.
I've got hours in trying this.
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.
risner is offline   #17 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old December 13th, 2010, 05:59 AM
Sure thing. I could use a break from my current job anyway. Gimme a second here.
Lawful_g is offline   #18 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old December 13th, 2010, 06:59 AM
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
Lawful_g is offline   #19 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old December 13th, 2010, 07:33 AM
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?
Lawful_g is offline   #20 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 02:15 PM.


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