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
mxcpotato
Junior Member
 
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19

Old November 24th, 2010, 11:50 PM
I spent a great deal of today trying to build the Samurai base class, and ran into a bit of a hitch and was wondering if I could get some help.

my first problem is with this script:

~ 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.iMagWeapon"
if (each.field[gIsEquip].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.iMagWeapon"
if (each.field[wIs2nd].value <> 0) then
perform hero.assign[Hero.TwoWep]
done
endif
nexteach

It works great for Two Swords as One, but I don't know how to modify it add a feat for the later versions (Imp. Two Swords as One, and Greater).

The second problem I am having is with the Kiai Strike ability. I attempted to set it up in the same manner Smite Evil appears to be, but i must have buggered the script somewhere.

included is a pretty finished version of the Samurai, all errors included.

Thank You,
mXcPotato.
Attached Files
File Type: zip PotatoSamruai.user.zip (3.2 KB, 0 views)
mxcpotato is offline   #1 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old November 25th, 2010, 03:01 AM
Have you tested that script extensively? Looking at it off the top of my head I think it would check to see if any magic/custom weapon is equipped, not just a katana and wakizashi as you want.
Lawful_g is offline   #2 Reply With Quote
mxcpotato
Junior Member
 
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19

Old November 25th, 2010, 11:27 AM
Right, the problem is that katanas and wakizashis are masterwork versions of bastard swords and short swords respectively, and the uniqueID for that is iMagItem. if you make them as magic items, such as iKatana, then the player cannot upgrade them, and if you make them a new item, wKatana, then when you go to upgrade them using Custom/Magic Items in the Weapons tab as they become iMagItem and the scirpt fails to recognize them -_-
Is there a way to make a Magic Item in the editor that can have enchantments added to it without changing its uniqueID?

Thank You,
mXcPotato
mxcpotato is offline   #3 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old November 25th, 2010, 02:33 PM
Have you thought about adding specials called Katana and Wakasashi into the user file, then bootstrapping them onto the items. Your script could then check for the imagitem tag as well as the bootstrapped ids.

If its a Magic item but not a Katana or Wakasashi then it's false.
bodrin is offline   #4 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old November 25th, 2010, 02:42 PM
There is a way to look for the weapon that is linked to the iMagItem thing, I did it once... let me try and look up where...
Lawful_g is offline   #5 Reply With Quote
Lawful_g
Senior Member
Volunteer Data File Contributor
 
Join Date: Mar 2007
Posts: 1,245

Old November 25th, 2010, 03:07 PM
Err, nevermind it is simpler than I gave it credit for, just check for the appropriate IsWeapon tag on the iMagItem thing.

Like so:

var isfound as number
foreach pick in hero where "thingid.iMagWeapon"

if (each.tagis[IsWeapon.wSwordBast] <> 0) then

if (each.field[gIsEquip].value <> 0) then
isfound = 1
endif

endif
nexteach
Lawful_g is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old November 25th, 2010, 04:35 PM
Lawful_g, don't forget to use from statements in foreaches if possible, and that "each" is deprecated - "eachpick" is preferred.

Code:
 
var isfound as number
foreach pick in hero from BaseWep where "thingid.iMagWeapon & IsWeapon.wSwordBast"
  if (eachpick.field[gIsEquip].value + eachpick.field[wIs2nd].value <> 0) then
    isfound = 1
    endif
  nexteach
Mathias is offline   #7 Reply With Quote
mxcpotato
Junior Member
 
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19

Old November 25th, 2010, 09:35 PM
Wow!!! Thank you guys so much for all of your help! especially with the holidays, I had to work on it for a little bit because I was actually learning it as I went' but with your help I got some code that actually worked.

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.iMagWeapon"
if (each.field[gIsEquip].value + each.tagis[IsWeapon.wSwordBast] <> 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.iMagWeapon"
if (each.field[gIsEquip].value + each.tagis[IsWeapon.wShortswd] <> 0) then
perform hero.assign[Hero.TwoWep]
done
endif
nexteach
Thank you guys again for the help!
now is there a way I can have it add a feat instead of the
"preform hero.assign[Hero.TwoWep]"?

Thank You Thank You Thank You!
mXcPotato
mxcpotato is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old November 25th, 2010, 09:59 PM
Note that the script you've written will be fine if there's an equipped +1 longsword on the character, rather than an equipped Katana.

field[gIsEquip].value - that's whether or not the weapon is equipped in the primary hand

each.tagis[IsWeapon.wSwordBast] - that will be 1 if this is a bastard sword, 0 if not.

By adding them together, and checking that the total is not = 0, you're asking whether either is true.

May I recommend starting with my script - that checks whether it's a bastard sword separately from checking whether it's equipped, and by looking at wIs2nd as well, it's checking if the weapon is equipped in the off hand.
Mathias is offline   #9 Reply With Quote
mxcpotato
Junior Member
 
Join Date: Sep 2010
Location: Sacramento, CA
Posts: 19

Old November 26th, 2010, 12:55 AM
Quote:
Originally Posted by Mathias View Post
Note that the script you've written will be fine if there's an equipped +1 longsword on the character, rather than an equipped Katana.
Yeah, it seems to do the exact same thing my first one did and count any magic weapon. _-_

However, when I attempt to apply your code into the mix it either achieves the same results, or fails to resolve at all (as in no Two Weapon Fighting). I thought I had it, guess I am missing something key though. I'll have to try tomorrow when I'm not so tired.

Thank you for your continued help and patience,
mXcPotato
mxcpotato 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 12:46 AM.


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