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
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old March 1st, 2009, 10:14 AM
Another Complete Warrior Feat.

Does anyone have any idea how to script the Improved Weapon Familiarity Feat to assign all Exotic weapons associated with the race of a character as Martial weapons instead, including any weapons that contain the name of the race too EG:- Elven Thinblade= Martial weapon for Elves.

I've looked at the Exotic weapon proficiency feat for ideas, and the Dwarven Urgrosh weapon but I can only see the Easy if Race tick box to make the individual weapon one proficiency lower than needed.

I found this code elsewhere on the forum but it refers to bootstrapping, at the moment i don't know how or what Bootstrapping is.
Code:
if (hero.tagis[Hero.ProfMart] <> 0) then
var result as number
result = hero.assign[WepProf.wGythka]
endif
Thanks for any help in advance.
bodrin is offline   #1 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old March 1st, 2009, 10:19 AM
Found an old file with this Improved Weapon Familiarity script i'd entered a year and a half ago!

Code:
Eval Script Phase first Priority 1000 index 1
var result as number
      result = hero.assign[Hero.ProfMart]
Code:
Pre Req
Base attack +1 Required
       if (child[Attack].field[tAtkBase].value >= 1) then
          @valid = 1
          endif
It seems to only assign the Martial weapon proficiency though and not tie it to any race so it may need tweaking!

Last edited by bodrin; March 1st, 2009 at 10:37 AM.
bodrin is offline   #2 Reply With Quote
AWizardInDallas
Senior Member
 
Join Date: Aug 2008
Location: Plano, TX
Posts: 147
Send a message via AIM to AWizardInDallas Send a message via MSN to AWizardInDallas Send a message via Yahoo to AWizardInDallas Send a message via Skype™ to AWizardInDallas

Old March 2nd, 2009, 02:53 PM
I'm not sure myself but need to work this one out as well. I do know how to check for race:

@valid=tagis[Race.Elf]

This is from one of my weapon group feats: Axes (from the Unearthed Arcana):

Code:
perform hero.assign[WepProf.wHandaxe] 
perform hero.assign[WepProf.wBattleaxe] 
perform hero.assign[WepProf.wGreataxe]
perform hero.assign[WepProf.wWaraxeDw]

var hasfeats as number 
hasfeats = hero.pickexists[fWGrpSpear] + hero.pickexists[fWGrpDbl]

if (hasfeats = 2) then 
  if (hero.pickexists[wUrgroshDw] = 0) then
    perform hero.assign[WepProf.wUrgroshDw] 
  endif
  perform hero.assign[WepProf.wAxeOrcDbl] 
endif
So that would give you how to assign proficiency based on a condition, i.e. check for race and then assign proficiencies.
AWizardInDallas is offline   #3 Reply With Quote
AWizardInDallas
Senior Member
 
Join Date: Aug 2008
Location: Plano, TX
Posts: 147
Send a message via AIM to AWizardInDallas Send a message via MSN to AWizardInDallas Send a message via Yahoo to AWizardInDallas Send a message via Skype™ to AWizardInDallas

Old March 2nd, 2009, 02:57 PM
So I would guess this would work for example:

Code:
var israce as number
israce = tagis[Race.Elf]

if (israce > 0 ) then
  perform hero.assign[WepProf.wThinBlade]
endif
AWizardInDallas is offline   #4 Reply With Quote
AWizardInDallas
Senior Member
 
Join Date: Aug 2008
Location: Plano, TX
Posts: 147
Send a message via AIM to AWizardInDallas Send a message via MSN to AWizardInDallas Send a message via Yahoo to AWizardInDallas Send a message via Skype™ to AWizardInDallas

Old March 2nd, 2009, 03:09 PM
Also decided to check to make sure they have the martial weapon proficiency. So, code, final version for elf is:

Code:
~ If you're an elf you're proficient with Elven weapons.
var israce as number
var hasfeat as number
israce = tagis[Race.Elf]
hasfeat = #hasfeat[fWepMart] + #hasfeat[fMartial]

if (israce > 0 ) then
  if (hasfeat > 0) then
    perform hero.assign[WepProf.wThinBlade]
    perform hero.assign[WepProf.wLightBld]
    perform hero.assign[WepProf.wDoubleBow]
  endif
endif
Again, haven't tested it but it should work.
AWizardInDallas is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 2nd, 2009, 03:20 PM
Note that you'll need hero.tagis[Race.Elf], rather than tagis[Race.Elf] - your proficiency isn't an elf.

and to simplify:

if (hero.tagis[Race.Elf] <> 0 then

will work just as well as declaring a variable, setting the variable, and then testing the variable.
Mathias is offline   #6 Reply With Quote
AWizardInDallas
Senior Member
 
Join Date: Aug 2008
Location: Plano, TX
Posts: 147
Send a message via AIM to AWizardInDallas Send a message via MSN to AWizardInDallas Send a message via Yahoo to AWizardInDallas Send a message via Skype™ to AWizardInDallas

Old March 2nd, 2009, 03:55 PM
Ah, good eye...corrected. Yeah, I just prefer to use the same method rather than a variable for one thing and a tag for another. To each his own.
AWizardInDallas is offline   #7 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old March 2nd, 2009, 04:13 PM
if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then

works, too.
Mathias is offline   #8 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old March 5th, 2009, 12:58 AM
Thank you for the help on this one.
Here's the full working script for my Elven Thinblade and Lightblade. I'll integrate the Gnome, Orc, Half Elf, Dwarf and other races later.

Code:
~ If you're an elf you're proficient with Elven weapons.
var hasfeat as number

if (hero.tagis[Race.Elf] <> 0) then
  if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then
    perform hero.assign[WepProf.wElvLigBla]
    perform hero.assign[WepProf.wElvThiBla]
   endif
endif
bodrin is offline   #9 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old March 6th, 2009, 09:27 AM
Hers a strange one guys!

The following code for the Improved Weapon Familiarity feat worked perfectly until I added the Half-Orc race.

On a test character with all the Race weapons added the Axe, Orc Double isn't assigned to the Half-Orc as proficient, the other races, Elf, Half-Elf and so on do get assigned correctly. Changing the race in real time worked superbly until, as stated, the Half-Orc.

Current Script!
Code:
~ If you're an elf you're proficient with Elven weapons.
var hasfeat as number

if (hero.tagis[Race.Elf] <> 0) then
  if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then
    perform hero.assign[WepProf.wElvLigBla]
    perform hero.assign[WepProf.wElvThiBla]
   endif
endif

~ If you're an Dwarf you're proficient with Dwarven weapons.
var hasfeat as number

if (hero.tagis[Race.Dwarf] <> 0) then
  if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then
    perform hero.assign[WepProf.wWaraxeDw]
    perform hero.assign[WepProf.wUrgroshDw]
   endif
endif

~ If you're an Gnome you're proficient with Gnomish weapons.
var hasfeat as number

if (hero.tagis[Race.Gnome] <> 0) then
  if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then
    perform hero.assign[WepProf.wHammerGnm]
    endif
endif

~ If you're a Half-Orc you're proficient with Orcish weapons.
var hasfeat as number

if (hero.tagis[Race.HalfOrc] <> 0) then
  if (#hasfeat[fWepMart] + #hasfeat[fMartial] <> 0) then
    perform hero.assign[WepProf.wAxeOrcDbl]
    endif
endif
However after further investigation I noticed that the code isn't actually doing anything, it is only reading the "Easy If Race" tick box for the racial weapons.

I assigned the Easy if race to the Elven thinblade and the lightblade but the Gnome hammer and the Dwarven weapons are classed as martial for the race anyway.
It was only when the Orc Axe flagged as non proficient and I removed the Easy if race tick from the Thinblade and Lightblade that I realised this.

Anymore Ideas?
bodrin 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 01:53 PM.


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