Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
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 August 23rd, 2013, 03:03 PM
Quote:
Originally Posted by ShadowChemosh View Post
Are you trying to make the person proficient with the weapons also as that is what it is doing by pushing the tags to the hero.

Yes. And it worked as intended.

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community
bodrin is offline   #11 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old August 25th, 2013, 03:33 AM
Newest iteration of the working script
Code:
~if we've been replaced, get out now
        doneif (tagis[Helper.SpcReplace] <> 0)
         doneif (tagis[Helper.SpcDisable] <> 0)

  ~if we aren't our chosen race get out now
        doneif (#hasrace[rFCOphiAng] = 0)
       
  ~ We need to be proficient with these weapons
        foreach thing in BaseWep where "wFtrGroup.Flails"
         perform eachthing.pulltags[WepProf.?]
          nexteach

          perform hero.pushtags[WepProf.?]
      
  ~ Now assign the One Handed tag whilst deleting the 
   ~ tag Two Handed but we need to check that we are not a light
    ~ or One handed weapon first
         doneif (tagis[wClass.OneHanded] <> 0)
          doneif (tagis[wClass.Light] <> 0)
           
         foreach pick in hero from BaseWep where "wFtrGroup.Flails"
          perform eachpick.tagreplace[wClass.?,wClass.OneHanded]
           nexteach  
      
   ~ Cycle through and apply the Helper.ExoticProf tag 
    ~ to all examples of the chosen weapon on the hero.
     ~ This could be important for the future.
          var searchexpr as string
           searchexpr = tagids[WepProf.?,"|"]

          foreach pick in hero from BaseWep where searchexpr
           perform eachpick.assign[Helper.ExoticProf]
            nexteach

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community
bodrin is offline   #12 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 25th, 2013, 07:59 AM
Quote:
Originally Posted by bodrin View Post
Newest iteration of the working script
I think to help everyone lets go through this script in small pieces...

Code:
~if we've been replaced, get out now
doneif (tagis[Helper.SpcReplace] <> 0)
doneif (tagis[Helper.SpcDisable] <> 0)
Quote:
Originally Posted by Mathias View Post
You should never use SpcReplace as your test for whether something is disabled. SpcReplace should never be present without SpcDisable also being present, because it's there only to describe why a thing was disabled, and there are many things that will disable without replacing.
So Mathias is saying that you should never ever need to check for Replace tag. We only want to check to see if we are disabled or not. So the above script should become:
Code:
~if we've been disabled, get out now!
doneif (tagis[Helper.SpcDisable] <> 0)

Code:
  ~if we aren't our chosen race get out now
        doneif (#hasrace[rFCOphiAng] = 0)
This bit of code is locking us to a single specific race and will NOT run on any other race. I have to ask why as you may later wish to use this Racial Special on a different race. As we have to be bootstrapped to the race in the editor putting in such a check is not needed. This should be removed.

Code:
~ We need to be proficient with these weapons
foreach thing in BaseWep where "wFtrGroup.Flails"
     perform eachthing.pulltags[WepProf.?]
nexteach

perform hero.pushtags[WepProf.?]
Foreach loops are VERY CPU intensive so if we can combine things together we should combine them into single foreach loops. So this section we will get back too.

Code:
~ Now assign the One Handed tag whilst deleting the 
~ tag Two Handed but we need to check that we are not a light
~ or One handed weapon first
doneif (tagis[wClass.OneHanded] <> 0)
doneif (tagis[wClass.Light] <> 0)
So the above is saying to test our Racial Special to see if our Racial Special ability is a One Handed or Light weapon??? This seems to fall into the same idea of testing to see if our Racial Special is a Vegetable or not. Logically are Racial Special is not going to have tags for being One Handed or Light. On top of that you are saying we have to have a value 0 or FALSE. Meaning your double checking that your Racial Special really does not have Weapon Tags.

So these checks just need to go away.

Code:
foreach pick in hero from BaseWep where "wFtrGroup.Flails"
    perform eachpick.tagreplace[wClass.?,wClass.OneHanded]
nexteach
Unless giving your code to LW you really should line up the Blocks of Code. So that the "IF" lines up with an "ELSE" and the "foreach" lines up above the "nexteach". Its VERY old school coding where blocks of code don't line up.

So the above has no comments but my take is that you are trying to convert all Fails (including Light, One-handed, and Two-Handed) into One Handed fails. Cause that is what the above is doing. From earlier posts your idea is to ONLY convert Two-handed flails. So you want the following:
Code:
~ Find all Two-Handed fails on the Hero and change them to one-handed weapons
foreach pick in hero from BaseWep where "wFtrGroup.Flails & wClass.TwoHanded"
    perform eachpick.tagreplace[wClass.TwoHanded,wClass.OneHanded]
nexteach
Note this will change even more in the final script though as we want to combine multiple foreach loops together.


Code:
   ~ Cycle through and apply the Helper.ExoticProf tag 
    ~ to all examples of the chosen weapon on the hero.
     ~ This could be important for the future.
          var searchexpr as string
           searchexpr = tagids[WepProf.?,"|"]

          foreach pick in hero from BaseWep where searchexpr
           perform eachpick.assign[Helper.ExoticProf]
            nexteach
Looking around this appears to automatically make a person proficient with this weapon even if it is exotic. Looks like the code came from cleric domain. This here can be combined with above code to reduce the number of foreach loops we are doing. The primary loop is needed as its pulling from Things and these later loops are doing Picks but we want to reduce the code as much as we can.

Here is a final script. I just tested it out and it works and only converts two-handed weapons to one-handed but makes the character proficient with all flails.

Code:
~ If we've been disabled, get out now!
doneif (tagis[Helper.SpcDisable] <> 0)

~ Pull all the Flail proficincy tags to ourself. 
~ Note: This is pulling from Things not Picks. This means
~       the weapons do NOT have to be live on the character.
foreach thing in BaseWep where "wFtrGroup.Flails"
   perform eachthing.pulltags[WepProf.?]
nexteach
~ Push all the Wepon Proficiency tags to the hero.
~ This will make our character proficient with all flails.
~ Note: This means the script should run as early as possiable.
perform hero.pushtags[WepProf.?]
      
var searchexpr as string
~ Build a search sting of all the Fail Weapons we pulled above
searchexpr = tagids[WepProf.?,"|"]
~ Loop through all the weapons that are actually present on the
~ character based on the search expression built from the WepProf tags.
~ We can only modify tags on a Pick which is why we are doing a 2nd 
~ foreach loop.
foreach pick in hero from BaseWep where searchexpr
   ~ If we are a two-handed weapon convert us to a one-handed
   perform eachpick.tagreplace[wClass.TwoHanded,wClass.OneHanded]
   ~ If we are an exotic weapon assign helper tag to make us 
   ~ proficient
   If (eachpick.tagis[wProfReq.Exotic] <> 0) Then
      perform eachpick.assign[Helper.ExoticProf]
   Endif
nexteach

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #13 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old August 25th, 2013, 12:42 PM
I doff my cap to the codemeiester.

Nicely done Shadow,

This is for a specific variant of race however there are 3 types but only one can wield Spiked chains or similar weapons, ie Flails one handed. The rest just need to be proficient with them.

Also Double weapons aren't affected by this either.

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community
bodrin is offline   #14 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old August 25th, 2013, 03:09 PM
Quote:
Originally Posted by bodrin View Post
I doff my cap to the codemeiester.

Nicely done Shadow,
Thanks but was just trying to be helpful in going over the code. I figured that it may help you or others. Guess it sort looks like I was showing off but that was not the case.

Quote:
Originally Posted by bodrin View Post
This is for a specific variant of race however there are 3 types but only one can wield Spiked chains or similar weapons, ie Flails one handed. The rest just need to be proficient with them.
Ahhh. See how though a comment to exactly what you have above would have made that clear for the next person. And the idea is that a comment should be in plain English for best affect.

Quote:
Originally Posted by bodrin View Post
Also Double weapons aren't affected by this either.
Is this just a statement or asking for help to change the script to not affect double weapons?

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #15 Reply With Quote
bodrin
Senior Member
 
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265

Old August 25th, 2013, 04:44 PM
Quote:
Originally Posted by ShadowChemosh View Post
Is this just a statement or asking for help to change the script to not affect double weapons?
Not just a statement, a veiled request.

However I tinkered around with this but of code, plugged it into the optimised script

Code:
If (eachpick.tagis[wCategory.Double] <> 0) Then
      perform eachpick.tagreplace[wClass.?,wClass.TwoHanded]
   Endif
And it worked. Unless you can see anything that needs amending this ability is done.

Dormio Forte Somnio


Community Created Resources :
Data Package Repositories :
d20pfsrd
Custom Character Sheets
Community Server Setup (Packs)

Hero Lab Help- Video Tutorials and Pathfinder FAQ

Created by the community for the community
bodrin is offline   #16 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 11:51 PM.


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