PDA

View Full Version : NPC Melee and Ranged Weapon Designation?



WillowWyatt
March 2nd, 2021, 08:48
So maybe I just missed this, but is there any way to designate that an attach on an NPC is a melee attack or a ranged attack? The problem that I'm having is that I have created a Power Attack effect that applies the attack and damage modifiers to hit and damage. This works fine for the PCs. However, it applies the penalty/bonus to all NPC attacks whether they are melee or ranged. I believe the problem is that the parser doesn't distinguish between these two attack styles.

For example, he is the effect I am using:

Power Attack (+1 BAB/1H); ATK: -1 melee; DMG: 2 melee

And here is the attack line of the NPC: I am a spammer

short sword +11 (1d6+3/18-20) or dagger +11 (1d4+1/19-20) or light crossbow +11 (1d8/19-20)

As I stated above, when the Power Attack effect is applied to the NPC on the combat tracker, the penalty to hit and the bonus to damage is applied whether he attacks with the short sword or the light crossbow. Is there any fix for this?

dellanx
March 2nd, 2021, 10:17
So maybe I just missed this, but is there any way to designate that an attach on an NPC is a melee attack or a ranged attack? The problem that I'm having is that I have created a Power Attack effect that applies the attack and damage modifiers to hit and damage. This works fine for the PCs. However, it applies the penalty/bonus to all NPC attacks whether they are melee or ranged. I believe the problem is that the parser doesn't distinguish between these two attack styles.

For example, he is the effect I am using:

Power Attack (+1 BAB/1H); ATK: -1 melee; DMG: 2 melee

And here is the attack line of the NPC:

short sword +11 (1d6+3/18-20) or dagger +11 (1d4+1/19-20) or light crossbow +11 (1d8/19-20)

As I stated above, when the Power Attack effect is applied to the NPC on the combat tracker, the penalty to hit and the bonus to damage is applied whether he attacks with the short sword or the light crossbow. Is there any fix for this?

Try this:

light crossbow +11 ranged (1d8/19-20)

DCrumb
March 2nd, 2021, 15:30
So maybe I just missed this, but is there any way to designate that an attach on an NPC is a melee attack or a ranged attack? The problem that I'm having is that I have created a Power Attack effect that applies the attack and damage modifiers to hit and damage. This works fine for the PCs. However, it applies the penalty/bonus to all NPC attacks whether they are melee or ranged. I believe the problem is that the parser doesn't distinguish between these two attack styles.

For example, he is the effect I am using:

Power Attack (+1 BAB/1H); ATK: -1 melee; DMG: 2 melee

And here is the attack line of the NPC:

short sword +11 (1d6+3/18-20) or dagger +11 (1d4+1/19-20) or light crossbow +11 (1d8/19-20)

As I stated above, when the Power Attack effect is applied to the NPC on the combat tracker, the penalty to hit and the bonus to damage is applied whether he attacks with the short sword or the light crossbow. Is there any fix for this?

You will need to open the sheet for the NPC from the combat tracker, then unlock it (lock symbol on the upper right). Once you do that, you will be able to edit the attacks by adding melee or ranged after each attack. So for your example: short sword +11 melee (1d6+3/18-20) or dagger +11 melee (1d4+1/19-20) or light crossbow +11 ranged (1d8/19-20).

bmos
March 10th, 2021, 14:40
Sometimes you will have to do what dellanx and DCrumb have said, but I think there is another issue at play here:

There's a weird situation with effects that isn't well known.
Your effect should be Power Attack (+1 BAB/1H); ATK: -1 ,melee; DMG: 2 ,melee
because it doesn't have a bonus type assigned, the extra comma has to be there so it doesn't try to add it as a "+1 melee bonus" (like a "+1 luck bonus")

However I also have another suggestion that is now possible thanks to the new update:
Power Attack 1-H; ATK: -1 [-QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee
Power Attack 2-H; ATK: -1 [-QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee

If you use this, you will not have to change the numbers in the effect when the characters level up (or figure out what the numbers should be for NPCs).

dellanx
March 13th, 2021, 14:28
Sometimes you will have to do what dellanx and DCrumb have said, but I think there is another issue at play here:

There's a weird situation with effects that isn't well known.
Your effect should be Power Attack (+1 BAB/1H); ATK: -1 ,melee; DMG: 2 ,melee
because it doesn't have a bonus type assigned, the extra comma has to be there so it doesn't try to add it as a "+1 melee bonus" (like a "+1 luck bonus")

However I also have another suggestion that is now possible thanks to the new update:
Power Attack 1-H; ATK: -1 [-QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee
Power Attack 2-H; ATK: -1 [-QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee

If you use this, you will not have to change the numbers in the effect when the characters level up (or figure out what the numbers should be for NPCs).

Is [-QBAB] or [QBAB] part of the ruleset now?

Corun
March 13th, 2021, 15:06
Is [-QBAB] or [QBAB] part of the ruleset now?
This was implemented to ruleset in recent update:
https://www.fantasygrounds.com/forums/showthread.php?66789-Proposed-improvement-to-variable-numbers-in-effects

Changelog for rulesets can is linked in this post:
https://www.fantasygrounds.com/forums/showthread.php?66895-FG-Ruleset-Updates-2021-03-09

dllewell
March 16th, 2021, 19:13
Sometimes you will have to do what dellanx and DCrumb have said, but I think there is another issue at play here:

There's a weird situation with effects that isn't well known.
Your effect should be Power Attack (+1 BAB/1H); ATK: -1 ,melee; DMG: 2 ,melee
because it doesn't have a bonus type assigned, the extra comma has to be there so it doesn't try to add it as a "+1 melee bonus" (like a "+1 luck bonus")

However I also have another suggestion that is now possible thanks to the new update:
Power Attack 1-H; ATK: -1 [-QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee
Power Attack 2-H; ATK: -1 [-QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee; DMG: 1 [QBAB] ,melee

If you use this, you will not have to change the numbers in the effect when the characters level up (or figure out what the numbers should be for NPCs).

If you want to make it even more succinct you can combine the multiple DMG modifiers to a single DMG entry.
Power Attack 1-H; ATK: -1 [-QBAB] ,melee; DMG: 2 [QBAB] [QBAB] ,melee;
Power Attack 2-H; ATK: -1 [-QBAB] ,melee; DMG: 3 [QBAB] [QBAB] [QBAB] ,melee;

Which may, or may not, be less confusing :)

bmos
March 16th, 2021, 21:28
If you want to make it even more succinct you can combine the multiple DMG modifiers to a single DMG entry.
Power Attack 1-H; ATK: -1 [-QBAB] ,melee; DMG: 2 [QBAB] [QBAB] ,melee;
Power Attack 2-H; ATK: -1 [-QBAB] ,melee; DMG: 3 [QBAB] [QBAB] [QBAB] ,melee;

Which may, or may not, be less confusing :)Interesting! I guess that means you could do something like ATK: [WIS] [HLVL] to get wis mod + half the level? had no idea it accepted multiple inputs

dllewell
March 16th, 2021, 21:39
Interesting! I guess that means you could do something like ATK: [WIS] [HLVL] to get wis mod + half the level? had no idea it accepted multiple inputs

I tested that to make sure and yes that works fine.

DCrumb
March 17th, 2021, 04:22
So a question on what H[TAG], T[TAG], and Q[TAG] return? Do they only return whole numbers? Or do they return fractions? If they only return whole numbers, the expression becomes easier for damage: DMG: 2 2[QBAB] ,melee and DMG: 3 3[QBAB] ,melee.

Kelrugem
March 17th, 2021, 04:27
So a question on what H[TAG], T[TAG], and Q[TAG] return? Do they only return whole numbers? Or do they return fractions? If they only return whole numbers, the expression becomes easier for damage: DMG: 2 2[QBAB] ,melee and DMG: 3 3[QBAB] ,melee.

They always return total numbers :)

Your formulas are wrong by the way, multipliers need to be in the square brackets like [2BAB], and they cannot be combined with Q etc., so, neither 2[QBAB] nor [2QBAB] will work :)

DCrumb
March 17th, 2021, 05:27
So we don't have multipliers outside of other tags? So no 2*2d6?

Edit: Just tested this. It does recognize multiplication. So we could write the expression as DMG:2 2*[QBAB] ,melee and DMG:3 3*[QBAB] ,melee

Edit again: Tested again, it is ignoring the * and treating it as a space or a plus

Kelrugem
March 17th, 2021, 13:24
So we don't have multipliers outside of other tags? So no 2*2d6?

Edit: Just tested this. It does recognize multiplication. So we could write the expression as DMG:2 2*[QBAB] ,melee and DMG:3 3*[QBAB] ,melee

Edit again: Tested again, it is ignoring the * and treating it as a space or a plus

yeah, these things are rather simple right now :) So, one needs to add code for more complex stuff :)

DCrumb
March 17th, 2021, 15:16
I saw that during testing. I'm just now looking at the coding in the 3.5 ruleset. I have to wrap my brain around the differences between lua and C++ (the last major language I coded in). And then figure out how to merge the changes I want, rather than rewrite the entire thing.

bmos
March 19th, 2021, 13:01
I saw that during testing. I'm just now looking at the coding in the 3.5 ruleset. I have to wrap my brain around the differences between lua and C++ (the last major language I coded in). And then figure out how to merge the changes I want, rather than rewrite the entire thing.Here is how to modify a single function:
https://www.fantasygrounds.com/forums/showthread.php?62377-Shared-Function-in-Ext&p=546087&viewfull=1#post546087

The main issue with this sort of modification is that lua's match syntax is fairly rudimentary, but I think you might be able to get that multiplication thing to work.

As Kelrugem says, it's whole numbers (rounded down).

Here is a thread that has some information on the functions you're interested in:
https://www.fantasygrounds.com/forums/showthread.php?66789-Proposed-improvement-to-variable-numbers-in-effects

DCrumb
March 19th, 2021, 15:35
After looking at the code more, I don't think it is necessarily in the 3.5 ruleset. It looks more into CoreRPG and the string manager functions of parsing the words of an effect. I'm just having trouble wrapping my head around how it works and probably will need to break down an effect string to see where I need to adjust it.

bmos
March 19th, 2021, 17:52
After looking at the code more, I don't think it is necessarily in the 3.5 ruleset. It looks more into CoreRPG and the string manager functions of parsing the words of an effect. I'm just having trouble wrapping my head around how it works and probably will need to break down an effect string to see where I need to adjust it.It's not. The stuff you're interested in is evalAbilityHelper and evalEffect in 3.5E's EffectsManager.
([HTQ%d]?) populates sModifier with the piece of the effect such as H, T, Q, or a multiplier.
Then later on sModifier is looked at to figure out what it means.
Theoretically you would have to look at sModifier and split it into separate letters and numbers and then handle them as you would like. You may also have to change ([HTQ%d]?) to ([HTQ]?[%d]?) if you want it to get an optional letter AND an optional number.

I had tried this at one point, but I was trying to set it up to allow decimal multipliers so it was a bit more complex so I gave up and went with HTQ.

bmos
March 20th, 2021, 00:58
If you want to make it even more succinct you can combine the multiple DMG modifiers to a single DMG entry.
Power Attack 1-H; ATK: -1 [-QBAB] ,melee; DMG: 2 [QBAB] [QBAB] ,melee;
Power Attack 2-H; ATK: -1 [-QBAB] ,melee; DMG: 3 [QBAB] [QBAB] [QBAB] ,melee;

Which may, or may not, be less confusing :)This did not work in my game tonight. I will test more sometime and get back in here.

EDIT: did not have spaces between [QBAB] entries. probably this is why.
EDIT2: looks like the spaces are important

DCrumb
March 20th, 2021, 01:35
One of the problems of using decimal notation is that when the parse words function is called from the effect function is that it includes the . as a delimiter, such that 2.5 becomes 2 and 5 (still not sure what happens to the .).

bmos
March 20th, 2021, 01:37
One of the problems of using decimal notation is that when the parse words function is called from the effect function is that it includes the . as a delimiter, such that 2.5 becomes 2 and 5 (still not sure what happens to the .).Could it be because the decimal is the "any character" wildcard, perhaps?
If this is the issue, you'd need a line that escapes any found decimals with a percent symbol.

What abilities would a decimal operator allow automation of? Isn't it all half/third/quarter?

What would be pretty incredible would be math.max and max.min access from effects. This has been talked about on the forums many times, but never implemented (that I'm aware).

DCrumb
March 20th, 2021, 02:12
If you could give me an example on where max and min would be useful, I might be able to think up a way to put it in.

bmos
March 20th, 2021, 03:12
If you could give me an example on where max and min would be useful, I might be able to think up a way to put it in.
I actually found examples of 1/5 as well. Aroden's Magic Army is +1 atk and dmg per 5 caster levels. Bullet Shield is AC: +1 deflection, ranged per 5 caster levels.

Caustic Eruption;DMGO: 6d6 acid is actually 1d6 points of damage per caster level (maximum 20d6)
something like Caustic Eruption;DMGO: [CL20]d6 acid for max of 20d6.
Blood Of The Martyr;DMGO:1d6 could be Blood Of The Martyr;DMGO:[QCL4]d6 for max of 4d6.

Dazzling Blade;SKILL:1 [TCL] competence, bluff;CMB:1 [TCL] competence;CMD:1 [TCL] competence could be [TCL5] for max of 5

Divine Favor;ATK:[TCL] luck;DMG:[TCL] luck could be [,1TCL3] for min 1 or max of 3
I'm not a big fan of the min notation I have here, so probably change that

Barkskin;AC:1 [TCL] natural could be [TCL5] for max of 5

DCrumb
March 20th, 2021, 06:48
So per 5 caster levels could add a letter F (for fifth) to our prefixes. You are actually onto something with the comma. That could be used at the end of the tag (so [QCL,4] or [TCL1,3]), since the comma isn't used as a delimiter and could be used to capture the min/max. I'm still looking into trying to figure out tag dx notation (the ending bracket is a delimiter so it splits it up into two "words" and doesn't do the tag change first and then look at the dice notation).

DCrumb
March 20th, 2021, 19:01
Finally figured it out. Had to change the matching in a few places and used the dash instead (so [QCL-4] or [TCL1-3], also able to do [CL5-15]). Here is the extension, only based on the base PFRPG with no other extensions.

bmos
March 20th, 2021, 19:14
The dash actually makes sense, too!
Nice job!!

bmos
March 20th, 2021, 19:44
The dash actually makes sense, too. Nice job!!

I cleaned it up to improve compatibility with other extensions and make it easier to keep updated when FG updates (only 2.2KB now :D)
I also noticed it would bring up a script error when you used it like [CL20-] so I fixed that also.

I wonder if this notation is clean enough to get added to the ruleset if you post saying you grant an unlimited license in perpetuity for use of this change if SmiteWorks would like to use it...

Kelrugem
March 21st, 2021, 17:51
nice :)

DCrumb
March 21st, 2021, 19:32
Well, the fifth modifier is just an extension of the others, so shouldn't need anything, but if they do then I grant Smiteworks an unlimited license in perpetuity to Smiteworks to use. Those could be logically taken out all the way to nine if needed (say X for sixth, V for seventh, E for eighth, N for ninth). If Smiteworks likes the Min/Max notation and scripting I grant an unlimited license in perpetuity to Smiteworks for use.

bmos
April 15th, 2021, 20:37
Well, the fifth modifier is just an extension of the others, so shouldn't need anything, but if they do then I grant Smiteworks an unlimited license in perpetuity to Smiteworks to use. Those could be logically taken out all the way to nine if needed (say X for sixth, V for seventh, E for eighth, N for ninth). If Smiteworks likes the Min/Max notation and scripting I grant an unlimited license in perpetuity to Smiteworks for use.Hey DCrumb, since SmiteWorks hasn't picked this up and you haven't released it as a standalone extension (had a hard time remembering what thread this was in), perhaps you won't mind Kelrugem adding this to his effects modifications in FullOverlayPackage? It seems like a great fit for the changes already included there.

Thamyor
April 15th, 2021, 21:01
I agree, or create a new thread just for the extension, I had a hard time to find as well.

Kelrugem
April 15th, 2021, 21:13
Yeah, sure :) Just need to know your code and maybe a short description what it is doing :) (preferable in the format of the wiki, then I can just copy&paste it into the cheat sheet for effects :D)

DCrumb
April 16th, 2021, 05:41
I was actually working on making it's own thread, but I was going to split out the fifth modifier from the Min/Max, as the fifth is just a logical progression from the half, third, and fourth modifiers already out there, the only choice I made was what the letter for the modifier would be. So adding in the F for fifth and then just doing the same thing as T and Q but diving by 5. Once I remove the fifth modifier, I'll make the thread.

So for the wiki it would be F {other tag} Fifth of the other tag.

I'll edit this later (the extension is on my development computer) to add the fifth modifier extension here so Kel can see the code.

Svandal
April 16th, 2021, 13:18
I was actually working on making it's own thread, but I was going to split out the fifth modifier from the Min/Max, as the fifth is just a logical progression from the half, third, and fourth modifiers already out there, the only choice I made was what the letter for the modifier would be. So adding in the F for fifth and then just doing the same thing as T and Q but diving by 5. Once I remove the fifth modifier, I'll make the thread.

So for the wiki it would be F {other tag} Fifth of the other tag.

I'll edit this later (the extension is on my development computer) to add the fifth modifier extension here so Kel can see the code.

That is nice. This would be helpfull. I also got some abilities that would need 1/6, I guess that is copy paste?
That would be great😃

DCrumb
April 16th, 2021, 15:21
Actually, it is find the lines where there are the comments where I added F, and say add X to the string decoder (in two places), then find the ability helper which actually breaks down the string and add the math to divide by 6.

dellanx
April 17th, 2021, 02:19
I was actually working on making it's own thread, but I was going to split out the fifth modifier from the Min/Max, as the fifth is just a logical progression from the half, third, and fourth modifiers already out there, the only choice I made was what the letter for the modifier would be. So adding in the F for fifth and then just doing the same thing as T and Q but diving by 5. Once I remove the fifth modifier, I'll make the thread.

So for the wiki it would be F {other tag} Fifth of the other tag.

I'll edit this later (the extension is on my development computer) to add the fifth modifier extension here so Kel can see the code.

Could one do 1/5 damage like in Shadow Conjuration? Does this only work in FGU or FGC also?

Kelrugem
April 17th, 2021, 02:38
That is nice. This would be helpfull. I also got some abilities that would need 1/6, I guess that is copy paste?
That would be great

lol, we can add that, too; does someone also need a 1/7 or so? :D

bmos
April 17th, 2021, 02:48
lol, we can add that, too; does someone also need a 1/7 or so? :DThere actually are 1/7 ability spell effects in PFRPG if I remember correctly, but I can't remember what they are...
Adding it messes up the fairly intuitive pattern of Half, Third, Quarter, Fifth, Sixth, [seventh]. The S is already taken :(

DCrumb
April 17th, 2021, 03:36
I suggested using V for Seventh and X for Sixth. That way I tried to avoided it looking like SSTR if trying to use sixth strength.

Corun
April 17th, 2021, 09:20
I suggested using V for Seventh and X for Sixth. That way I tried to avoided it looking like SSTR if trying to use sixth strength.

But V is 5, and X is 10. Why does this have to look like roman numerals.

Personal peeve aside, I feel like combining some special character with number such as
%6 or /6 or 6/
would be more clear than remembering:
H,T,Q,F,X(s),V,???

Might be bit tougher in lua to implement, and deviates from the usual format, but also is more flexible.

bmos
April 17th, 2021, 12:35
But V is 5, and X is 10. Why does this have to look like roman numerals.

Personal peeve aside, I feel like combining some special character with number such as
%6 or /6 or 6/
would be more clear than remembering:
H,T,Q,F,X(s),V,???

Might be bit tougher in lua to implement, and deviates from the usual format, but also is more flexible.The reason I used T and Q in my original expansion of the effects parsing is because H and T were already present.
Changing these would mean that existing content and player's characters would be obsolete (and since I was aiming to have that change included in FG rulesets I did not want that).

Personally I think the solution that makes the most sense in an extension would be to have both options. Extending the multiplier (currently 2-9) to support decimal numbers would be a pretty decent solution or a new division syntax as you suggest. The important thing is to have it be parallel to the letters so as not to break existing effects.

Khoredran
April 17th, 2021, 14:27
H: Half; T: Third; Q: Quarter; F: Fifth; S: Sixth; Z: Seventh

The Z looks like a 7 but with a lower bar added to emphasize it's importance ^^

I don't mind the SSTR, unless it prevents the code to recognize the STR tag?