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):
The script works in terms of lowering the critical threat range by 1, but I get the "Invalid syntax for tag template" error every time I add, edit or delete any weapon in my character's sheet. How do I get rid of this error?
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):
The only issue I haven't managed to solve yet is that in case of Improved Critical and Keen my script still improves the threat range by 2 instead of 1. I still have to solve the timing issue (see below)!
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
The script works in terms of lowering the critical threat range by 1, but I get the "Invalid syntax for tag template" error every time I add, edit or delete any weapon in my character's sheet. How do I get rid of this error?
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
The only issue I haven't managed to solve yet is that in case of Improved Critical and Keen my script still improves the threat range by 2 instead of 1. I still have to solve the timing issue (see below)!
Last edited: