Advanced

Re: Method GetBadgeGenData()

Method GetBadgeGenData()
March 19, 2024 08:24AM
A while back we released version 4 of BadgeGen. We however left the old V3 ruleset so that it can be accessed in different ways. For example when loading Profile stats one can add the get parameter &bgv3. But also regarding LUA callbacks we didn't touch the existing api method GetBadgeGenData(). Instead we added a new one called GetBadgeGenDataV4().

For clarity I will today (in a few minutes) renamed the old one to GetBadgeGenDataV3(). I will also fix all 17 scripts using the old version, so that it calls the function by its new name.
Re: Method GetBadgeGenData()
April 26, 2024 03:16AM
Hi there ... it seems calling PGC.GetBadgeGenDataV4 just causes an exception. I was looking into extending Hugh's leapday script for the other addon badges (I've done all except 366 and DT). I came back to it after a long while, and it just always throws an exception, without any information. I've put print statements into my script and narrowed it down to this call. I was wondering if it was just my script - so I ran the original (https://project-gc.com/Challenges/80820)... also gives an exception in the same way.

I'm assuming it's the change mentioned here that causes it to not work?
Re: Method GetBadgeGenData()
April 26, 2024 03:24AM
Also, if I dump the keys in the PGC table, it doesn't include PGC.GetBadgeGenDataV3? Just these two related to BadgeGen (both of which cause an exception):

PGC.GetBadgeGenDataV4
PGC.GetBadgeGenData
Re: Method GetBadgeGenData()
April 26, 2024 10:23AM
It was actually unrelated to the above change.

We recently added support for imperial units in BadgeGen. It was a required parameter when calling its "get data" function, but not such parameter was provided from the LUA callback.

I have now fixed that. The LUA callback always uses imperial=false. Metric is the base unit for the rules, so imperials are just estimates. If a checker script wants to present imperials it can convert by itself, since it's more of a presentation layer.

Thanks for making us aware.
Sorry, you do not have permission to post/reply in this forum.