View Full Version : Targeting Script Error

August 19th, 2010, 03:13
Good evening all,

Using the latest patch AND the C&C rules set, hence I am posting here.

I am getting a script error that I am hoping someone could help me with. The error is:

"Script Error: [string "scripts/combattracker_targeting.lua"]:26: attempt to index local 'v' (a userdata value)"

This error only occurs when a player clicks on a neutral or hostile token to UNselect it (so they may choose a new / different target). Moving foward after that error occurs, future targeting of that particular token does not display properly in the Target Tracker window.

Is anyone else having this problem? Reloading (during tests) seems to clear the effect, but it can be immediately repeated by de-selecting a target again.

This has been encountered in an existing campaign, and have been able to repeat in a brand new campaign.

Our group would like to select and de-select targets as the combat progresses without error, and without the combat tracker screwing up (as it does after the error occurs).

Also please note that this is not a fresh install of the rules set. We have been playing for the last 8 months before deciding to use some of the more advanced map features. Should the host or players reinstall a freshly downloaded copy of C&C? And if so, what would the host need to back up in order to save the campaign data?

Thanks a bunch and FG2 is GREAT!


August 19th, 2010, 22:09
The same problem appears in the pathfinder ruleset since the update.

Moon Wizard
August 19th, 2010, 23:05
Yes, the quick fix is to add a "widgets = {};" line right before "empty = true", in the combattracker_targeting.lua file; if you are comfortable with editing ruleset files.

This is actually bad widget cleanup code that has been shared quite a bit. I'm looking into why this didn't generate an error before.


Moon Wizard
August 19th, 2010, 23:28
I remember now. The widgets were actually not being destroyed when the destroy function was called, therefore there was no error when the widgets were incorrectly called later.

I'll look into building a patch to the ruleset or a patch extension.


August 20th, 2010, 01:04
Thank you so much for the reply! I'll look at adding the widget fix.

Edit: I have done this. There are two "empty = true" calls in the .lua file. Only one had the "widgets = {};" line item. I applied the fix to the one lacking, and after a quick test I can report it is working.

Again - thank you for this!