PDA

View Full Version : xml comments error out



tlavalle
June 26th, 2017, 19:41
with the comment i have by aero systems. it keeps erroring out on that line. does FG read comments different or am i adding them wrong?



<?xml version="1.0" encoding="iso-8859-1"?>

<root version="0.1">
<properties>
<name>Achtung! Cthulhu</name>
<version>1</version>

<author>TonyL</author>
<description>Skills for Achtung Cthulhu.</description>

<exclusiongroup>Achtung</exclusiongroup>

<ruleset>
<name>CallOfCthulhu</name>
<minrelease>1</minrelease>
</ruleset>
</properties>

<base>
<script name="erainit">
local name = "Achtung";
local skills = {
["Accounting"] = { base=10},
["Aero Systems"] = { base=1}, <!-- Added 06/26/2017 -->
["Anthropology"] = { base=1},
["Archaeology"] = { base=1},
["Art"] = { sublabeling=true, base=5},
["Astronomy"] = { base=1},
["Bargain"] = { base=5},
["Biology"] = { base=1},
["Chemistry"] = { base=1},
["Climb"] = { base=40},

Trenloe
June 26th, 2017, 20:29
Because that section of the code is within a <script> tag, FG is running it as LUA. <!-- Added 06/26/2017 --> is not valid LUA. But, as it is also set within XML there are further requirements to use comments.

See the "Using scripts" section here: https://www.fantasygrounds.com/modguide/scripting.xcp In particular this line: The "--[[ ]]" comment syntax must be used instead of the "--" syntax

So use --[[Added 06/26/2017]]

But, you really should put scripts like this in their own .lua file. It's easier to debug, easier to comment code, etc..

LordEntrails
June 26th, 2017, 20:31
Hmm, I always put comments on their own line, but I don't know if that is needed. Your formatting is correct. Try removing or moving the comment to see if you still get an error on that line number.
EDIT: Doh! Ninja'd by the AI with the correct answer!