PDA

View Full Version : Combat Modifier Calculation Extension



dogfisc
February 25th, 2021, 00:01
Removing attachment, as this is now on the Forge!

https://forge.fantasygrounds.com/shop/items/406/view

I've seen some of this listed as functionality in extensions for 5E, but not for 3.5/Pathfinder.

This extension automatically calulates common modifiers in combat.

What it does:
Adds buttons to the Modifiers window for shooting into melee and flanking.
Puts buttons on the desktop for the three levels of cover, shooting into melee, flanking, and flat-footed.

For a ranged attack:

If the range is 30' or less and the attacker has the Point Blank Shot feat, adds effect "PBS; rng30; ATK: 1 ranged, DMG: 1 ranged, DMGS: 1"
If the range is 30' or less and the attacker doesn't have the feat, adds effect "rng30" (for facilitating Sneak Attack)
Removes the above effects if range is greater than 30'
Calculates range penalty based on number of range increments
Displays a warning in Chat if beyond maximum range (this does not prevent the attack)
Calculates "shooting into melee" penalty (using the PF1e rules, not 3.5E)

For a PC the weapon range is taken right from the inventory list so if a weapon has a custom name, the Distance ability, etc., the calculations will still work. For an NPC, as long as the weapon name includes the base for the weapon it will find the correct range (so Shortbow, Masterwork Shortbow, +1 Shortbow, Flaming Shortbow of Spiked Intrusion, etc. will all use the range for "shortbow").

For a melee attack:
Determines whether or not the attacker is flanking the target; if so, adds the +2 bonus and adds effect "Flanking" to the attacker (again, for Sneak Attack)
Removes "Flanking" effect if the attacker isn't flanking

What it doesn't do:
Flanking is calculated based on allies and their size and natural reach. It does not take into account whether or not an ally has a reach weapon or if they don't have a melee weapon at all.
Flanking doesn't take occuluders into account. If a goblin is attacking and its allied ogre is 10' from the target with a wall in between, the goblin will still get the flanking bonus.

Cover. I had considered working to automate cover modifiers, but decided against it because, at least at the tables I've played on, it is never treated exactly like in the rules; many pretty much just ignore cover unless it's from a wall or other object (does a size 0 attacker, shooting past/through a size 0 creature, suffer a partial or full cover penalty, or none at all?). I didn't want this extension to force a group to play it a certain way.

My goal was to get the vast majority of situtations to work correctly, and based on my testing it does that. I'll find out for sure in a few days at my next gaming session.

Compatibility:
I use very few extensions, so I have not widely checked compatibility.
This extension replaces ActionAttack.modAttack, but it does call the original, so it should still be compatible with other extentions affecting that function (provided they modify, rather than replace, it).

One extention I would rather not live without is Kelrugem's Full Extension Overlay; this extension does not conflict with it.

Update 26-Feb:
added "Helpless" as an effect that will prevent a unit from providing a flanking bonus
removed debug spam

Update 27-Feb:
Changed effects from "pbs" to "rng30" to clarify that this is not the same as the point blank shot feat. The effects are now:
with point blank shot feat: "PBS; rng30; ATK: 1 ranged; DMG: 1 ranged; DMGS: 1"
wihtout the feat: "rng30"
Other effects using this should now read "IF: CUSTOM(rng30); ..."

Update 02-Mar:
Fixed a case where one ally attacking from behind another (as with a reach weapon) would get a flanking bonus.

Update 05-Apr:
Account for tokens on the map which are not in the combat tracker.
Ignore flanking bonus when attacking swarms.

Update 14-Apr:
Reduce range penalty to -1 per increment if the attacker has the Far Shot feat.

Update 15-Jun:
Added a version that does not perform any flanking calculation. The Flank modifier button still works.

Update 13-Oct:
Removed separate version without flanking. There is now an option under "Game (GM)" to turn on/off automatic flanking calculation (thank you @Bmos)
Added addtional modifer buttons and moved dice to the right to accomodate them (thank you @Zygmunt Molotch)

Kelrugem
February 25th, 2021, 00:07
Nice, thanks :)

DCrumb
February 25th, 2021, 02:06
Is this extension compatible with the newest version of the ruleset (Feb 1st and later)?

dogfisc
February 25th, 2021, 02:56
Is this extension compatible with the newest version of the ruleset (Feb 1st and later)?
Yes, I've just finished it, using the latest ruleset updates.

dellanx
February 25th, 2021, 03:55
Very nice, looking forward to trying this extension out.

Zygmunt Molotch
February 26th, 2021, 04:50
gotta give this a whirl!

one question:


If the range is 30' or less and the attacker doesn't have the feat, adds effect "pbs" (for facilitating Sneak Attack)

what does this mean? because that's not PBS...

dogfisc
February 26th, 2021, 15:23
gotta give this a whirl!

one question:

If the range is 30' or less and the attacker doesn't have the feat, adds effect "pbs" (for facilitating Sneak Attack)

what does this mean? because that's not PBS...

If the attack range is 30' or less, I wanted to add an effect to the attacker to indcate that. If they have Point Blank Shot, the effect includes the hit/damage bonus; if not, it's just "pbs" in case they have an ability that only works within 30' of the target, like Sneak Attack. It allows use of "IF: CUSTOM(pbs); DMG: 1d6 precision"

Asgurgolas
February 27th, 2021, 11:25
Is this extension compatible with the newest version of the ruleset (Feb 1st and later)?

also, is it/would it be compatibile with Kelrugem's and bmos extensions? :D

bmos
February 27th, 2021, 12:24
This looks very promising! Perhaps pbs on non-point-blank-shot actors should be "range30" or something? pbs seems confusing in that scenario.


also, is it/would it be compatibile with Kelrugem's and bmos extensions? :DIt looks like it should work with mine, but I haven't tested it (just glanced at code).

dogfisc
February 27th, 2021, 16:24
also, is it/would it be compatibile with Kelrugem's and bmos extensions? :D
It's compatible with Kelruem's; I've not tested with any of Bmos'.

dogfisc
February 27th, 2021, 16:25
This looks very promising! Perhaps pbs on non-point-blank-shot actors should be "range30" or something? pbs seems confusing in that scenario.
I'll change that so it's a bit more clear.

Kelrugem
February 27th, 2021, 16:50
I like the range penalties; I've never implemented them so far because I tend to code only things if they are then somewhat complete, in that case height is for example a missing feature in FG and its range. (of course not saying that your extension is incomplete :) more a problem of FG's distance calculation) But if I find time finally, then I want to enhance the height label extension to support height in the range increments :) I think, in combination with your extension, this would be very nice then :)

(and then I want to add AURA stuff etc., but for this I actually want to rework the effects' system for improving performance; so, this will take a while)

dogfisc
February 27th, 2021, 16:58
I imagine that with a height given for attacker and/or target, it should be a simple geometric calculation to get the 3d-range from the 2d-range. For the flanking and shooting into melee modifiers, it would require a check that the target and the nearby ally were at the same height.

Kelrugem
February 27th, 2021, 18:53
I imagine that with a height given for attacker and/or target, it should be a simple geometric calculation to get the 3d-range from the 2d-range. For the flanking and shooting into melee modifiers, it would require a check that the target and the nearby ally were at the same height.

Yup, the math is easy :) I just never found time to implement it :) (though I do not want to use the Euclidean measure; I will use the same diagonal measure as in the 2d plane such that all dimensions use the same rule)

Asgurgolas
February 27th, 2021, 22:45
How would this extension interact with improved uncanny dodge (can't be flanked unless sneak attack levels are over a certain treshold) and monsters such as beholders (360° vision, can't be flanked)?

dogfisc
February 27th, 2021, 23:44
How would this extension interact with improved uncanny dodge (can't be flanked unless sneak attack levels are over a certain treshold) and monsters such as beholders (360° vision, can't be flanked)?
Hmm, it wouldn't. I'll look at Improved Uncanny Dodge; it won't be hard to check for abilities like that, provided I can find them all. I'm not sure about beholders; since they're not in the bestiary, I don't know how that would be coded; is there another example like that? I'll look, but I don't know of any creatures like that offhand.

Asgurgolas
February 28th, 2021, 14:30
Pretty much any creature with the ability to avoid flanking, I'd say. Beholders just have all-around vision, so they just can't be flanked as they are able to easily cope with attack from any direction...

Swarms can't be flanked by definition

Formians with their hive mind (it states that "If one is aware of a particular danger, they all are. If one in a group is not flat-footed, none of them are. No formian in a group is considered flanked unless all of them are."

also Elementals Oozes, including Oozelike monsters such as the Phaeton Swarms; Xorns, Tojanidas and other creatures with All-Around Vision (Ex)
creatures under the effect of the Ubiquitous Vision power.

The feat "Eyes in the Back of your Head" (altough this one only negates the +2 to attacks, you still can be sneak attacked)

Wearing a Robe of Eyes

and of course, improved uncanny dodge.


These are just a few, I'm sure more would pop out if we'd actually start browsing books on books :P

dogfisc
February 28th, 2021, 20:35
That is a good start. Hopefully the NPC records are consistent in how they note those abilities. I've a feeling it will be difficult to catch all the situations. For now as a workaround I'll remove the shooting-into-melee modifier button (since it's not really useful anymore) and replace it with "no-flank" or something like that.

dellanx
March 20th, 2021, 01:12
I was looking at this ability, as I am working on my current module, and wondering if this extension could consider range increments and attack modifiers.


Hawkeye (Ex) At 2nd level, an archer gains a +1 bonus on Perception checks, and the range increment for any bow he uses increases by 5 feet. These bonuses increase by +1 and 5 additional feet for every 4 levels beyond 2nd. This ability replaces bravery.

If compatibility worked with Kelrugem's extensions that would be awesome combo as a Wishlist.

Svandal
March 20th, 2021, 11:32
I was looking at this ability, as I am working on my current module, and wondering if this extension could consider range increments and attack modifiers.



If compatibility worked with Kelrugem's extensions that would be awesome combo as a Wishlist.

I have sadly not used this extension yet since I have not updated FG yet. But from what I understand about this awsome extension I do not see the benefit of what you are proposing. Just manually adjust the range increment in the weapon box in your action tab in the character sheet?
This extension adds the penalty to range increments based on the "range" number in the weapon? (Again, as I understand it without having tried it yet)

dogfisc
March 20th, 2021, 20:32
It does handle range increments and penalties to hit. For a PC, the range is taken from the weapon's "Range" on the Actions tab; for an NPC, it looks for the weapon name in a table that holds the range increment and maximum number of increments (thrown vs projectile). So as it is now, you would need to do as Svandal suggested and manually change the Range for the weapon. The same would be true for a weapon with the "Distance" property.

I should maybe state at this point that I only have the core Pathfinder book and the bestiaries, so Hawkeye is a completely new ability to me.

dellanx
March 21st, 2021, 00:22
It does handle range increments and penalties to hit. For a PC, the range is taken from the weapon's "Range" on the Actions tab; for an NPC, it looks for the weapon name in a table that holds the range increment and maximum number of increments (thrown vs projectile). So as it is now, you would need to do as Svandal suggested and manually change the Range for the weapon. The same would be true for a weapon with the "Distance" property.

I should maybe state at this point that I only have the core Pathfinder book and the bestiaries, so Hawkeye is a completely new ability to me.

It looks like a nice extension. Unfortunately it is giving me an error, but I use a lot extensions. It does look great, and great progress.

timg
April 3rd, 2021, 18:12
I love this extension, but after the last update I am getting an odd error.
Running in CotCT in the guest wing against the Danse Macabre I am able to roll to hit fine without the map window being opened. As soon as the map window is opened, the same hit rolls are failing with "scripts/manager_action_attack_custom.lua: 426 attempt to compare number with nil" in the console. I am able 100% repro with this particular creature and only this extension loaded. In the play session I hit it in we saw it occur for this NPC and one of the PCs but not for anyone else.

From a quick dive into the extension code I am assuming that the code is somehow failing to retrieve the reach from the CT - but why this would only happen when the map window is open eludes me. I am not sure if the extension is still in active support mode, but hopefully a fix can be found. I love not having to manually add flanking and other edge cases all the time, but opening and closing the map window before attacking is kind of odd.

Let me know if I can help in tracking things down further.

dogfisc
April 4th, 2021, 15:32
Is that Curse of the Crimson Throne? I don't have that adventure, so I can't tell exactly what is happening but I haave a couple ideas.

Regarding having the map open: if the tokens aren't on a map, none of the calculations can be done because they depened on using the token placement; so if the map isn't open, it's basically just skipping all the rest of the code.

If you look at the NPC sheet for the Danse Macabre, what does it show for "Space/Reach"? If they aren't correct on the NPC sheet that may indicate that they are wrong in the CT.

I'll do some testing also and see if I can reproduce the issue.

timg
April 4th, 2021, 16:24
Is that Curse of the Crimson Throne? I don't have that adventure, so I can't tell exactly what is happening but I haave a couple ideas.

Regarding having the map open: if the tokens aren't on a map, none of the calculations can be done because they depened on using the token placement; so if the map isn't open, it's basically just skipping all the rest of the code.

If you look at the NPC sheet for the Danse Macabre, what does it show for "Space/Reach"? If they aren't correct on the NPC sheet that may indicate that they are wrong in the CT.

I'll do some testing also and see if I can reproduce the issue.

It looks OK to me
4543245433

Edit: Added some debug statements around the line in question and it is definitely the nNearReach variable coming back with nil. Interestingly nNearRange is showing 30 despite them being adjacent on the map.45435

dogfisc
April 4th, 2021, 20:27
I agree, that all looks fine.

With only those two tokens on the map, it shouldn't even be hitting the line that is giving the error. It's looking at all tokens with 30 of the target (which excludes the target) and if the token it's checking is the attacker it never makes it to the comparison with nNearReach. The fact that you are getting nNearRange of 30 makes me think there is another token on the map. Since you are comfortable with checking the code, can you put in a debug to see what CT node it is looking at? This will work:
local rNearActorCT = CombatManager.getCTFromToken(checkToken);
Debug.chat("rNearActorCT: ", rNearActorCT, DB.getValue(ActorManager.getCTNode(rNearActorCT), "name"));

Thanks!

timg
April 5th, 2021, 16:23
I agree, that all looks fine.

With only those two tokens on the map, it shouldn't even be hitting the line that is giving the error. It's looking at all tokens with 30 of the target (which excludes the target) and if the token it's checking is the attacker it never makes it to the comparison with nNearReach. The fact that you are getting nNearRange of 30 makes me think there is another token on the map. Since you are comfortable with checking the code, can you put in a debug to see what CT node it is looking at? This will work:
local rNearActorCT = CombatManager.getCTFromToken(checkToken);
Debug.chat("rNearActorCT: ", rNearActorCT, DB.getValue(ActorManager.getCTNode(rNearActorCT), "name"));

Thanks!

I do have 5 other miniatures on the map but they are all over 100' away from these two. The above code gives the following output:
s'rNearActorCT: ' | nil | nil

I am not sure what would give us nil actors in the CT, adding a check to skip nil actors shows that we just test a single nil actor and then things work fine again. If it was one of the other tokens on the map I would expect to see 5 messages, but it is a single nil token each time.

dogfisc
April 5th, 2021, 21:09
It should only be looking at tokens within 30’ of the target of the attack, so those others would be plenty far enough not to get looked at.

I’ll put in a check on the CT actor when I’m off for the day. I’d still like to know what it is finding though; it really seems like there is a token somewhere that isn’t in the CT. Maybe look at the value of checkToken?

dogfisc
April 6th, 2021, 00:23
timg, I am able to duplicate the error you are getting by adding a token to the map but not the combat tracker.

I've just uploaded a new version which checks for this case. It also handles targets of the "swarm" type.

timg
April 7th, 2021, 01:25
Awesome - thanks

Svandal
April 14th, 2021, 17:44
There is an incompatability with the "ammunition manager extension"
https://www.fantasygrounds.com/forums/showthread.php?61372-PFRPG-Ammunition-Manager&p=594066#post594066

I have the latest live version, and when I only load ammunition manager + combat modifier I get a error when I:
Target an enemy token and then double click on an attack (both melee and ranged throws error messages). I then get this error:
script execution error: [string "attacks"]:35: attemt to call field 'hasLoadAction' (a nil value)

If I attack by drag and drop method I do not get an error message.
I cross my fingers that this has an easy fix because I love both the "hit by x" amount from ammunition extension and the range penalty from combat modifier.

I also post this in the ammunition manager thread. And attached is the log file.

Svandal
April 14th, 2021, 17:51
And I have a request. Since you already have automated point blank shot (which I think is awsome), is it possible to also include far shot?

Far shot:
-1 on each range increment instead of -2

dogfisc
April 14th, 2021, 18:08
I haven’t used Ammunition Manager, but I’ll download it and see if I can track down the conflict.

Far Shot should be pretty easy to add in.

dogfisc
April 15th, 2021, 00:10
Updated to account for Far Shot feat.

Svandal
April 15th, 2021, 17:17
Confirmed, it was not a conflict issue with bmos ammunition manager, it was only a bug in ammunition manager.
I actually just yesterday updated to the latest live version (because I thought light sources update was out), and updated a bunch of extensions. With only this and ammunition manager loaded I got this error, but forgot to test only for ammunition manager since I have used that for a long time (but not the latest update :) )

Svandal
April 28th, 2021, 19:18
I run Fantasy grounds unity with the latest live version. I started a new session with only this extension loaded.

This is a really nice extension, but I have one huge issue with it.

When you roll vs monster it works fine. But if you roll in the chat and drags the attack over to the monster this bug appears (see attachment).
This also appears when I have rolled an attack vs monster, but I did something wrong. Maybe I forgot to add the flank bonus, so I put in +2 in the modifier box in the left bottom corner and drag the attack out again to the monster. Without this extension FG would then tell me if this attack was a hit or miss, but with this extension enabled I get the same error mesasge
[ERROR] Script execution error: [string "scripts/manager_action_attack_custom.lua"]:552: attempt to index local 'rSource' (a nil value)


I would be really really happy if this could be fixed. Adjusting an attack after we roll it vs monster happens several times each session for us, and it is a pain to roll it again instead of manually typing in a number and dragging the attack out from the chat.

Svandal
April 28th, 2021, 19:38
And there is a compatability issue with range calculation when I try out this extension with the "token height" extension.
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator

See screenshot. The problem is with larger monsters that takes up several spaces.

So what works. These extensions works well together in some ways. When I add height to a token the "combat modifier extension" takes into account the height and adds penalties correctly, at least for medium sized tokens.
If we get larger tokens it calculates range incorrectly, see screenshot. This does not happen if I only run this extension, only if I also run the "token height" extension. Looks like something is overwriting another?


I do not know if this is an easy fix, but you would make me happy if it can be fixed.

Edit: I have the lastest fantasy grounds unity live version installed. And have the latest "combat modifier extension", and the latest "token height extension" loaded. Those are the only two extensions loaded.

Edit2: I also posted this in the other thread since I do not know if it is a compatibility problem, or a bug with the other extension.

dogfisc
April 29th, 2021, 02:22
When you roll vs monster it works fine. But if you roll in the chat and drags the attack over to the monster this bug appears (see attachment).
This also appears when I have rolled an attack vs monster, but I did something wrong. Maybe I forgot to add the flank bonus, so I put in +2 in the modifier box in the left bottom corner and drag the attack out again to the monster. Without this extension FG would then tell me if this attack was a hit or miss, but with this extension enabled I get the same error mesasge
[ERROR] Script execution error: [string "scripts/manager_action_attack_custom.lua"]:552: attempt to index local 'rSource' (a nil value)


I would be really really happy if this could be fixed. Adjusting an attack after we roll it vs monster happens several times each session for us, and it is a pain to roll it again instead of manually typing in a number and dragging the attack out from the chat.
I’m not entirely clear about what you’re doing. When you say “roll in the chat”, are you just dragging a die into the chat window, then dragging that result to a monster in the Combat Tracker? Or you just roll an attack without a target and drag the result? I’ve never tried doing that for anything but damage and healing.

I’ll look at this as soon as I can, probably not until tomorrow afternoon.

Compatibility with the height extension will take some more effort, since I’ve never looked at it, but I will.

dogfisc
April 29th, 2021, 03:36
I found some time after all, and I think I understand what you're doing now. The problem is that when you drag the attack result from chat to the CT, there is no "attacker". I've checked for that, so you won't get the error any more, but it still won't be able to do any of the flanking or range calculations.

GKEnialb
April 29th, 2021, 04:49
Looks like you found the issue, but if you ever need to talk about the height extension, let me know - I'd be happy to help debug any incompatibilities.

Svandal
April 29th, 2021, 05:45
I found some time after all, and I think I understand what you're doing now. The problem is that when you drag the attack result from chat to the CT, there is no "attacker". I've checked for that, so you won't get the error any more, but it still won't be able to do any of the flanking or range calculations.

That sounds perfect. We just use it if we need to modify an attack after it has occured.

Svandal
April 29th, 2021, 06:14
I found some time after all, and I think I understand what you're doing now. The problem is that when you drag the attack result from chat to the CT, there is no "attacker". I've checked for that, so you won't get the error any more, but it still won't be able to do any of the flanking or range calculations.

I just tested this, and it now works for melee and CMB, but I get an error when I drag a ranged attack from chat to combat tracker. It does not find the weapon.

I will include a full error report tonight after work and after the kids are sleeping.

dogfisc
April 29th, 2021, 19:54
I’ll check the ranged attack later today. I also need to download and digest the height extension. @GKEnialb, I will likely reach out to you when I get to that part.

Svandal
April 29th, 2021, 20:32
I’ll check the ranged attack later today. I also need to download and digest the height extension. @GKEnialb, I will likely reach out to you when I get to that part.

Here is a screenshot and a full log. Fantasy grounds unity latest live version. Only this extension loaded.

Error when dragging a ranged attack from the chat to the combat tracker:
ERROR: Script execution error: [string "scripts/manager action attack custom.lua"]:635: bad argument #1 to 'lower' (string expected, got nil)

Kelrugem
April 29th, 2021, 20:42
Here is a screenshot and a full log. Fantasy grounds unity latest live version. Only this extension loaded.

Error when dragging a ranged attack from the chat to the combat tracker:
ERROR: Script execution error: [string "scripts/manager action attack custom.lua"]:635: bad argument #1 to 'lower' (string expected, got nil)

ffdsfsad, the heroe of all the heroes out there!

:D

(EDIT: I am also lazy with the names of my test chars; often just asd or sad :D)

dogfisc
April 29th, 2021, 23:42
Updated to handle the ranged attacks from chat.

dellanx
April 30th, 2021, 02:25
Having this error on using "composite longbow" on a PC.

46210

Svandal
April 30th, 2021, 14:39
Updated to handle the ranged attacks from chat.

It looks like it works now. Thank you, that will be a great help.
I see that we now get a post in the chat when doing ranged attacks saying:
s actorNode: '[databasenode = {databasenode = { charsheet.id-000002}

I am guessing that has something to do with the fix. It would be nicer if it did not show in chat, but since it works I am happy :)
I have not posted a full report on this since I think you also are seeing this in the chat, right?

dogfisc
April 30th, 2021, 16:12
Sorry, that’s some debugging I missed when I was cleaning up the code. I’ll get rid of it.

@dellanx, I’ll check that tonight.

dogfisc
May 1st, 2021, 16:31
@Svandal, I removed that debug statement.

@dellanx, from the error that was raised it looks like the "Subtype" field on the composite longbow entry for that character is blank; it should say "Martial Ranged". The extension code is using that to figure out whether the weapon can be used at 5 or 10 range increments. I've put in a check to see if it is blank, so you shouldn't get the error any more. If you do, I'll need to look at your campaign's db.xml to see what the problem is.

Zygmunt Molotch
May 2nd, 2021, 10:02
I wonder if there's room for some synergy with the NPC action upgrade extension and some tables to get the range increment penalty to work for NPCs...

dellanx
May 2nd, 2021, 13:38
@Svandal, I removed that debug statement.

@dellanx, from the error that was raised it looks like the "Subtype" field on the composite longbow entry for that character is blank; it should say "Martial Ranged". The extension code is using that to figure out whether the weapon can be used at 5 or 10 range increments. I've put in a check to see if it is blank, so you shouldn't get the error any more. If you do, I'll need to look at your campaign's db.xml to see what the problem is.

I see, that makes sense.

dellanx
May 2nd, 2021, 15:14
Tried to test extension just by itself in FGU. Not sure, but don't see the -4 adjustment firing into melee. This character does not have precise shot.

Here is the screenshot:

46281

Here is the log:

46282

Svandal
May 2nd, 2021, 20:27
And there is a compatability issue with range calculation when I try out this extension with the "token height" extension.
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator

See screenshot. The problem is with larger monsters that takes up several spaces.

So what works. These extensions works well together in some ways. When I add height to a token the "combat modifier extension" takes into account the height and adds penalties correctly, at least for medium sized tokens.
If we get larger tokens it calculates range incorrectly, see screenshot. This does not happen if I only run this extension, only if I also run the "token height" extension. Looks like something is overwriting another?


I do not know if this is an easy fix, but you would make me happy if it can be fixed.

Edit: I have the lastest fantasy grounds unity live version installed. And have the latest "combat modifier extension", and the latest "token height extension" loaded. Those are the only two extensions loaded.

Edit2: I also posted this in the other thread since I do not know if it is a compatibility problem, or a bug with the other extension.


I am pretty sure I reported this exact problem in the aura extension thread here. With some more information I hope.
https://www.fantasygrounds.com/forums/showthread.php?68035-Aura-Effects-for-Pathfinder-3-5E&p=597800&viewfull=1#post597800


And to complete the messy linking to other threads, here is some of my uninformed speculations:
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator&p=597805&viewfull=1#post597805

Zygmunt Molotch
May 17th, 2021, 12:14
46823

this extension seems to generate quite a few errors

but it maybe connected to the same thing Svandal has said in the post above

all I know is I don't get it when this extension is removed...

Svandal
May 17th, 2021, 14:21
46823

this extension seems to generate quite a few errors

but it maybe connected to the same thing Svandal has said in the post above

all I know is I don't get it when this extension is removed...

Are you sure that you are using the latest version?
It looks like debug messages from an older version.
My issues are resolved.

I would suggest to download it again, only use this extension and see if it is still there?

Zygmunt Molotch
May 17th, 2021, 14:43
Are you sure that you are using the latest version?
It looks like debug messages from an older version.
My issues are resolved.

I would suggest to download it again, only use this extension and see if it is still there?

unless there's been a later one

it's the latest 13kb one,

I will try it in isolation, I actually think it's only happened since the lighting changes... gimme a a day or so, and I'll double check :D

dellanx
May 23rd, 2021, 01:29
My player had the following error, but I was able to roll for him.

47014

Zygmunt Molotch
May 25th, 2021, 10:11
I'm not sure where this extension, is touching this script (had a cursory look, but could not see)

47066

but when flanking, this error is continually occurring, any suggestions? (this is with Kel's Fulloverlay too, and the only other extension, I can recall that touches that file I presume therefore there's a compatibility issue)

without this extension, this error does not occur

TIA

Extra:
also the maximum range for a net, is not 5 x it's increment of 10ft (as per a thrown weapon, albeit this would normally be true), it's specific on it's entry (specific overrules generic) and it's range is only 10ft cf net profile (https://www.d20pfsrd.com/equipment/weapons/weapon-descriptions/net), so if its for PF, that may want to change :-)

dellanx
May 25th, 2021, 15:19
I'm not sure where this is touching this script (had a cursory look, but could not see)

47066

but when flanking, this error is continually occurring, any suggestions? (this is with Kel's Fulloverlay too, I presuem there's a compatibility issue)

without this extension, this error does not occur

TIA

Extra:
also the maximum range for a net, is not 5 x it's increment of 10ft (as per a thrown weapon, albeit this would normally be true), it's specific on it's entry (specific overrules generic) and it's range is only 10ft cf net profile (https://www.d20pfsrd.com/equipment/weapons/weapon-descriptions/net), so if its for PF, that may want to change :-)

That was the same error that my player had.

bmos
May 26th, 2021, 23:25
My player had the following error, but I was able to roll for him.

47014

That error is from the Token Height extension. I think you might not have the latest version. Are you also using the Aura extension or not?


I'm not sure where this extension, is touching this script (had a cursory look, but could not see)

47066

but when flanking, this error is continually occurring, any suggestions? (this is with Kel's Fulloverlay too, and the only other extension, I can recall that touches that file I presume therefore there's a compatibility issue)

without this extension, this error does not occur

TIA

Extra:
also the maximum range for a net, is not 5 x it's increment of 10ft (as per a thrown weapon, albeit this would normally be true), it's specific on it's entry (specific overrules generic) and it's range is only 10ft cf net profile (https://www.d20pfsrd.com/equipment/weapons/weapon-descriptions/net), so if its for PF, that may want to change :-)

Try turning off the aura extension if you're using that.

If that fixes it, try this beta version (https://github.com/bmos/FG-Aura-Effect/releases/tag/v1.1-beta.3) and if not that then the new v4.1 of token height (but try just my update first because the token height update might not be needed).

Zygmunt Molotch
May 27th, 2021, 04:14
That error is from the Token Height extension. I think you might not have the latest version. Are you also using the Aura extension or not?



Try turning off the aura extension if you're using that.

If that fixes it, try this beta version (https://github.com/bmos/FG-Aura-Effect/releases/tag/v1.1-beta.3) and if not that then the new v4.1 of token height (but try just my update first because the token height update might not be needed).

Will do,

~report shortly~ That beta version of Aura seems to have prevented the error so far... :square: ;)

bmos
June 2nd, 2021, 17:40
This extension has an incompatibility with Token Height Indicator as this extension uses getDistanceBetween in an undocumented way (it gives x/y coordinates rather than a token).
I have posted a fix which will hopefully be used in the next build of Token Height Indicator.

dogfisc
June 2nd, 2021, 23:15
This extension has an incompatibility with Token Height Indicator as this extension uses getDistanceBetween in an undocumented way (it gives x/y coordinates rather than a token).
I have posted a fix which will hopefully be used in the next build of Token Height Indicator.
I'd thought that getDistanceBetween with x/y was a documented use (for imagecontrol, not token). If that's causing a problem with Token Height though, I may be able to use the token instead. I'll have to experiment with some token placement because for determining flanking involving a unit larger than medium size, each square occupied by the token needs to be analyzed. It may be that I was tyring to avoid an edge case that isn't in fact possible.

GKEnialb
June 3rd, 2021, 02:20
I've updated Token Height per bmos's proposed changes, so we should be all set.

bmos
June 3rd, 2021, 18:00
I'd thought that getDistanceBetween with x/y was a documented use (for imagecontrol, not token). If that's causing a problem with Token Height though, I may be able to use the token instead. I'll have to experiment with some token placement because for determining flanking involving a unit larger than medium size, each square occupied by the token needs to be analyzed. It may be that I was tyring to avoid an edge case that isn't in fact possible.Oh, interesting! You're right. Different documentation in different places.

Zygmunt Molotch
June 10th, 2021, 06:35
the fix that was applied to Token Height, has not solved the error with CombatModifierExtension, seems there's still incompatibility (or perhaps it's more specifically these attack rolls don't gel with CombatModifierExtension :D )

image47453

specifically the line


if nThrReach >= nThrRange then

(the line number may be off by one or two, because I added some comments on my local copy)

but for some reason those two numbers are not comparable

hit me up for more info, or things to try :)

-- NOTE

I have since replaced with a new campaign, and all is well (I have no idea what artefact was causing it)

bmos
June 10th, 2021, 14:41
the fix that was applied to Token Height, has not solved the error with CombatModifierExtension, seems there's still incompatibilityIt is working in my testing with latest builds of both extensions and no other extensions.
Perhaps you could give more information about what you are doing when you get that error?

Zygmunt Molotch
June 11th, 2021, 02:27
scratch all that

I posted the error and the logs, but it's not necessary

To test my sanity: I started a new campaign, imported everything, added to same map locations with the same heights, same locations same effects, same CT set up


and

it worked

FFS

thanks :D

I'll just chalk it up to something got funky in that campaign

dellanx
June 11th, 2021, 03:22
I've updated Token Height per bmos's proposed changes, so we should be all set.

Where may I find the new Token Height extension? Can't seem to find the post. Thanks!

Zygmunt Molotch
June 11th, 2021, 03:49
Where may I find the new Token Height extension? Can't seem to find the post. Thanks!

linky link... https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator

dellanx
June 12th, 2021, 06:23
linky link... https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator

Thank you!

Svandal
June 15th, 2021, 20:00
Can we have an option of disabling the automatic flanking effect?
It causes more trouble than it is worth in my opinion. The flanking button is more than enough.

dogfisc
June 16th, 2021, 01:26
Can we have an option of disabling the automatic flanking effect?
It causes more trouble than it is worth in my opinion. The flanking button is more than enough.
I'm not sure yet how to interact with the options panel. In the meantime, I just uploaded a version that doesn't do any flanking calculation, but still recognizes the "Flank" modifier button. Not as good as a switchable option, but should help for now.

bmos
June 16th, 2021, 01:44
I'm not sure yet how to interact with the options panel. In the meantime, I just uploaded a version that doesn't do any flanking calculation, but still recognizes the "Flank" modifier button. Not as good as a switchable option, but should help for now.Add this to onInit of a named script:

OptionsManager.registerOption2('AUTO_FLANK', false, 'option_header_game', 'opt_lab_autoflank', 'option_entry_cycler',
{ labels = 'option_val_off', values = 'off', baselabel = 'option_val_on', baseval = 'on', default = 'on' })
Then you can use

if OptionsManager.isOption('AUTO_FLANK', 'on') then
to see if it is still enabled.

You can give the option a title by adding a string within <root><base> of extension.xml:

<string name="opt_lab_autoflank">Automatic Flanking</string>

Zygmunt Molotch
June 16th, 2021, 03:10
turning flanking as an option off, would be most welcome

it's frequently wrong for our combats :D

but the range stuff is fantastic!

dogfisc
June 16th, 2021, 16:46
Thanks @bmos! I’ll work on it when I get some time.

kevininrussia
June 25th, 2021, 19:08
Would it be possible to get a version of only flanking? I am attempting to hack a 4E version but running into a lot of errors. :-)

Zygmunt Molotch
July 18th, 2021, 16:49
Hey, Dogfisc

Bmos solved an error I got last night playing pf1e

A Spider, Giant Tarantula, which has a blank feat field

created the error 482584825848258

in
manager_action_attack_custom.lua

the function
npcHasFeat needs to accept blank strings, like so


function npcHasFeat(ctNode, sFeat)

local sLowerFeat = StringManager.trim(string.lower(sFeat or ""));
local sFeatList = DB.getValue(ctNode, "feats", "");
local sLowerFeatList = StringManager.trim(string.lower(sFeatList));
return string.match(sLowerFeatList, sLowerFeat);

end


this is Bmos's fix, I'm always bugging him for debugging

as you can see, the Official Creature is also coded wrong, but thats for the Official Bug report thread :D

Svandal
July 19th, 2021, 21:23
And here is a bug report. Compatability error with token height extension:
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator

It has to be something in one of the last patches of token height, it worked correctly before:

See attached files, here is an explanation:
Fantasy grounds unity latest live version. Only this and token height extension.

When I try to attack with my NPC cyclops with a heavy crossbow (or other NPCs with ranged weapons) I can do it if I target something in the combat tracker (drag the attack to the combat tracker)
But If I drag the attack onto a token on the map (both tokens are in the combat tracker) I get this error:
Handler error: [string "scripts/manager_combat.lua"]:325: attempt to index local 'token' (a number value)

If I try to attack with a PC (in this case a PC with compsite longbow) I get this error if I drag the ranged attack from the PC sheet action tab directly to the combat tracker, or if I drag the attack onto a token on the map:
Script execution error: [string "scripts/manager_combat.lua"]:325: attempt to index local 'token' (a number value)

Svandal
July 22nd, 2021, 21:32
And here is a bug report. Compatability error with token height extension:
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator

It has to be something in one of the last patches of token height, it worked correctly before:

See attached files, here is an explanation:
Fantasy grounds unity latest live version. Only this and token height extension.

When I try to attack with my NPC cyclops with a heavy crossbow (or other NPCs with ranged weapons) I can do it if I target something in the combat tracker (drag the attack to the combat tracker)
But If I drag the attack onto a token on the map (both tokens are in the combat tracker) I get this error:
Handler error: [string "scripts/manager_combat.lua"]:325: attempt to index local 'token' (a number value)

If I try to attack with a PC (in this case a PC with compsite longbow) I get this error if I drag the ranged attack from the PC sheet action tab directly to the combat tracker, or if I drag the attack onto a token on the map:
Script execution error: [string "scripts/manager_combat.lua"]:325: attempt to index local 'token' (a number value)

This is now fixed. Was fixed in the token height extension.

bmos
August 20th, 2021, 13:39
Flatfooted button on desktop is cut-off/obscured.
Bounds of ATT_FF in desktop_classes.xml should be 180,36,40,20 so that it matches the others

Svandal
August 27th, 2021, 20:18
And here is a bug report. Compatability error with token height extension:
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator

It has to be something in one of the last patches of token height, it worked correctly before:

See attached files, here is an explanation:
Fantasy grounds unity latest live version. Only this and token height extension.

When I try to attack with my NPC cyclops with a heavy crossbow (or other NPCs with ranged weapons) I can do it if I target something in the combat tracker (drag the attack to the combat tracker)
But If I drag the attack onto a token on the map (both tokens are in the combat tracker) I get this error:
Handler error: [string "scripts/manager_combat.lua"]:325: attempt to index local 'token' (a number value)

If I try to attack with a PC (in this case a PC with compsite longbow) I get this error if I drag the ranged attack from the PC sheet action tab directly to the combat tracker, or if I drag the attack onto a token on the map:
Script execution error: [string "scripts/manager_combat.lua"]:325: attempt to index local 'token' (a number value)

Bug report, compatability issue with this extension and "token height"
Fantasy grounds unity, latest live version. Extensions loaded:
EXTENSION: Token Height Indication v4.9 by GKEnialb
EXTENSION: Combat Modifier Calculation: Automatically calculate modifiers for flanking, range, and shooting into melee

When I try to attack with a ranged weapon targeting a token I get this error message:
Error message:
Handler error: [string "campaign/scripts/image.lua"]:147: attempt to index local 'targetToken' (a nil value)
I added a bunch of debug.chat commands in the "combat modifier calculation" to see when the error happens. The error happens when the extension calls this function (in the "manager_action_attack_custom.lue" file):
local adjTokens = srcImage.getTokensWithinDistance({x=tgtCoord.x, y=(tgtCoord.y * -1)}, 5);

To be specific since we have talked about this before:
1:
Open PC sheet
PC is in combat tracker and on map
enemy is in combat tracker and on map
drag ranged attack from PC sheet and drop it on the enemy token on the map (this mean I attack him with a ranged weapon)
Error message

2:
Do the same as 1 but attack with a melee weapon
Everything works fine

3:
Check that enemy token and PC token is in combat tracker and on map
In combat tracker, open the attack tab for the enemy
from the combat tracker find a ranged attack from the enemy and attack
Error message


Error does NOT happen when I only have this extension loaded, only when I have this and token height (and maybe others)
The error does NOT happen when I have "token height" and a bunch of other extensions loaded and not this one.

I have added a post here in the token height extension also.
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator&p=617635&viewfull=1#post617635

bmos
August 27th, 2021, 20:31
Bug report, compatability issue with this extension and "token height"...
TokenHeight replaces srcImage.getTokensWithinDistance and that version seems not to like the arguements "{x=tgtCoord.x, y=(tgtCoord.y * -1)}, 5"

EDIT: I assume just passing "srcToken, 5" doesn't work?

bmos
August 28th, 2021, 23:09
Just used this for the first time in-game and it is SO cool.
I love the shooting into melee automation.

EDIT: one suggestion: the feat Point-Blank Shot has a hyphen in it, but your search does not.
I think it should look for either version.


EDIT2: It would be very cool if you had a GitHub or GitLab repo for this extension. It would let others contribute their labor to help improve it without relying so much on your time.

GKEnialb
August 31st, 2021, 03:06
TokenHeight replaces srcImage.getTokensWithinDistance and that version seems not to like the arguements "{x=tgtCoord.x, y=(tgtCoord.y * -1)}, 5"

EDIT: I assume just passing "srcToken, 5" doesn't work?

I don't actually think that's the issue. I'm looping over CombatManager.getCombatantNodes(), pulling the combat tracker version of each with CombatManager.getTokenFromCT and it's not finding one of them.

bmos
August 31st, 2021, 11:41
Ah, then probably this: https://www.fantasygrounds.com/forums/showthread.php?70324-4-1-5-image-onDrop-x-y-to-Token-addToken-x-y-draw-location-miss-match

Zygmunt Molotch
October 10th, 2021, 10:11
::correction::

if I turn off Token Height, I can get this extension to work as intended

Zygmunt Molotch
October 11th, 2021, 06:55
Bug report, compatability issue with this extension and "token height"
Fantasy grounds unity, latest live version. Extensions loaded:
EXTENSION: Token Height Indication v4.9 by GKEnialb
EXTENSION: Combat Modifier Calculation: Automatically calculate modifiers for flanking, range, and shooting into melee

When I try to attack with a ranged weapon targeting a token I get this error message:
Error message:
Handler error: [string "campaign/scripts/image.lua"]:147: attempt to index local 'targetToken' (a nil value)
I added a bunch of debug.chat commands in the "combat modifier calculation" to see when the error happens. The error happens when the extension calls this function (in the "manager_action_attack_custom.lue" file):
local adjTokens = srcImage.getTokensWithinDistance({x=tgtCoord.x, y=(tgtCoord.y * -1)}, 5);

To be specific since we have talked about this before:
1:
Open PC sheet
PC is in combat tracker and on map
enemy is in combat tracker and on map
drag ranged attack from PC sheet and drop it on the enemy token on the map (this mean I attack him with a ranged weapon)
Error message

2:
Do the same as 1 but attack with a melee weapon
Everything works fine

3:
Check that enemy token and PC token is in combat tracker and on map
In combat tracker, open the attack tab for the enemy
from the combat tracker find a ranged attack from the enemy and attack
Error message


Error does NOT happen when I only have this extension loaded, only when I have this and token height (and maybe others)
The error does NOT happen when I have "token height" and a bunch of other extensions loaded and not this one.

I have added a post here in the token height extension also.
https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator&p=617635&viewfull=1#post617635

also getting this error too!

ranged just isn't playing nice with this and the Token Height ext

dogfisc
October 13th, 2021, 05:17
Sorry I haven't looked at this in too long. I'm getting back from life in general and starting to work on it again.

@Bmos, I took your suggestion and created a GitHub repository for this at https://github.com/Dogfisc/combat-modifier-calc

Zygmunt Molotch
October 13th, 2021, 12:46
suggestion: rather than maintaining 2 of the roughly same ext, have flanking calculation as a toggle in options

sometimes I do use the flanking-calculation, but i have run into issues, things are adjacent does not automatically mean they grant flanking to an opposite partner

ie: an archer does not provide flanking for his allies as he does not threaten, same for creatures with 0 reach, etc

perhaps another option/button for removing it, if we know it will fire the calculation?

if range and range increment could be interpreted from the range field on the actions bar, or a weapon entry, rather than a static table , then things that extend range of certain weapons, like Hawkeye, could be handled correctly

bmos
October 13th, 2021, 13:05
suggestion: rather than maintaining 2 of the roughly same ext, have flanking calculation as a toggle in optionsas a reminder:

Add this to onInit of a named script:

OptionsManager.registerOption2('AUTO_FLANK', false, 'option_header_game', 'opt_lab_autoflank', 'option_entry_cycler',
{ labels = 'option_val_off', values = 'off', baselabel = 'option_val_on', baseval = 'on', default = 'on' })
Then you can use

if OptionsManager.isOption('AUTO_FLANK', 'on') then
to see if it is still enabled.

You can give the option a title by adding a string within <root><base> of extension.xml:

<string name="opt_lab_autoflank">Automatic Flanking</string>

I just made a pull request to make it really simple to add :)
Tested and working.

dogfisc
October 13th, 2021, 18:43
Thanks @Bmos and @Zygmunt Molotch.
I've just updated the extension in the first post:
Removed separate version without flanking. There is now an option under "Game (GM)" to turn on/off automatic flanking calculation (thank you @Bmos)
Added addtional modifer buttons and moved dice to the right to accomodate them (thank you @Zygmunt Molotch)

Now to figure out these GitHub and Forge things ;)

bmos
October 13th, 2021, 19:09
Thanks @Bmos and @Zygmunt Molotch.
I've just updated the extension in the first post:
Removed separate version without flanking. There is now an option under "Game (GM)" to turn on/off automatic flanking calculation (thank you @Bmos)
Added addtional modifer buttons and moved dice to the right to accomodate them (thank you @Zygmunt Molotch)

Now to figure out these GitHub and Forge things ;)There is likely to be a script error present in that version. I did not have a script-level variable initialized before onInit where I was trying to fill the variable.
It's included in my last pull request of the day :)

Also, didn't say it earlier but welcome back!
Can't wait to see what else you do with this extension.

bmos
October 13th, 2021, 20:21
if range and range increment could be interpreted from the range field on the actions bar, or a weapon entry, rather than a static table , then things that extend range of certain weapons, like Hawkeye, could be handled correctlyThey are (https://github.com/bmos/combat-modifier-calc/blob/e3155b8a0072d4c5203c56b30bac27f4dcb8672a/scripts/manager_action_attack_custom.lua#L114), but not for NPCs (since there is no range field).
This is also right above where you could add an eleseif for the Net max increment change you mentioned (https://github.com/bmos/combat-modifier-calc/blob/e3155b8a0072d4c5203c56b30bac27f4dcb8672a/scripts/manager_action_attack_custom.lua#L118).

kevininrussia
October 13th, 2021, 20:48
Thanks @Bmos and @Zygmunt Molotch.
I've just updated the extension in the first post:
Removed separate version without flanking. There is now an option under "Game (GM)" to turn on/off automatic flanking calculation (thank you @Bmos)
Added addtional modifer buttons and moved dice to the right to accomodate them (thank you @Zygmunt Molotch)

Now to figure out these GitHub and Forge things ;)

If there was a version with only flanking, it could be used with other rulesets I would imagine (which would make me happy) :-)

dogfisc
October 14th, 2021, 01:10
If there was a version with only flanking, it could be used with other rulesets I would imagine (which would make me happy) :-)

I saw a version for 5e on DMSGuild a while back, but I don't know of any others. I'm also not sure how different the rules might be from PF1e to another ruleset.

kevininrussia
October 14th, 2021, 02:07
I saw a version for 5e on DMSGuild a while back, but I don't know of any others. I'm also not sure how different the rules might be from PF1e to another ruleset.

I modified that extension by Kent to work with 4E. It's old but works most of the time (but sometimes doesn't). Flanking is big in 4E so its a useful extension.

Evion
November 5th, 2021, 14:50
is there a way to do melee30, like rng30, a lot of fog spells have something like this. the way i would code it hehehe like this | IFT: CUSTOM(melee5);CONC; or IFT: CUSTOM(melee20);TCONC; the first one would over ride the second

bmos
November 5th, 2021, 18:13
is there a way to do melee30, like rng30, a lot of fog spells have something like this. the way i would code it hehehe like this | IFT: CUSTOM(melee5);CONC; or IFT: CUSTOM(melee20);TCONC; the first one would over ride the second

Try the Aura extension.

Svandal
January 4th, 2022, 22:18
Is this extension still maintained?
The modifier buttons are messed up now, no text for several of them, and error when using some of them.
Both for the modifier buttons in the bottom left of the screen, and the modifier buttons in the "modifier" window (the "+/-" symbol)

And it still does not work with "Token Height indication v4.11" extension.
(The "attempt to index local 'targetToken' (a nil value) ) error.

Like I have said before I really like this extension but sadly we can not use it because of the incompatability with the token height.

dogfisc
January 6th, 2022, 15:34
Yes, I have a fix for the buttons that I’m putting up on the Forge.

dogfisc
January 7th, 2022, 05:43
This is now live on the Forge.

https://forge.fantasygrounds.com/shop/items/406/view

SoxMax
January 7th, 2022, 15:28
Awesome, the Forge makes it so much easier to get updates in the future!

Svandal
January 10th, 2022, 17:08
Yes, I have a fix for the buttons that I’m putting up on the Forge.

Nice.
And the issue with this extension and token height was only a bug in my existing campaigns. For new campaign these work together. Finally I can use this extension, it is really great 😃

dogfisc
January 10th, 2022, 18:38
Nice.
And the issue with this extension and token height was only a bug in my existing campaigns. For new campaign these work together. Finally I can use this extension, it is really great ��
That’s great to hear!

Jip
January 16th, 2022, 06:38
I'm sure I'm missing something really obvious, but I can't find an answer in this thread or on the Forge.

What is the purpose of this +/- dice that appears when I load this EXT? I've got no idea...

51021

Moon Wizard
January 16th, 2022, 08:10
It's called a Fudge die; and used for games that use -/blank/+ die (i.e. -1/0/+1 value).

It's displayed with CoreRPG ruleset; but typically disabled for rulesets that don't use it. Not sure why it would be re-enabled with an extension.

Regards,
JPG

Jip
January 16th, 2022, 17:33
@ Moon Wizard

Thanks. I think I ran into Fudge Dice long ago in a Fate game a friend ran... not sure. But certainly wasn't expecting it in my PF1e game. No biggie though - we'll ignore it for now and might even find a use for it someday.

dogfisc
January 16th, 2022, 21:17
I use it occasionally find them useful, not often though. Last time was for a storm that blew in random gusts, so at any given time it may be easier or more difficult to see/shoot/etc.

Arnagus
February 13th, 2022, 15:40
Hey @Svandal, I would like to use this Extension on my existing campaign as well. Unfortunately, I already have the "Token Height" from GKEnialb, and have the [string "campaign/scripts/image.lua"]:155: attempt to index local 'targetToken' (a nil value) error. How did you fix this? Did you remove/update something in the db.xml?

Svandal
February 13th, 2022, 17:13
Hey @Svandal, I would like to use this Extension on my existing campaign as well. Unfortunately, I already have the "Token Height" from GKEnialb, and have the [string "campaign/scripts/image.lua"]:155: attempt to index local 'targetToken' (a nil value) error. How did you fix this? Did you remove/update something in the db.xml?

I am still troubleshooting.
Creating a new campaign works, but the bug has reappeared in the new campaign. When it appears it is always a problem, and the only fix is creating a new campaign.
I have tried to recreate the problem in the new new campaign, but I have not managed to find what the trigger is.

So the fix is creating a new campaign and hope it does not reappear.
Might also be an idea to post your whole campaign with the bug. I plan to do this if I manage to find the trigger, but I have not had the time or luck to do it yet.

Arnagus
February 13th, 2022, 17:30
I was digging into it in parallel. I traced it to a token which is on another map (due to being "up the stairs") while the combat is occurring downstairs. As all tokens from the Combat Tracker are evaluated, this causes an error (Token Height: getTokensWithinDistance function is calling getPosition, causing the error). Either the Combat Modifier Calculation should check if the tokens are on the same map before calling the getTokenWithinDistance (used for "adjTokens = srcImage.getTokensWithinDistance({x=tgtCoord.x, y=(tgtCoord.y * -1)}, 5);" within the checkShootMelee fuction, already pointed out by you (Svandal) here: https://www.fantasygrounds.com/forums/showthread.php?66441-Combat-Modifier-Calculation-Extension&p=617619#post617619), or the Token Height needs to fail more gently (e.g. something like "if targetToken and targetToken ~= sourceToken then" on line 146).

*** Edited ***
Actually, this is exactly the fix (line 146 in Token Height.ext\campaign\scripts\image.lua):
ORIG: if targetToken ~= sourceToken then
BUGFIX: if targetToken and targetToken ~= sourceToken then

I have cross-posted there: https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator&p=640152#post640152

GKEnialb
February 13th, 2022, 19:56
Okay, new version live on the Forge with the suggestion from Arganus.

Arnagus
February 14th, 2022, 12:46
@GKEnialb - many thanks, works for me now in both cases: Token (while on CT) on a different map, or on no map.
@Svandal - can you please check your campaigns?

CMC calculation seems to be correct, as far as I can tell, so this should solve the issue (at least for my case):

[ATTACK (R)] Dagger [CRIT 19][RANGE -6] for 40'
[ATTACK (R)] Dagger [CRIT 19][EFFECT +1][RANGE -4] for 30' - this includes the automatically added PBS & rng30
[ATTACK (R)] Dagger [CRIT 19][EFFECT +1][RANGE -4][SHOOT MELEE -4] for 30' - with adjacent token to target (and PBS)
[ATTACK (R)] Dagger [CRIT 19][EFFECT +1][RANGE -4][SHOOT MELEE -4] for 30' - with two adjacent tokens to target (and PBS)
-> [DAMAGE (R)] Dagger [EFFECTS +1][TYPE: piercing,slashing (1d4+1=3)] - no sneak attack as target is only flanked (by the two adjacent tokens) but not by the rogue
[ATTACK (R)] Dagger [CRIT 19][EFFECT +1][RANGE -4][SHOOT MELEE -4] for 30' - with adjacent token to flat-footed target (and PBS)
-> [DAMAGE (R)] Dagger [EFFECTS 5d6+1][TYPE: piercing,slashing (1d4+1=4)][TYPE: piercing,slashing,precision (5d6=27)] - sneak attack ("nodex" from Kelrugem's "Extended automation and overlays" extension)
[ATTACK (M)] Dagger [CRIT 19][FLANK +2] meele - directly adjacent with a second token flanking
-> [DAMAGE (M)] Dagger [EFFECTS 5d6][TYPE: piercing,slashing (1d4=4)][TYPE: piercing,slashing,precision (5d6=23)] - sneak attack

Hint: I add the "Sneak Attack" effects (names are just cosmetic) using bmos "Advanced Effects" to the rogue:
Sneak Attack; NIFT: nodex; DMG: 5d6 precision, accuracy
Sneak Attack; IFT: nodex; DMG: 5d6 meele, precision
Sneak Attack; IFT: nodex; IF: CUSTOM(rng30); DMG: 5d6 ranged, precision
Sneak Attack; IF: CUSTOM(Flanking); DMG: 5d6 meele, precision

I deliberately left out things like "Sneak Attack; IF: Invisible; NIFT: CUSTOM(trueseeing); DMG: 5d6 meele,precision" similar to what has been proposed here https://www.fantasygrounds.com/forums/showthread.php?66603-Rogue-effects-especially-flat-footed-and-combat-advantage&p=583503#post583503 and rather use the <CTRL>+Attack Roll = "accuracy" mode for sneak attacks on the "border" cases.

wakhere
February 14th, 2022, 13:25
Hi i love this extension...but.i find that it clashes with traps...
i get a script error page when attacking with a trap...

bmos
February 14th, 2022, 14:04
Hi i love this extension...but.i find that it clashes with traps...
i get a script error page when attacking with a trap...You should post what the script error is ;)

Arnagus
February 14th, 2022, 19:46
@wakhere - indeed, please
a) only load the two clashing extensions
b) properly name the clashing extensions in question (with URL to Forge or Forum thread)
c) provide the full error message from the FGU\console.log, preferable with any debug enabled

Svandal
February 14th, 2022, 20:12
@GKEnialb - many thanks, works for me now in both cases: Token (while on CT) on a different map, or on no map.
@Svandal - can you please check your campaigns?



I can confirm that I do not see the bug anymore. Great work Arnagus, and thank you for the fast update GKEnialb.

GKEnialb
February 15th, 2022, 01:02
No worries - easy when Arnagus pointed out the fix. :)

wakhere
February 16th, 2022, 20:05
point taken sorry. created new campain with only this extension. Combat modifier extension v1.6

error in the log window is.
51519

wakhere
February 16th, 2022, 20:14
this is the screen i launched the attack from... i note there is an error in the chat window missing atk....
51520

dogfisc
February 17th, 2022, 02:24
point taken sorry. created new campain with only this extension. Combat modifier extension v1.6

error in the log window is.
51519
That helps a lot. I’ll take a look.

dogfisc
February 17th, 2022, 15:46
@wakhere, I've reproduced the error you posted and have a fix for it. I should be able to get it up on the Forge by this afternoon.

The message "Weapon atk not found" is just informational. When an NPC makes a ranged attack, there isn't any range increment data with it, so it looks up the weapon name in a table. "atk" isn't in the table, so it can't calculate range modifier and puts out that message (this isn't a problem with PCs since the weapon range is on the PC sheet).

dogfisc
February 17th, 2022, 20:36
Update is live on the Forge.

Fixed: NPC with no feats making a ranged attack caused error.

Svandal
March 27th, 2022, 17:12
I have added several weapons and fixed some typos in the "data_common_custom.lua"

I fixed bolas, shortbow and repeating crossbow in the original code (typos and wrong range on shortbow)
And I have added every firearm from here: (I have max 1 range increment for early firearms and 5 for modern just to remind people that it is outside touch attack. Maximum range increments is 5 for early and 10 for modern.)
https://www.d20pfsrd.com/equipment/weapons/firearms/

And I have added almost all the weapons that where missing from this list (I did not add some weapons which I did not exactly know
https://www.d20pfsrd.com/equipment/weapons/

And I did try to test out the change, but when I overwrite the extension and load up a existing campaign the extension file overwrites itself with the original rules it looks like (because of forge of cache?). I did not test this, but I did follow your format. So if I have not made a "," error this should work I think.

Here is everything inside "weaponranges" function: (copy paste should hopefully work)


["blowgun"] = {20, 10},
["bola"] = {10, 5},
["club"] = {10, 5},
["composite longbow"] = {110, 10},
["composite shortbow"] = {70, 10},
["dagger"] = {10, 5},
["dart"] = {20, 5},
["halfling sling staff"] = {80, 10},
["hand crossbow"] = {30, 10},
["heavy crossbow"] = {120, 10},
["javelin"] = {30, 5},
["light crossbow"] = {80, 10},
["light hammer"] = {20, 5},
["longbow"] = {100, 10},
["net"] = {10, 1},
["repeating heavy crossbow"] = {120, 10},
["repeating light crossbow"] = {80, 10},
["shortbow"] = {60, 10},
["shortspear"] = {20, 5},
["shuriken"] = {10, 5},
["sling"] = {50, 10},
["spear"] = {20, 5},
["starknife"] = {20, 5},
["throwinig axe"] = {10, 5},
["trident"] = {10, 5},

["brass knife"] = {10, 5},
["kunai"] = {10, 5},
["wooden stake"] = {10, 5},
["spring blade"] = {10, 5},
["stingchuck"] = {10, 5},
["dueling dagger"] = {10, 5},
["switchblade knife"] = {10, 5},
["syringe spear"] = {20, 5},
["ammentum"] = {50, 5},
["chakram"] = {30, 5},
["jolting dart"] = {20, 5},
["hunga munga"] = {15, 5},
["hurlbat"] = {10, 5},
["pilum"] = {20, 5},
["throwing arrow cord"] = {60, 10},
["aklys"] = {20, 5},
["flying talon"] = {10, 5},
["stonebow"] = {50, 10},
["deer horn knife"] = {20, 5},
["dwarven maulaxe"] = {10, 5},
["knobkerrie"] = {20, 5},
["dwarven ram hammer"] = {10, 5},
["chain-hammer"] = {20, 5},
["harpoon"] = {10, 5},
["totem spear"] = {10, 5},
["dwarven sphinx hammer"] = {20, 5},
["brutal bola"] = {10, 5},
["boomerang"] = {30, 5},
["thorn bow"] = {40, 10},
["flask thrower"] = {20, 10},
["grappling hook"] = {10, 5},
["orc hornbow"] = {80, 10},
["stormshaft javalin"] = {30, 5},
["snag net"] = {10, 1},
["throwing shield"] = {20, 5},
["shrillshaft javalin"] = {30, 5},
["double sling"] = {50, 10},
["glove sling"] = {50, 10},
["wrist launcher"] = {20, 10},
["heavy wrist launcher"] = {30, 10},

--Firearms are in this section. I have max touch attack as the max range increment instead of the actual max range increment, which is 5 range increments for early firearms and 10 for modern.
--Early firearms
["breech-loader"] = {20, 1},
["buckler gun"] = {10, 1},
["pepperbox"] = {20, 1},
["pistol"] = {20, 1},
["coat pistol"] = {10, 1},
["dagger pistol"] = {10, 1},
["double-barreled pistol"] = {20, 1},
["dragon pistol"] = {20, 1},
["dragoon pistol"] = {30, 1},
["paddle-foot pistol"] = {20, 1},
["sword cane pistol"] = {10, 1},
["air repeater"] = {50, 1},
["blunderbuss"] = {10, 1},
["culverin"] = {30, 1},
["cylinder rifle"] = {40, 1},
["double hackbut"] = {50, 1},
["fire lance"] = {10, 1},
["musket"] = {40, 1},
["axe musket"] = {30, 1},
["double-barreled musket"] = {40, 1},
["dragoon musket"] = {60, 1},
["warhammer musket"] = {30, 1},
-- Modern firearms are in this section
["revolver"] = {20, 5},
["rifle"] = {80, 5},
["pepperbox rifle"] = {80, 5},
["shotgun"] = {20, 5},
["double-barreled shotgun"] = {20, 5}

Arnagus
May 8th, 2022, 13:20
In our last session, we had a lot of fights with ranged weapons and party members in-between the opponents, and I noticed that no flanking or point-blank modifiers were applied. I created a test campaign with only CMC enabled, and it looks like no modifiers were generated at all (but no errors appear either).

I have enabled all your debugging and took some screenshots (both: shooting into melee and flanking attack) and the testTokenEdgeSquares debug function finally gives some errors (manager_action_attack_custom.lua:493 : attempt to index local 'tgtToken' (a nil value)) - I guess a ruleset coding change disabled the CMC functionality.

52698

52699

52700

Svandal
May 9th, 2022, 10:36
In our last session, we had a lot of fights with ranged weapons and party members in-between the opponents, and I noticed that no flanking or point-blank modifiers were applied. I created a test campaign with only CMC enabled, and it looks like no modifiers were generated at all (but no errors appear either).

I have enabled all your debugging and took some screenshots (both: shooting into melee and flanking attack) and the testTokenEdgeSquares debug function finally gives some errors (manager_action_attack_custom.lua:493 : attempt to index local 'tgtToken' (a nil value)) - I guess a ruleset coding change disabled the CMC functionality.

52698

52699

52700

Is the grid visible (eye icon)
The dm can unlock the map, go to the grid tab. There it is an eye icon. That icon has to be on, that toggles the grid visibility.

Our group has at least had that problem before.

Arnagus
May 9th, 2022, 22:21
Is the grid visible (eye icon)
The dm can unlock the map, go to the grid tab. There it is an eye icon. That icon has to be on, that toggles the grid visibility.

Interesting, will check

Arnagus
May 14th, 2022, 16:49
Interesting, will check

Found the eye, and toggled it - still does not work for Flanking, but "rng30" (including "point-blank" and "shooting into melee") works again, MANY thanks!

*** edited 2022-05-15 ***
Flanking works as well, but eye must be on before tokens are placed on the map!
Thanks again for the pointer.

Svandal
May 25th, 2022, 20:16
A bug report:
Point blank shot effect, this works most of the time. But sometimes I do not get the +1 to attack when making a ranged attack on the first attack of the round, but I always get it on the second attack.

I am not able to reproduce it every round. But there is a delay between when attacking and the effect ATK +1 and DMG +1 is applied that makes it not always trigger on the first attack. Is it possible to code in a delay when the code applies the effect to the character? That might fix this?

Edit: Look at attached screenshot. I started the turn and attacked an enemy, then I attacked an enemy again, both with the same ranged attack. As you can see the first attack has a +9 to hit, but the second attack has +10 to hit. Both should be +10, I did not add or remove any effects between the attacks. And as you can see the damage is the same for both attacks, so point blank shot works on both attacks for the damage.
52941

Svandal
May 26th, 2022, 17:05
A bug report:
Point blank shot effect, this works most of the time. But sometimes I do not get the +1 to attack when making a ranged attack on the first attack of the round, but I always get it on the second attack.

I am not able to reproduce it every round. But there is a delay between when attacking and the effect ATK +1 and DMG +1 is applied that makes it not always trigger on the first attack. Is it possible to code in a delay when the code applies the effect to the character? That might fix this?

Edit: Look at attached screenshot. I started the turn and attacked an enemy, then I attacked an enemy again, both with the same ranged attack. As you can see the first attack has a +9 to hit, but the second attack has +10 to hit. Both should be +10, I did not add or remove any effects between the attacks. And as you can see the damage is the same for both attacks, so point blank shot works on both attacks for the damage.
52941

I just did some quick testing on my own campaign, and I was not able to reproduce it there. The error occured when I was a player, but we should be using the same extensions.
I have to make some more testing with his campaign to see if I can reproduce it. Does anybody else have this issue?

tolkienoz
August 11th, 2022, 17:06
Has the extension been removed from the forge? Can´t find it anymore...

bmos
August 11th, 2022, 18:10
Has the extension been removed from the forge? Can´t find it anymore...Yes. It is currently unlisted.
The previous link (as found in the first post of this thread) was: https://forge.fantasygrounds.com/shop/items/406/view
The code for this extension is on github (and contains some improvements that weren't released): https://github.com/Dogfisc/combat-modifier-calc

dogfisc
August 11th, 2022, 18:30
It shouldn’t have been delisted. I must have done something wrong when I last updated it. It’s listed again now.

Svandal
September 18th, 2022, 19:17
Hi dogfisc. I am not sure if you saw my post about expanding npc weapons.
I have made a pull request on github where I have added a bunch of weapons for npcs.

I never wrote in this forum that I did this, so I am going to inform you now 😃

dogfisc
October 4th, 2022, 23:35
Hi dogfisc. I am not sure if you saw my post about expanding npc weapons.
I have made a pull request on github where I have added a bunch of weapons for npcs.

I never wrote in this forum that I did this, so I am going to inform you now ��
Finally got this in. I left “bolas” because that’s how it appears in the database when added to a PC, but also left your addition of “bola” in case there are NPCs coded that way.

Arnagus
October 16th, 2022, 15:18
Hello dogfisc,
I have encountered an incompatibility in-between your "Combat Modifier Calculation (https://forge.fantasygrounds.com/shop/items/406/view)" and GKEnialb's "Token Height Indicator (https://forge.fantasygrounds.com/shop/items/67/view)". There is no error message, but if the other extension is enabled (just enabled - you do not even need tokens on different "height"), your "Flanking" calculation is not applied. Both of you recently updated your corresponding extension - so the problem might also be on his side. I am therefore cross-posting the finding here (https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator&p=665419#post665419).
Arnagus

dogfisc
October 17th, 2022, 19:40
Hello dogfisc,
I have encountered an incompatibility in-between your "Combat Modifier Calculation (https://forge.fantasygrounds.com/shop/items/406/view)" and GKEnialb's "Token Height Indicator (https://forge.fantasygrounds.com/shop/items/67/view)". There is no error message, but if the other extension is enabled (just enabled - you do not even need tokens on different "height"), your "Flanking" calculation is not applied. Both of you recently updated your corresponding extension - so the problem might also be on his side. I am therefore cross-posting the finding here (https://www.fantasygrounds.com/forums/showthread.php?66566-5E-Token-Height-Indicator&p=665419#post665419).
Arnagus

Thanks, I responded in the other thread.

dogfisc
October 19th, 2022, 06:13
I've updated this extention to fix the compatibility issue with Token Height Indicator.

Arnagus
October 23rd, 2022, 09:33
I've updated this extention to fix the compatibility issue with Token Height Indicator.

Will try today - as said: many thanks for digging into it together.

Arnagus
November 2nd, 2022, 08:30
We have now tested in two extensive battles and flanking (and this sneak attacks) work well in all relevant cases. We found some edge cases in the last battle with flanking not recognized when
A) The attacker overlaps half a box to the defender
B) when attacking upwards someone flying 5' high, being flanked by a 10' high second attacker.
C) we still need to check significant size changes - although there was a debate if the second attacker actually threatened the square (again: a half a box topic)
Many thanks for fixing.

Svandal
November 2nd, 2022, 15:37
We have now tested in two extensive battles and flanking (and this sneak attacks) work well in all relevant cases. We found some edge cases in the last battle with flanking not recognized when
A) The attacker overlaps half a box to the defender
B) when attacking upwards someone flying 5' high, being flanked by a 10' high second attacker.
C) we still need to check significant size changes - although there was a debate if the second attacker actually threatened the square (again: a half a box topic)
Many thanks for fixing.

I got a question about this overlapping boxes.
Half overlapping should never occur, so there should not be any rules for flanking covering these cases. Or maybe I am misunderstanding something?

Arnagus
November 3rd, 2022, 07:22
Overlapping boxes: according to the official 3.5e rules - no it should not. It is possible in FGU to have the tokens placed like that, and there is an old AD&D 2e rule/weapon proficiency on „close quarter fighting” (adopted from “Battlesystem Skirmishes” rules for square maps) which allow movement and attacks with S sized weapons which we adopted as house rule.

So you are right (and that’s why I call it “edge case”), overlapping tokens are not official. I suspect there is somewhere in the ext a “x<5” which I will need to find some day and change to “x<=5” ;-)

bmos
November 3rd, 2022, 12:27
I suspect there is somewhere in the ext a “x<5” which I will need to find some day and change to “x<=5” ;-)

Maybe this?
https://github.com/Dogfisc/combat-modifier-calc/blob/main/scripts/manager_action_attack_custom.lua#L227-L234

Arnagus
November 4th, 2022, 09:41
That looks promising, I will play around with this.

dogfisc
November 5th, 2022, 03:39
Overlapping boxes: according to the official 3.5e rules - no it should not. It is possible in FGU to have the tokens placed like that, and there is an old AD&D 2e rule/weapon proficiency on „close quarter fighting” (adopted from “Battlesystem Skirmishes” rules for square maps) which allow movement and attacks with S sized weapons which we adopted as house rule.

So you are right (and that’s why I call it “edge case”), overlapping tokens are not official. I suspect there is somewhere in the ext a “x<5” which I will need to find some day and change to “x<=5” ;-)
Interesting. In my game I never have tokens overlapping (except maybe when the party is going up/down stairs to a new map and I need to squeeze them in). I do wonder if it may also cause issues with very small creatures that don't threaten outside their own space. It may not, since it does look at reach, not just distance.

Arnagus
November 5th, 2022, 10:39
I do wonder if it may also cause issues with very small creatures that don't threaten outside their own space. It may not, since it does look at reach, not just distance.
Need to check with our mage's cat familiar - can't remember if he ever put her in combat, and she surely does not have the proficiency. Would be a crazy setup... cat in-between the legs and thief gets sneak attack. :-D

Navigat0r
November 10th, 2022, 16:26
I think I may have found a conflict between this extension and the Token Height Extension by GKEnialb (https://forge.fantasygrounds.com/shop/items/67/view). In a campaign with only the aforementioned two extensions loaded, the flanking and Point Blank Shot functions seem to be working fine. However, the "shooting into melee" modifier is not applied automatically nor does the relevant modifier button in the lower left hand corner appear to do anything. In a fresh campaign with only the Combat Modifier Calculation Extension loaded, shooting into melee calculates as expected though the manual modifier button still doesn't work (it should be noted that all other modifier buttons seem to be working as intended).

dogfisc
November 10th, 2022, 17:00
I think I may have found a conflict between this extension and the Token Height Extension by GKEnialb (https://forge.fantasygrounds.com/shop/items/67/view). In a campaign with only the aforementioned two extensions loaded, the flanking and Point Blank Shot functions seem to be working fine. However, the "shooting into melee" modifier is not applied automatically nor does the relevant modifier button in the lower left hand corner appear to do anything. In a fresh campaign with only the Combat Modifier Calculation Extension loaded, shooting into melee calculates as expected though the manual modifier button still doesn't work (it should be noted that all other modifier buttons seem to be working as intended).
Thanks, I’ll take a look.

Goldilex
March 1st, 2023, 00:18
It seems that this delightful mod isn't working as intended with the recently added token height functionality in fgu. Any chance of an update? It's an amazing mod!

dogfisc
March 4th, 2023, 19:52
It seems that this delightful mod isn't working as intended with the recently added token height functionality in fgu. Any chance of an update? It's an amazing mod!

I've a guess as to the issue, but I'll have to test it out. If I'm correct it's a simple fix, so here's hoping :)

dogfisc
March 4th, 2023, 20:06
I've a guess as to the issue, but I'll have to test it out. If I'm correct it's a simple fix, so here's hoping :)

Yup, pretty sure that was it. I need to run out for the afternoon, but I'll get this fully tested and out either tonight or tomorrow.

dogfisc
March 6th, 2023, 00:52
Updated version has been uploaded to Forge, for compatibility with the latest FGU update.

Arnagus
March 19th, 2023, 13:42
It's unlisted on the Forge (again). I suspect this was not intentional?
56770

dogfisc
March 20th, 2023, 22:11
It's unlisted on the Forge (again). I suspect this was not intentional?
56770

Not intentional. It’s listed again now.
Thanks for pointing this out.

Morenu
May 29th, 2023, 02:05
We have been getting the following error 57471 inconsistently for more than a month. this error happens when an affected character attacks certain creatures.

we have had it happen to a creature that the character successfully attacked with the same weapon the previous round. yet most of the time, other players can attack that same creature (but sometimes not). The DM can always attack the creature using the affected characters same attack icon via their character sheet.

we have had players exit FGU and return and it continues.

we have had the same NPC drug to the map 4 times and the error only happens on 1.

it has happened on core npcs and module based ones

we have had the npc removed and readded and sometimes get fixed sometimes not.

Today in session, we all closed fgu and restarted without your extension plus a few other ones (Rob2E (https://https://forge.fantasygrounds.com/shop/items/620/view), Rhaglstrom (https://forge.fantasygrounds.com/shop/items/523/view), Zygmunt (https://forge.fantasygrounds.com/shop/items/132/view), & Sirnoobsauce (https://forge.fantasygrounds.com/shop/items/1133/view)). we did not have another issue during the next 2 hours. I am posting here first as the error says something about combat modifiers and I didn't know if it was specific to your extension or not.

Not sure if this is helpful but this was the combat. the single NPC was unique to the module, the other four were from a bestiary I believe.
57472

Arimil508
July 1st, 2023, 05:22
Hi I just wanted to let you know i have had some issues with this extension finding custom weapons. I run a pathfinder campaign in the modern setting and i have a SMG, Medium I have had issues with it not being found if it was enchanted and its name changed to +1 SMG, Medium. is there any particular syntax for weapon names that the extensions do not like.

sjbehindthescreen
August 12th, 2023, 21:44
I was glad to find this for a 3.5 game, but I can't get the ranged increment thing to work, or at the least I don't understand how it works. Can someone show an example? I am using it as the only extension for the 3.5SRD campaign.

EDIT: if I had read post #128 correctly, I would have the answer to my question. And now I do!

rmilmine
December 28th, 2023, 22:31
After much loading and unloading to figure out which extension was giving the error I found it was this one.

[12/28/2023 5:18:49 PM] [ERROR] Script execution error: [string "..ModifierCalculation:..n_attack_custom.lua"]:423: attempt to index a nil value

When a player tries to attack with a melee weapon they get the above error.
The GM/Host does not get this error.

tahl_liadon
January 1st, 2024, 19:36
.
hi folks. happy new year!

a bit of assist here plz...

this extension shows as "on" in forge. however, when i load up fgu (pf1e), it is not listed in the extensions list at first-open in chat window. also none of the "what is does" mentioned in post #1 is available in the modifiers window.

what am i missing?

rmilmine
January 1st, 2024, 21:06
If you aren't seeing it in the extensions list for the campaign you may need to do a check for updates and try again.
Also there may be a bug of some kind with this extension I started getting errors with it and melee weapons.

dogfisc
January 1st, 2024, 21:41
After much loading and unloading to figure out which extension was giving the error I found it was this one.

[12/28/2023 5:18:49 PM] [ERROR] Script execution error: [string "..ModifierCalculation:..n_attack_custom.lua"]:423: attempt to index a nil value

When a player tries to attack with a melee weapon they get the above error.
The GM/Host does not get this error.

It shouldn't matter if the attack is made by the GM or a player ("shouldn't", heh). What would affect it is they target that is being attacked. That part of the code is checking the type of the target, specifically to see if it is a swarm, as swarms are not subject to flanking. In the case of that error, whatever the target of the attack is doesn't have a "type" in the database.
Unfortunately, I can't reproduce this. I've tried creating a new NPC and intentially not given it a type and it still returns an empty string rather than nil. I'll add some checking to catch this error though. If you can provide any details about what the player was attacking that may help (especially if it was an NPC from one of the PF Bestiaries, since I can look at them myself).
Also, is this error coming up every attack at any target, or just a specific target?

dogfisc
January 1st, 2024, 21:43
.
hi folks. happy new year!

a bit of assist here plz...

this extension shows as "on" in forge. however, when i load up fgu (pf1e), it is not listed in the extensions list at first-open in chat window. also none of the "what is does" mentioned in post #1 is available in the modifiers window.

what am i missing?

Looks active in the Forge to me as well. Do you see CombatModifierCalculation.ext in your \Fantasy Grounds\Data\extensions directory?
If it's loaded the chat window should have this at startup:
Combat Modifier Calculation v1.6
Automatically calculate modifiers for flanking, range, and shooting into melee

dogfisc
January 1st, 2024, 22:14
I've uploaded a new build to Forge that will check for
[ERROR] Script execution error: [string "..ModifierCalculation:..n_attack_custom.lua"]:423: attempt to index a nil value
It will give a warning in chat "Target 'type' returns nil" if the situation causing that error occurs.

tahl_liadon
January 1st, 2024, 23:09
.

If you aren't seeing it in the extensions... do a check for updates and try again.

that worked. thx!


...chat window should have this at startup:
Combat Modifier Calculation v1.6
Automatically calculate modifiers for flanking, range, and shooting into melee

it's showing up in the list now. thx!

however, (see image)

1) i am still not seeing the other 2 buttons?

"Adds buttons to the Modifiers window for shooting into melee and flanking.
Puts buttons on the desktop for the three levels of cover, shooting into melee, flanking, and flat-footed."

2) assuming i can (can i?) reposition the dice, i don't think they are showing on desktop either?
.
.

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=59630

tahl_liadon
January 1st, 2024, 23:43
.
okay did a test crossbow (trap) attack...

a) i do notice extension auto-populated "rng30" in tracker
b) crossbow has 80 ft range; which is fine, no penalty
c) in chat window, "shoot melee -4" has been applied to all targets
d) penalty to shoot into melee applies only if an ally of shooter is in melee

explain plz?


https://www.fantasygrounds.com/forums/attachment.php?attachmentid=59631

dogfisc
January 2nd, 2024, 01:50
I had to treat neutrals as either allied or enemy for purposes of shooting into melee, so I went with allied (logic being that if you don’t know that they’re hostile, the preference should be to avoid accidentally hitting them). If you change the trap to the hostile faction it won’t get the shooting into melee penalty against units in the friendly faction.

rmilmine
January 2nd, 2024, 12:44
It shouldn't matter if the attack is made by the GM or a player ("shouldn't", heh). What would affect it is they target that is being attacked. That part of the code is checking the type of the target, specifically to see if it is a swarm, as swarms are not subject to flanking. In the case of that error, whatever the target of the attack is doesn't have a "type" in the database.
Unfortunately, I can't reproduce this. I've tried creating a new NPC and intentially not given it a type and it still returns an empty string rather than nil. I'll add some checking to catch this error though. If you can provide any details about what the player was attacking that may help (especially if it was an NPC from one of the PF Bestiaries, since I can look at them myself).
Also, is this error coming up every attack at any target, or just a specific target?

The targets were other PCs at the time.
The problem does appear to not be happening any longer, as I've not been able to replicate it.

rmilmine
January 2nd, 2024, 12:47
.


that worked. thx!



it's showing up in the list now. thx!

however, (see image)

1) i am still not seeing the other 2 buttons?

"Adds buttons to the Modifiers window for shooting into melee and flanking.
Puts buttons on the desktop for the three levels of cover, shooting into melee, flanking, and flat-footed."

2) assuming i can (can i?) reposition the dice, i don't think they are showing on desktop either?
.
.

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=59630


Look under your dice. You will see buttons there. move your dice out of the way and you willl find the buttons you are looking for.

tahl_liadon
January 2nd, 2024, 21:58
I had to treat neutrals as either allied or enemy for purposes of shooting into melee, so I went with allied (logic being that if you don’t know that they’re hostile, the preference should be to avoid accidentally hitting them). If you change the trap to the hostile faction it won’t get the shooting into melee penalty against units in the friendly faction.

gotcha! makes sense. i'll do the work-around.

tahl_liadon
January 2nd, 2024, 21:59
Look under your dice. You will see buttons there. move your dice out of the way and you willl find the buttons you are looking for.

ook. i'll check it out. thx!

wakhere
January 16th, 2024, 17:33
combat modifier extension.
im getting an error.
i think its with this module.
on pathfinder my players get this message when attacking. in melee.



things are okayish if using ranged.....

i could do the attacks as the |GM all okay......

so for my entire session i had to do all attacks for my players.
not just weapons....CMB rolls as well.....

if this image upload fails the error message reads.
Handler error:sting "...ModifierCalculation:..attack_custom.lua]:478 attaempt to compare number with nil

if this is not correct place to report this...i posted in house of healing and was sort of directed to repost here i think.....
cheeeeers wak

tahl_liadon
January 16th, 2024, 18:36
C:\Users\Admin\Downloads\unnamed.png

hi. this won't work as it is reference-link to your pc.

go back and edit your post and use the "go advanced" edit button. you will see a "manage attachments" buttons below the text edit field.

hopefully you can figure out to upload visual there. good luck.

dogfisc
January 18th, 2024, 06:38
Handler error:sting "...ModifierCalculation:..attack_custom.lua]:478 attaempt to compare number with nil


I just responded to your PM but I'll put the same thing here in case anyone else has this issue.

I've found where this error is occurring, but I'm not entirely sure what is causing it. That line is comparing the distance between two tokens with their reach. One of those, distance or reach, doesn't have a value. Since distance is calculated based on the tokens' position on the grid, it's most likely that a token doesn't have a reach value in the database. If I remove the reach from a token I can reproduce the error, but I can't figure out how to do that using the normal interface (I had to manually edit the database).
None of that explains why it would work for the GM but not the players.

I just uploaded a new build that checks for a missing value, and if so writes out a message in the chat. That should help pinpoint exactly what is causing it. The message will look like this:

s'missing reach for: ' | databasenode = { combattracker.list.id-00023 } | s'Test Monster'

bmos
January 27th, 2024, 23:11
Interesting idea you might already have thought of:
Now that height is tracked natively, you could factor higher ground advantages into melee attacks.

FGMax
February 2nd, 2024, 19:37
Hi guys,

The PBS bonus isn't applying correctly to attacks on player side. It works after the first attack once the bonus has applied but it won't work on the first because the ATK bonus doesn't apply until after the attack is made. Me and my players speculate that the attack is occurring before the bonus is applied but it works correctly for me client side.

Svandal
February 14th, 2024, 08:51
Hi guys,

The PBS bonus isn't applying correctly to attacks on player side. It works after the first attack once the bonus has applied but it won't work on the first because the ATK bonus doesn't apply until after the attack is made. Me and my players speculate that the attack is occurring before the bonus is applied but it works correctly for me client side.

I have also noticed that and posted this some time ago. https://www.fantasygrounds.com/forums/showthread.php?66441-Combat-Modifier-Calculation-Extension&p=651611&viewfull=1#post651611
Nobody else apparently had this problem, and it did not happen all the time for me. There is a problem with the effect not taking place before the attack roll even though it should

GileadBZ
March 22nd, 2024, 10:54
I just responded to your PM but I'll put the same thing here in case anyone else has this issue.

I've found where this error is occurring, but I'm not entirely sure what is causing it. That line is comparing the distance between two tokens with their reach. One of those, distance or reach, doesn't have a value. Since distance is calculated based on the tokens' position on the grid, it's most likely that a token doesn't have a reach value in the database. If I remove the reach from a token I can reproduce the error, but I can't figure out how to do that using the normal interface (I had to manually edit the database).
None of that explains why it would work for the GM but not the players.

I just uploaded a new build that checks for a missing value, and if so writes out a message in the chat. That should help pinpoint exactly what is causing it. The message will look like this:

s'missing reach for: ' | databasenode = { combattracker.list.id-00023 } | s'Test Monster'

Do we have some news about that?