PDA

View Full Version : Oddly, this blows up



Varsuuk
July 18th, 2020, 07:14
Whenever I wanted to save the old values or add my own comment (as in the example below) to the top of record_car_more.xml that I copied from MoreCore to make my changes, it reports errors.

Moving the comment to where you see it above <root> lets me continue fine.



<!-- cas2 bounds must match combatframe's x(45) + h(170) = 215 -->
<root>
<!-- New WindowClass "charsheet_more" -->
<windowclass name="charsheet_more">
<script>
function onInit()
self.onSizeChanged = resizeFrames;
end

function resizeFrames(sourceWindow)
local nWidth,_ = getSize();
combatframe.setStaticBounds((nWidth/3*2)-15, 45, (nWidth/3)-15, 170)
cas2.setStaticBounds((nWidth/3), 0, (nWidth/3)-15, 215)
end
</script>

<sheetdata>



Error (ignore the warnings, I haven't looked at those yet - they appear even when things "work" - the errors after the ">>>>" marked one seem to just be cascading from the initial but I included for completeness.)
:


Runtime Notice: Reloading ruleset
Runtime Notice: s'aMajor: ' | { s'CoreRPG' = #4, s'MoreCore' = #1 } | s' aMinor: ' | { s'CoreRPG' = #0, s'MoreCore' = #58 }
Runtime Notice: s'onInit: registerResultHandler'
Ruleset Warning: window: Anchored static height ignored for control (pcclasslink) in windowclass (charsheet)
Ruleset Warning: window: Anchored static height ignored for control (pcclasslink) in windowclass (charsheet)
>>>>Script Error: [string "charsheet_more"]:1: 'end' expected near '<eof>'
Ruleset Warning: window: Anchored static height ignored for control (pcclasslink) in windowclass (charsheet)
Ruleset Error: window: No vertical anchor defined for control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas2_label) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas2_label) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas2_label) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cliroller) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cliroller) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cliroller) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cliroller) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (scroll_2) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (scroll_2) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (scroll_2) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas2a) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas2a) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas2a) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas1) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas1) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas1) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)
Ruleset Error: window: Control (cas3a) anchoring to uncalculated control (cas2) in windowclass (charsheet_more)

Moon Wizard
July 18th, 2020, 08:11
It sounds like the "cas" control is either defined after the other controls; or does not exist yet.

Regards,
JPG

damned
July 18th, 2020, 09:06
cas2 is set by script to allow for screen resizing.
if you mess up the script then cas2 isnt defined and everything else that is positioned relative to it will not work.

you can see I have a comment within <root> in your example.
it may be that some of the characters in your comment are invalid?

also why does cas2 have to be the same size as combat?

Varsuuk
July 18th, 2020, 09:13
I’ll answer that in the morning Damned, I was moving stuff around (got rid of the attacks frame and content) in bed on phone now. The comment intent isn’t the issue but why it burps.

The issue that had me confused is simply putting the comment between the two setbounds call (you see the comment above root, that’s the one I had between the two and caused the error...)

I kept retyping over the <!— —> thinking I had something weird. No clue. Didn’t stop me, I removed the comment only left here for you to see. But still, wondered what I did wrong. The comment once removed means no errors so it isn’t an order of XMas etc definition. I don’t change that to get it to work - I just remove the comment.

Trenloe
July 18th, 2020, 09:37
You can’t use the XML comment syntax in LUA code.

See here for the comment syntax needed for LUA code within XML files: https://fantasygroundsunity.atlassian.net/wiki/spaces/FGU/pages/4128914/Ruleset+-+Scripting#Using-Scripts

Varsuuk
July 18th, 2020, 15:07
... and I knew that.

I even helped someone on that lol. I was remembering last night/this morning (3+ am was prob part of the issue) that “—“ didn’t work In script in XML, so I used the OTHER comment. Face palm.

Thanks Trenlioe, sorry everyone else for confusing ya.