View Single Post
wdmartin
Senior Member
 
Join Date: May 2013
Posts: 240

Old December 22nd, 2017, 12:21 AM
Wyrm, never mind on that request for a .por file. I think I've got it nailed down.

And, amazingly, it's not a bug in my code! (For once.) It's a bug in the pre-reqs script for the feat Covering Fire (the one from the Villain Codex).

The pre-req code for that feat currently looks like this:

Code:
var tagexpr as string

if (hero.tagis[WepFocus.?] <> 0) then
	tagexpr = "wCategory.Firearm & (" & hero.tagids[WepFocus.?] & ")"
else
	@valid = 0
	done
endif

foreach thing in BaseWep where tagexpr
	@valid = 1
nexteach
Because the error says it was an invalid tag expression, I copied this script over to a fake feat called Blork and added a line like this right after the tagexpr variable is defined:

Code:
	debug "Tag expression is: " & tagexpr
Then I set up a Gunslinger with the World is Square rules turned on, added Weapon Focus (Firearms), and Covering Fire. The debug output looks like this:

Code:
Tag expression is: wCategory.Firearm & (WepFocus.wAasenMort,WepFocus.wMHAirPist,WepFocus.wMHAirRifl,WepFocus.wArcPistol,WepFocus.wArcRifle,WepFocus.wAutograpn,WepFocus.wAxeMusket,WepFocus.wBlunderbu,WepFocus.wBombardHv,WepFocus.wBombardLt,WepFocus.wBombardSt,WepFocus.wBuckGun,WepFocus.wCannon,WepFocus.wCannFiend,WepFocus.wGRCannGre,WepFocus.wGRCannHvy,WepFocus.wGRCannLgt,WepFocus.wGRCannSct,WepFocus.wMHHKMP5,WepFocus.wMHHKMP5K,WepFocus.wMHM4Carbi,WepFocus.wMHUzi,WepFocus.wCulverin,WepFocus.wDartGun,WepFocus.wDeathRay,WepFocus.wDblHackbu,WepFocus.wGRDragon,WepFocus.wDragMuske,WepFocus.wDragPisto,WepFocus.wEMPPistol,WepFocus.wEMPRifle,WepFocus.wFirelance,WepFocus.wMHFlameth,WepFocus.wFlaTh1917,WepFocus.wMHFlareGn,WepFocus.wFlareGun,WepFocus.wMPBBGatgn,WepFocus.wGRGorgon,WepFocus.wGravPisto,WepFocus.wGravRifle,WepFocus.wMHM792,WepFocus.wGRHarpy,WepFocus.wHotchkiss,WepFocus.wIdRifle,WepFocus.wInfPistol,WepFocus.wLasPistol,WepFocus.wLasPist2,WepFocus.wLaserRifl,WepFocus.wLMGMadsen,WepFocus.wMHM2HB,WepFocus.wMHM60,WepFocus.wMHTTMG,WepFocus.wGRMedusa,WepFocus.wMHNetLaun,WepFocus.wMHPntBlGn,WepFocus.wMHBer92F,WepFocus.wMHBer93R,WepFocus.wMHCM1911,WepFocus.wMHCDE10mm,WepFocus.wMHDerring,WepFocus.wMHDestEgl,WepFocus.wMHFalcon4,WepFocus.wMHGlock17,WepFocus.wMHGlock20,WepFocus.wMHMAC10,WepFocus.wMHSITESM9,WepFocus.wMHSkorpin,WepFocus.wMHTEC9,WepFocus.wMHWalPPK,WepFocus.wGRPrivate,WepFocus.wMHCPython,WepFocus.wMHPathfin,WepFocus.wMHRugerSv,WepFocus.wMHSWM29,WepFocus.wMHAK47,WepFocus.wMHBarLtFy,WepFocus.wMHHKG3,WepFocus.wMHHKPSG1,WepFocus.wMHM16A2,WepFocus.wMHOICW,WepFocus.wMHRem762,WepFocus.wMHSterAUG,WepFocus.wMHTACMIL,WepFocus.wMHWinch94,WepFocus.wMSRDConcs,WepFocus.wMSRDCryon,WepFocus.wMHLAW,WepFocus.wMHBene121,WepFocus.wMHBerM3P,WepFocus.wMHBrnBPS,WepFocus.wMHMoss12G,WepFocus.wMHSawShot,WepFocus.wMPSCEGRSG,WepFocus.wMHSkFmSpr,WepFocus.wGRStinger,WepFocus.wMHSpWatGn,WepFocus.wGRSwivGun,WepFocus.wMHTaser,WepFocus.wGRTitan,WepFocus.wMHWaterCn)
Yup -- the hero was successfully tagged as having Weapon Focus with every single firearm in the game. But the resulting tag expression is totally invalid -- hence the error.

If you disable the WiS rules and create a gunslinger with Weapon Focus (Blunderbuss) and Covering Fire, everything works great. In that case, my test code yields this:

Code:
Tag expression is: wCategory.Firearm & (WepFocus.wBlunderbu)
This is a valid tag expression and works fine.

But if you take that same gunslinger (without the WiS rules) and add a second Weapon Focus feat, it triggers the invalid tag expression error. Here's the debug output for a gunslinger who's got Covering Fire, Weapon Focus (Blunderbuss) and Weapon Focus (Lance):

Code:
Tag expression is: wCategory.Firearm & (WepFocus.wBlunderbu,WepFocus.wLance)
So basically, the Covering Fire pre-req script is bugged in such a way that it cannot tolerate a PC with more than one Weapon Focus feat.

I'll file a bug report.
wdmartin is offline   #33 Reply With Quote