Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old August 30th, 2009, 06:02 PM
Hi all,
I'm entering the Complete warrior feat Power critical (page 103).
You get a +4 bonus on the dice roll to confirm a threat of a critical.

One pre requisite is Weapon Focus with weapon.
I've set the Pre req script to check for weapon focus, I've set restrict to picks on hero but when I test it on a fighter with two flavours of weapon focus "Short sword and Longsword" for example Power critical doesn't show the weapon drop down list to assign which weapon the feat is applied to.

How can I get the drop down list to display the weapon focus weapons selected by the Hero?

Any help please
bodrin is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,558

Old August 30th, 2009, 07:08 PM
Can't be done - the menu is looking for things (things have not been added to the hero), rather than picks (which are things that have been added to the hero), because every longsword a hero picks up receives weapon focus, not just the specific longsword that's in your inventory. Since they haven't been added to the hero yet, they can't have tags (like Broadcast.WepFocus] added to them.

You should use Greater Weapon Focus as your template for creating the dropdown menu and prereqs, since it's an example of something that requires weapon focus as a prereq. Unfortunately for the example, the actual testing of whether a weapon with Greater Weapon focus has Weapon Focus, too is handled outside the view of the user, so it doesn't offer a good example of that. In the Pathfinder files, I made sure to provide examples of that, so go into the Pathfinder editor (you can do this in demo mode even if you don't have Pathfinder enabled), and look up the eval rule on a feat called dazzling display - it'll give you the example of how to have your feat test for weapon focus on the weapons it's been selected for.
Mathias is online now   #2 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old August 31st, 2009, 09:24 AM
I know you said it can't be done but impossible is nothing.

I have something that almost works. If I select the weapons and add them to the inventory of a character they are selectable, however if the weapon gets removed then the feat has a no selection inside the box.

If i don't restrict to picks on hero then the assigned Power critical weapon box is left with the weapon showing.

I also get a existance tagExpr for pick fPowCrit is scheduled after primary condition test is scheduled. Error message!!!

I don't mind about adding the +4 bonus to the dice roll to confirm a threat as the player can do that anyway as they roll it.

Heres the code that I'm tinkering with any suggestions to the final version greatly welcomed.

At the moment I can only get this to work using the Broadcast.WepGrFoc tag but on the character sheet it Displays Power Critical : "Assigned Weapon XXXXX"

If i try to alter WepGrFoc to fPowCrit then it errors out.


Eval script pre-levels priority 5000 index 1

Code:
      ~ If we're disabled, do nothing
      if (tagis[Helper.FtDisable] <> 0) then
        done
        endif

      ~ If we haven't chosen anything, get out now
      if (field[fChosen].ischosen = 0) then
        done
        endif

      ~ Assign the appropriate tag to all weapons that meet the criteria
      var result as number
      var id as string
      id = field[fChosen].chosen.idstring
      foreach pick in hero where "IsWeapon." & id
        result = eachpick.assign[Broadcast.WepGrFoc]
        nexteach

      ~ Set our 'short name'
      if (field[fChosen].ischosen <> 0) then
        field[fShortName].text = "Power Critical: " & field[fChosen].chosen.field[name].text
        
        ~ Forward the Power Critical tag for the weapon to the hero
        result = field[fChosen].chosen.forward[WepGrFoc.?]
        endif
Eval rules script

I dont know if this is doing anything as it doesn't show an error message if i take power critical without weapon focus.

Validation phase priority 5000 index 1

Code:
~if a weapon's been selected for this feat
      if (field[fChosen].ischosen <> 0) then
      
        ~look through all the weapons
        foreach pick in hero where "component.BaseWep"
        
          ~if the weapon is the one we picked
          if (compare(eachpick.idstring,field[fChosen].chosen.idstring) = 0) then
          
            ~then we're good if it has Weapon focus
            validif (eachpick.tagis[Broadcast.WepFocus] <> 0)
            
            ~otherwise specify the error messages
            @message = "Power Critical taken without Weapon Focus for " & eachpick.field[name].text & "."
            @summary = "Power Critical without Weapon Focus."
            endif
          nexteach
          
      ~if nothing has been selected for this feat, we'll let other rules handle that
      else
        @valid = 1
        endif
Exp-reqs this just works
Code:
tagis[WepFocus.?] <> 0
Pre-reqs this is standard anyway

Code:
if (child[Attack].field[tAtkBase].value >= 4) then
          @valid = 1
          endif
bodrin is offline   #3 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old August 31st, 2009, 02:07 PM
Okay the code I submitted below actually works quite well.

There isn't an error message anymore?? I don't know why it just vanished after a reboot of the computer.

There is a drop down to select the weapon and it makes the feat valid once selected, apart from it adds the greater weapon focus +1 bonus to the attack roll shown on the hero panels.

I presume this has something to do with the
result = eachpick.assign[Broadcast.WepGrFoc] line. If I add Greater Weapon focus as well the attack bonus stays the same, due to the non stacking nature of the Players handbook feat.

So as the Power critical feat bonus is a +4 bonus on the dice roll to confirm a threat that stacks each time its taken for the particular weapon but applies separately to new weapons and the Greater Weapon focus feat +1 bonus doesn't stack even if taken more than once for the same weapon then all I need to do is override the WepGrFoc bonus in the eval rule of the Power critical. Is there any ides on how I can remove the +1 bonus from the tag WepGrFoc just for this feat.

The player can remember the +4 bonus when they roll for the threat!
bodrin is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,558

Old August 31st, 2009, 02:22 PM
Yes, assigning Broadcast.WepGrFoc to a weapon tells the program that the weapon has greater weapon focus - therefore give it the +1.

Actually, is there any other feat that requires this as a prereq? If there's no need to assign a broadcast tag for prereqs, and there's no reason to assign it so that another script can find it and use it, just don't assign a Broadcast tag. Delete the whole third section ("~assign the appropriate tag..." of your script and the second to last line ("result = field[fChosen].chosen.assign...").
Mathias is online now   #5 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old August 31st, 2009, 02:30 PM
I changed the GrWepFoc entry to WepFocus and it seemed to work, but when I selected Power Critical : Club for example the weapons TAB turned red.
When I investigated, the Club in the weapon inventory was highlighted in red but not showing anything else other than normal attack attributes.

Curiouser and Curiouser!!
bodrin is offline   #6 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old August 31st, 2009, 02:34 PM
This works no errors no red tabs or weapons.

Code:
      ~ If we're disabled, do nothing
      if (tagis[Helper.FtDisable] <> 0) then
        done
        endif

      ~ If we haven't chosen anything, get out now
      if (field[fChosen].ischosen = 0) then
        done
        endif

      ~ Set our 'short name'
      if (field[fChosen].ischosen <> 0) then
        field[fShortName].text = "Power Critical: " & field[fChosen].chosen.field[name].text 
endif
bodrin is offline   #7 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old August 31st, 2009, 02:38 PM
For some reason the weapon has to be in the inventory of the hero before Power critical will remain blue in colour and not stay red???

And the Eval Rule error message still doesn't appear if I take Power Critical without having a Weapon focus weapon.
Code:
Eval rules script

 I dont know if this is doing anything as it doesn't show an error message if i take power critical without weapon focus.

Validation phase priority 5000 index 1

 	Code:
 	~if a weapon's been selected for this feat
      if (field[fChosen].ischosen <> 0) then
      
        ~look through all the weapons
        foreach pick in hero where "component.BaseWep"
        
          ~if the weapon is the one we picked
          if (compare(eachpick.idstring,field[fChosen].chosen.idstring) = 0) then
          
            ~then we're good if it has Weapon focus
            validif (eachpick.tagis[Broadcast.WepFocus] <> 0)
            
            ~otherwise specify the error messages
            @message = "Power Critical taken without Weapon Focus for " & eachpick.field[name].text & "."
            @summary = "Power Critical without Weapon Focus."
            endif
          nexteach
          
      ~if nothing has been selected for this feat, we'll let other rules handle that
      else
        @valid = 1
endif

Last edited by bodrin; August 31st, 2009 at 02:41 PM.
bodrin is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 12,558

Old August 31st, 2009, 03:34 PM
Quote:
Originally Posted by bodrin View Post
For some reason the weapon has to be in the inventory of the hero before Power critical will remain blue in colour and not stay red???
Remember how I said looking for the weapons on the hero wouldn't work? This is why.

It looks like I've previously PMed you my email address. Why don't you go ahead and email me the file you're working on, and I'll modify Power Critical to give you an example of how to go about the others like it.
Mathias is online now   #9 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,263

Old September 1st, 2009, 03:18 AM
Doh, I feel like a right pratt now!!
bodrin is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

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:33 PM.


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