Junior Member
Join Date: Jun 2019
Location: Palermo, Italy
Posts: 15
|
Hello everybody, I have created an Eval Script that is meant to increase the critical threat range of any weapon by 1, after the hero gets to level 11.
This is the eval script I've written (Post-attributes, 10000, 1): Code:
if (field[xTotalLev].value >= 11) then var threat as number foreach pick in hero from BaseWep threat = eachpick.tagvalue[wCritMin.?] - 1 perform eachpick.delete[wCritMin.?] perform eachpick.assignstr["wCritMin." & threat] nexteach endif Moreover, I noticed another issue. If the weapon I am wielding is a keen weapon, or if I have the Improved Critical Feat, the code I have written reduces the critical threat range by 2, not by 1. Is there a way to avoid this? Thanks for your help! UPDATE: I managed to solve the Invalid syntax for tag template error. The reason was probably that some weapons (no idea which ones) did not have the wCritMin tag and thus were unable to execute the script. This is the updated code (now working): Code:
if (field[xTotalLev].value >= 11) then var threatrng as number foreach pick in hero from BaseWep where "wCritMin.?" threatrng = eachpick.tagvalue[wCritMin.?] - 1 perform eachpick.delete[wCritMin.?] perform eachpick.assignstr["wCritMin." & threatrng] nexteach endif Last edited by marcopico; July 26th, 2019 at 09:41 AM. |
#1 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
Try changing the timing of your script so it fires after Imp Critical or Keen multiply the threat range.
|
#2 |
Junior Member
Join Date: Jun 2019
Location: Palermo, Italy
Posts: 15
|
I see your point, but I don't know how to change the timing properly. What is the script (Keen and/or Improved Critical) after which I should apply my script?
|
#3 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
In the Editor, make copies of the Improved Critical feat and the Keen weapon power, and look at the timing of their respective scripts. Set the timing of your script immediately after those two. Don't forget to delete the copies of Imp Crit and Keen after you peruse them.
|
#4 |
Junior Member
Join Date: Jun 2019
Location: Palermo, Italy
Posts: 15
|
Quote:
If I move my script to Pre-Levels 5001, it simply doesn't work (i.e. it does not decrease the critical threat range by 1; the range stays the same as if nothing happened). It looks like it should be set to Post-Levels (I had it at Post-Levels 10000) to make it decrease the critical threat range by 1. I realize that when you talk about Timing you are referring to the Timing button, not the Phase menu or the Priority number, but how do I set my script's Timing so that it activates after another process (iKeen or fImprCrit) which apparently have no Timing? I apologise if I'm doing something wrong and looking incredibly numb |
|
#5 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The phase and priority is what he's actually referring to - that determines the order a script is run in, relative to all other scripts - the whole set of Phase, Priority and Timing is generally lumped under "Timing". The "Timing" button is tools to help you determine which order to run it in - the option to name scripts, and to record the names of other scripts that it must be before or after, to help you keep track of what depends on what.
|
#6 |
Junior Member
Join Date: Jun 2019
Location: Palermo, Italy
Posts: 15
|
Quote:
Improved Critical: Pre-Levels 5000 Keen: Pre-Levels 5000 My script: Pre-Levels 5001 This combination does not seem to work at all: there are no changes at all to the critical threat range. Improved Critical: Pre-Levels 5000 Keen: Pre-Levels 5000 My script: Post-Levels 10000 This combination decreases the critical threat range by 1 (e.g. 18-20 becomes 17-20), but if I apply the keen and/or improved critical effect the threat range becomes 13-20 (it should be 14-20 instead: 15-20 because of keen, decreased by 1 because of my script). Anyway, thanks for helping me understand what the Timing button does :-) |
|
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
As an example that may help, here's the "Out for Blood" Dare for gunslingers/swashbucklers, which improves the critical threat range of the specified weapons by 1:
Code:
<eval phase="Final" priority="2000"><![CDATA[ doneif (tagis[Helper.SpcDisable] <> 0) doneif (field[abilActive].value = 0) var searchexpr as string ~until we get an official answer, each class can build its own list, ~and if we're a gunslinger/swashbuckler, we'll look for all weapons ~that qualify for either if (#levelcount[Gunsling] <> 0) then searchexpr = "wCategory.Firearm" endif if (#levelcount[Swashbuck] <> 0) then searchexpr = splice(searchexpr,"((((wClass.Light | wClass.OneHanded) & wType.P) | (Custom.fSlshStrik)) & wCategory.Melee & !wGroup.Natural)"," | ") endif doneif (empty(searchexpr) <> 0) foreach pick in hero from BaseWep where searchexpr ~our current interpretation is that this effect does not stack with ~keen or improved critical if (eachpick.tagexpr[Helper.Keen | Broadcast.ImpCrit] = 0) then if (eachpick.tagis[wCritMin.?] <> 0) then var critvalue as number critvalue = eachpick.tagvalue[wCritMin.?] perform eachpick.delete[wCritMin.?] critvalue -= 1 perform eachpick.assignstr["wCritMin." & critvalue] endif endif nexteach]]> <after name="AddReq.Grit checks trkLeft"/> </eval> |
#8 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Ok, didn't realize the issue was stacking with keen - let me find something more specific to that.
|
#9 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Here's the Rapier Mastery ability from the Inspired Blade shashbuckler archetype:
Code:
<eval phase="PostAttr" priority="10000" index="2"><![CDATA[ ~ only run the rest for the first copy doneif (tagis[Helper.FirstCopy] = 0) ~ If we're not shown, just get out now doneif (tagis[Helper.ShowSpec] = 0) ~ If we're disabled, do nothing doneif (tagis[Helper.SpcDisable] <> 0) foreach pick in hero from BaseWep where "IsWeapon.wRapier" perform eachpick.assign[Broadcast.CritMult] perform eachpick.assign[Helper.CritExpan] nexteach]]></eval> The Helper.CritExpan tag is specifically designed to trigger an improvement that is applied after Keen is applied. |
#10 |
|
|