Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
I have an ability that allows the wielding of spiked chains, and similar weapons, as one-handed weapons.
Scripts posted for future reference First 2000 Code:
~if we've been replaced, get out now doneif (tagis[Helper.SpcReplace] <> 0) ~if we aren't our chosen race get out now doneif (#hasrace[rFCOphiAng] = 0) foreach thing in BaseWep where "wFtrGroup.Flails" perform eachthing.pulltags[WepProf.?] perform eachthing.pulltags[wClass.?] nexteach ~ I don't know what this does but it's in the original script I've copied and modified. perform hero.pushtags[WepProf.?] perform hero.pushtags[wClass.?] ~ Cycle through and apply the Helper.ExoticProf tag to all examples of ~ the chosen weapon on the hero. This is important for the Aldori Dueling ~ Sword specifically, and possibly others. ~ I know this relates to Flails but i've left it alone. var searchexpr as string searchexpr = tagids[WepProf.?,"|"] foreach pick in hero from BaseWep where searchexpr perform eachpick.assign[Helper.ExoticProf] nexteach ~Lets assign the One Handed tag to our chosen weapon deleting the Two Handed tag first. foreach pick in hero from BaseWep where "wFtrGroup.Flails" perform eachpick.delete[wClass.TwoHanded] perform eachpick.assign[wClass.OneHanded] 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
Last edited by bodrin; August 25th, 2013 at 02:59 AM. Reason: Edited the script to include comments. |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
Are you having problems? Or does this work fine and you're just posting it so others can see and use it in the future?
|
#2 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
No problem, just posting a working script for future reference. Helping others, paying it forward.
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
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
If you want to post examples, I recommend you fix a few coding style issues:
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. Your WepProf and wClass tag handling should have comments - I can't figure out why you're forwarding those to the hero, or why you're pulling in two different tags, then only using one of them in the search. For a search through weapons, don't you want to use IsWeapon - that's the tag that means "we count as this weapon"? A single line of tagreplace[] can be used instead of two lines of delete[] and assign[]. I recommend making sure that the weapon is two-handed before assigning one-handed to it. Otherwise, you'll be assigning the one-handed tag to all the light weapons, too, and you'll be doubling up that tag on all the weapons that were already one-handed. Last edited by Mathias; August 23rd, 2013 at 09:00 AM. |
#4 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
Quote:
Once I'd got the desired effect I left it alone. I needed the race this applies to to gain the proficiency with the selected weapons, I presumed the push tags part would do that. Thank you for the tagreplace[] suggestion. I'll try this later. It's still a work in progress. 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
|
|
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
In my opinion, there is nothing in the programming field more despicable than an uncommented program. A programmer can be forgiven many sins and flights of fancy, however no programmer, no matter how wise, no matter how experienced, no matter how hard-pressed for time, no matter how well-intentioned, should be forgiven an uncommented and undocumented program.
Thats my favorite saying to give to my programmers when doing a code review. Its even written up in my standards document. Once a person has to debug a 3,000 line program without a single comment they will never leave code uncommented again.... 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. |
#6 |
Senior Member
Join Date: Apr 2010
Location: Lemont, IL
Posts: 320
|
If only we could get everyone to put comments in....what a wonderful world it would be!
|
#7 |
Senior Member
Join Date: Feb 2007
Location: Nottinghamshire, United Kingdom
Posts: 1,265
|
So the pushtags / pulltags comment would be :-
~ I don't know what this does but it's in the original script I've copied and modified. 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
|
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
If you took out that code what happened? What happens when you add it back in? Sometimes you have to find answers via trial/error and see what the results are when you do "X". Trust me I have no magic way of knowing what HL does. I have access to the same information everyone else on these boards do. I have learned that you often learn more from errors than from something that works. Heck just the other day I actually did some bad stuff so badly that it hard crashed HL. I quickly figured out that trying to inherit the tag group properties from a group that was defined afterwards is NOT good. The point is now I know and won't do that again. Plus if someone presented to me the same situation I can easily find the reason. Break scripts up into pieces and see what the results are of those pieces. Breaking things down to very very small pieces of code will help allot in how it all works together. 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. |
|
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
When fixing/debugging its very helpful to know the mind of the original programmer. 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. |
|
#10 |
Thread Tools | |
Display Modes | |
|
|