PDA

View Full Version : Race/Class errors -5e



Weepdrag
July 1st, 2024, 22:45
Hello all,
I have a couple of console errors that I'm getting in the 5e ruleset:

When I click on the "OTHER" tab on the RACE window I get:
[ERROR] Failed to load script buffer (W:reference_race_main): [string "W:reference_race_main"]:9: 'end' expected (to close 'function' at line 5) near '<eof>'

and
When I click on the "OTHER" tab on the CLASS window I get:
[ERROR] Script execution error: [string "W:reference_class_main"]:22: attempt to index global 'specializations' (a nil value)

I'm not necessarily asking for the fix but, to learn the mechanism for WHY the errors are occurring

reference_class_main is cited in record_class.xml and record_class.xml respectively, but I'm not finding the root of the error in either case. The character window populates as expected but throws a console error.

Thanks in advance for any assistance

Zacchaeus
July 1st, 2024, 23:14
I'm not seeing this. Are you using any extensions? Have you tested in a new campaign without extensions?

If that isn't the issue can you say which particular races/classes are giving you the error and from which module/

Weepdrag
July 2nd, 2024, 00:44
Thanks Zacchaeus,
This is in a custom ruleset based on the 5e ruleset. All of the races/classes are custom and all throw the same error.
I probably posted this to the wrong board, and should have posted to the ruleset/development section.

Like I said, looking more for the "why" it would happen, rather than the fix at this point.

Thanks again

Moving this to the Workshop forum...

Weepdrag
July 2nd, 2024, 00:50
Hello all,
I have a couple of console errors that I'm getting in a modified 5e ruleset:

When I click on the "OTHER" tab on the RACE window I get:
[ERROR] Failed to load script buffer (W:reference_race_main): [string "W:reference_race_main"]:9: 'end' expected (to close 'function' at line 5) near '<eof>'

and
When I click on the "OTHER" tab on the CLASS window I get:
[ERROR] Script execution error: [string "W:reference_class_main"]:22: attempt to index global 'specializations' (a nil value)

I'm not necessarily asking for the fix but, to learn the mechanism for WHY the errors are occurring

reference_class_main is cited in record_class.xml and record_class.xml respectively, but I'm not finding the root of the error in either case. The character window populates as expected but throws a console error.

Thanks in advance for any assistance

LordEntrails
July 2nd, 2024, 01:04
Are you closing the function near line 5? It's the first error I would look into since it seems most specific.

Dakadin
July 2nd, 2024, 01:46
And the second error is happening because the specializations variable isn't found so it is a nil value. You will want to see that you are referring to it right or set it properly.

Weepdrag
July 2nd, 2024, 01:47
Thanks LordEntrails,
I checked the record_class.xml and record_race.xml for open statements and couldn't find any. I'm pretty sure that I didn't make any changes to either of these files, and a compare with the original unedited 5e versions confirms it; And got the same errors when I replaced "my" files with the original 5e files. So, I'm thinking that it is a file that interacts with those files rather than the files themselves.

This seems to be my biggest problem; not knowing what interacts with what. I guess I need to create a road map

Weepdrag
July 2nd, 2024, 02:39
Thanks Dakadin,
I'll go line by line tomorrow with fresh eyes.

LordEntrails
July 2nd, 2024, 04:07
With Notepad++ you can open all the ruleset files and do a find in all open files for the "reference_race_main"

Trenloe
July 2nd, 2024, 16:13
Thanks LordEntrails,
I checked the record_class.xml and record_race.xml for open statements and couldn't find any. I'm pretty sure that I didn't make any changes to either of these files, and a compare with the original unedited 5e versions confirms it; And got the same errors when I replaced "my" files with the original 5e files. So, I'm thinking that it is a file that interacts with those files rather than the files themselves.

This seems to be my biggest problem; not knowing what interacts with what. I guess I need to create a road map

<windowclass name="reference_race_main"> has a <script> section - it is the code within this section that's raising the error.
There is LUA code within <script>...</script> that is not properly formed - i.e. there's no "end" statement to close the function, or the XML isn't correctly formed so that the code cannot be read correctly.

A common error could be using the LUA "--" for a comment, and/or using > < for greater than/less than comparisons - both of which break XML. See information here: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996644496/Ruleset+-+Scripting#Using-Scripts

Weepdrag
July 2nd, 2024, 20:39
Thanks Trenloe,
I problem is fixed. I copied another fresh copy of the record_class.xml and record_race.xml and the problem resolved. Maybe the first "fresh" copies were in some way corrupt.

Thanks to all for the assist.

BTW, LordEntrails, you don't need to have the files open to search them Wordpad++. Just define a directory in the [Find in files] and it will search the whole directory. Really comes in handy.