• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Cutting feat taxes

Okay, I'm working on making the exception for NPCs, and I'm confused as !@##.

I've moved the rules to to the House Rules section, thus:

Code:
<source
    id="WiSParent"
    name="World is Square"
    parent="HouseRules"
    selectable="no"
    sortorder="0"
    description="Rules for eliminating feat taxes, as proposed by Michael Iantorno. Hero Lab implementation by Will Martin.">
    </source>

  <source
    id="WiSRules"
    name="Eliminate feat taxes"
    parent="WiSParent"
    description="Grants assorted bonus feats to characters, and combines others.">
    </source>

  <source
    id="WiSNPCTax"
    name="NPCs pay normal feat taxes"
    parent="WiSParent"
    description="NPC characters must purchase feats like Power Attack normally.">
    </source>

That correctly makes them show up like this:

house-rules-sc.png

I also added a custom tag, "WiSRules.PayFeatTax" in the .1st file. So far so good.

I added a Mechanics rule that tests for these things, and tag NPC heros as having to pay the tax:

Code:
doneif (hero.tagis[source.WiSRules] = 0)
doneif (hero.tagis[source.WiSNPCTax] = 0)

if (hero.tagis[CharType.typNPC] <> 0) then
    perform hero.assign[WiSRules.PayFeatTax]
endif

That runs at Pre-Levels 100, and appears to work correctly. That is:

1) If the whole source is disabled, it does nothing;
2) if the NPC tax is turned off, it does nothing;
3) if both are turned on, it tags NPCs, and NPCs only with WiSRules.PayFeatTax.

Here's where things break down. I went to the mechanic for bootstrapping Combat Expertise, and put in two tests:

Code:
doneif (hero.tagis[source.WiSRules] = 0)

~ We're an NPC, and subject to feat taxes, so we're done
doneif (hero.tagis[WiSRules.PayFeatTax] <> 1)

But my test characters kept getting Combat Expertise. PCs get it; NPCs get it. NPCs still get it if I check the box to tax them.

So I put in some debug statements:

Code:
debug "Is the source turned on? " & hero.tagis[source.WiSRules]
debug "Is this a taxed NPC? " & hero.tagis[WiSRules.PayFeatTax]

This tells me that the checkboxes from the hero configuration screen are working correctly; if they are checked, these test both return 1. If they are unchecked, both return 0.

Disabling the source entirely appears to work normally. I can turn off the whole rule set, and nobody gets anything they shouldn't. But trying to tax NPCs has no effect.

I tried flipping the polarity a few times -- compare against 0 rather than 1 in the check for WiSRules.PayFeatTax. This had no effect.

Finally, in desperation, I tried this:

Code:
doneif (hero.tagis[source.WiSRules] = 0)

~ We're an NPC, and subject to feat taxes, so we're done
doneif (hero.tagis[WiSRules.PayFeatTax] <> 0)

done

Note the last line: a plain, unqualified done, which is supposed to immediately terminate script execution ... and doesn't. The script hits that "done" and continues running, so everybody continues getting Combat Expertise.

Meanwhile, Weapon Finesse and Point Blank Shot appear to be working correctly with the exact same code. PCs always get them; NPCs get them until you check the box to tax NPCs, and then they stop getting them.

I don't understand. What's different? Why does it work in some places but not in others? I have no idea what's going on, but after beating my head against this for three hours, I'm calling it quits for the night.

I've attached update .user and .1st files -- the .1st is renamed .txt, as before.
 

Attachments

Try and use

doneif (hero.tagis[CharType.typNPC] <> 0)


Code:
doneif (hero.tagis[source.WiSRules] = 0)

~ We're an NPC, and subject to feat taxes, so we're done
doneif (hero.tagis[WiSRules.PayFeatTax] <> 0)

done

It is not the same method, setting up a tag, but does work. From what I saw from my tests, the WiSRules.PayFeatTax tag is applied from either source being selected. So as long as one is selected the answer will always be the true.
 
You haven't shown the bootstrap for combat expertise - what does its bootstrap condition look like?

What comes after the "done" line you're adding? What's in the rest of that script that "done" is intended to stop from happening?

Just to make sure you understand - done only applies to the current script. It does not stop the execution of any other scripts.
 
Wait, you mean the bootstrap isn't prevented by terminating the script? No wonder! I thought that killing the script would effectively disable the entire thing.

The bit after the "done" does this:

1) Assigns Helper.skipprereq to the feat so it won't trigger warnings on heroes who lack the ability score pre-req;
2) Disables and hides the feat if the hero doesn't have a +1 BAB.

That's it.

So all I need to do now is figure out 1) how to make the bootstrap conditional rather than just this script, and 2) figure out why Point-Blank Shot and Weapon Finesse appear to be working already.

Ugh. I still have so much to learn. This learning curve feels pretty steep compared to some other languages.
 
:rolleyes:

It'd be even nicer if all the documentation were in one place, instead of scattered across the help file, the authoring kit wiki, and assorted forum posts. Half the battle is figuring out where to look for the relevant docs.

A lot of the time I wind up hitting Google with searches limited to the forum, like "conditional preclude site:forums.wolflair.com" for example.
 
:rolleyes:

It'd be even nicer if all the documentation were in one place, instead of scattered across the help file, the authoring kit wiki, and assorted forum posts. Half the battle is figuring out where to look for the relevant docs.

A lot of the time I wind up hitting Google with searches limited to the forum, like "conditional preclude site:forums.wolflair.com" for example.
Wow so like a FAQ that combines all locations into one. Damn some one should have thought of that. :p

Or put into the bottom of EVERY post I make. Look in my signature. :)

It is a bit separated but why I did the FAQ long time ago. Put it in my signature. I really don't know a better way to do it but have a FAQ that links to all the different places to you can get information. Would it be nice to all be in one. But no one has the time to do that and the argument has happened a dozen times of "where" it should go. :(

And often I answer people with:
I would recommend reading the Glossary of Terms for the Editor. Then check out FAQ#2 for all the places to learn about the editor including YouTube videos.
 
Yes, Shadow, I'm well aware of your efforts, and have used them. I'm not trying to criticize.

I have read the documentation. Honestly! But reading isn't necessarily the same thing as understanding. At least twice now, I've figured out that the answer to a problem I was having was staring me right in the face, but I hadn't understood it because the explanation hinged on a piece of information from elsewhere in the documentation that I had missed earlier.

It's just a complicated system. It will take some time to get familiar and comfortable with the conventions of the language and the data model. In the meantime I am likely to continue making newbie errors, even after I have consulted the documentation (which I do!), because despite the community's best efforts, it's not always easy to find what I want to know.

It will take time. Frustration and ineffective flailing are all part of the learning process. I don't know about you, but I learn a heck of a lot more from screwing something up and then fixing it than I do from getting it right the first time. Failure is a better teacher than success.

So ... just bear with me. I'll try not to be too annoying.
 
Yes, Shadow, I'm well aware of your efforts, and have used them. I'm not trying to criticize.
Sorry! I was just trying to be joking about it and that failed badly! I really should not do that in text...

I have read the documentation. Honestly! But reading isn't necessarily the same thing as understanding. At least twice now, I've figured out that the answer to a problem I was having was staring me right in the face, but I hadn't understood it because the explanation hinged on a piece of information from elsewhere in the documentation that I had missed earlier.
In total agreement about this. The documentation does "answer" questions but no easy way to locate it all with a simple keyword search. That is where it all fails badly.

On the serious side I have heard a dozen times people talk about making a wiki or "something" all in one place documentation. Each time the talk pudders out as the "scope" of such a project is realized.

It's just a complicated system. It will take some time to get familiar and comfortable with the conventions of the language and the data model. In the meantime I am likely to continue making newbie errors, even after I have consulted the documentation (which I do!), because despite the community's best efforts, it's not always easy to find what I want to know.
Again totally agree and my post was not helpful. Sorry...

Trust me I get frustrated reading the Wiki myself as I read something and the use of "new" words LW invented (yes Rob has explained why) still causes confusion.

It will take time. Frustration and ineffective flailing are all part of the learning process. I don't know about you, but I learn a heck of a lot more from screwing something up and then fixing it than I do from getting it right the first time. Failure is a better teacher than success.
Totally agree. I am making changes to the UI stuff for d20 for LW. I added a new "deity" selection and that was DAYS of work. Trust me I used the words "LW" and some colorful four letter words a few times.

I was trying to joke and I need to remember it does not work in text... :(

So ... just bear with me. I'll try not to be too annoying.
Personally I think you are picking this stuff up very quickly actually. You have done allot already in a short time. You should be very proud of yourself for that. There is allot of fumbling here but when it comes together its so much fun! :D

P.S. - Honestly in person I make a allot of jokes actually but it comes out better in person...
 
Last edited:
It's all good, Shadow. ^_^

And thank you. It has felt like I've been making progress, at times hard-won. Half the time I think it helps having a background with other programming languages; the other half of the time, I think it's just giving me false friends:

Me: Where is the substring function? There's got to be a substring function. Everyone has a substring function! *waves hands in air to make point*

... 45 minutes of googling ...

Me: Mid? It's called mid? ... why is it called 'mid'? O_O Okay fine, whatever, it's mid, now I can get on with my life.
 
Me: Where is the substring function? There's got to be a substring function. Everyone has a substring function! *waves hands in air to make point*

... 45 minutes of googling ...

Me: Mid? It's called mid? ... why is it called 'mid'? O_O Okay fine, whatever, it's mid, now I can get on with my life.
I totally have to laugh at this because "almost" the exact same thing happened to me. Of course "Mid()" is for substring. LOL :D

It gets better you have not yet gotten to Gizmo's and Entities yet. :eek: But my total favorite is when you "Shadow" something. Rob knew one day I would be doing HL stuff so he named a whole section of code logic after me. No really, you all believe me right? :p
 
I totally have to laugh at this because "almost" the exact same thing happened to me. Of course "Mid()" is for substring. LOL

The rudimentary language syntax in HL is closest to Basic, so we used some of the names from Basic. In Basic, "Mid()" is the procedure call for extracting a substring. :p

I chose to use Basic, since I assumed it would be the language that users would be most likely to have some exposure to. Over the decade-plus that Hero Lab has been out, the language has morphed and evolved in directions that cater more to solving specific problems in modeling RPGs, but its roots are still anchored in Basic. :)

It gets better you have not yet gotten to Gizmo's and Entities yet. :eek: But my total favorite is when you "Shadow" something. Rob knew one day I would be doing HL stuff so he named a whole section of code logic after me. No really, you all believe me right?

If I wasn't prescient, I'd surprise myself sometimes. :)
 
LOL my "Summon Rob" spell was successful! I swear you must have a DB trigger setup that if a post says "Rob" it sends you an email or text alert. :)

The rudimentary language syntax in HL is closest to Basic, so we used some of the names from Basic. In Basic, "Mid()" is the procedure call for extracting a substring.

I chose to use Basic, since I assumed it would be the language that users would be most likely to have some exposure to. Over the decade-plus that Hero Lab has been out, the language has morphed and evolved in directions that cater more to solving specific problems in modeling RPGs, but its roots are still anchored in Basic.
That makes allot of sense. And googling Basic Substring does indeed say "MID()" is the function name. Also references Left/Right. Hmmm so I just need to google "Basic" function names to figure out HL ones..... ;)

Yeah things have progressed some as I have not done "Basic" sense my Commodore 64C days. Damn did I just date myself. :D

If I wasn't prescient, I'd surprise myself sometimes. :)
hehe Nice!
 
Ah ha! Basic, eh? That explains a lot.

I vaguely remember fiddling around with Basic for a few hours in ...1994, maybe? It didn't stick. Since then I've mostly worked in languages with C-like syntax.
 
I vaguely remember fiddling around with Basic for a few hours in ...1994, maybe? It didn't stick. Since then I've mostly worked in languages with C-like syntax.

You are way too young. Some of us had home computers which were entirely based on BASIC programming. Such as the wonderful Sinclair ZX80!
 
Aaaand it's ready. I've posted a separate thread, and asked people to put any bug reports/questions over there.

Everything seems to be working now. The checkbox for making NPCs pay feat taxes works correctly.

I also went ahead and put in the "Unarmed Combatant" feat from the updated feat chain that Michael Iantorno linked to above. Maybe I'll add some more from that source at some point, but for now I am ready to be done with this project for a while.
 
Yeah things have progressed some as I have not done "Basic" sense my Commodore 64C days. Damn did I just date myself. :D

You and me both.... LoL my first real 'playing around' with Basic was on a Commodore Vic 20. That 5K of RAM was something back then..... And so was saving to cassette tapes. :)
 
Back
Top