https://dl.dropboxusercontent.com/u/381 ... tility.xml
And why are there no useful error messages for people trying to create libraries?
Why does this Library not load?
- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
line 139 has a missing parenthesis at the end of the line.
line 149 has a missing parenthesis at the end of the line.
line 179 has a missing parenthesis at the end of the line. (setq angle (add (item configList repeat) fireAngle) should be (setq angle (add (item configList repeat) fireAngle))
line 274 has a "(block nil)" while it should be "(block nil"
I made a paste with the modifications:
http://paste.neurohack.com/view/Y8nmx/
line 149 has a missing parenthesis at the end of the line.
line 179 has a missing parenthesis at the end of the line. (setq angle (add (item configList repeat) fireAngle) should be (setq angle (add (item configList repeat) fireAngle))
line 274 has a "(block nil)" while it should be "(block nil"
I made a paste with the modifications:
http://paste.neurohack.com/view/Y8nmx/
-
- Developer
- Posts: 2997
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
When I tried it, I at least got a useless error:
1. I copied the library to Extensions
2. I added a reference to it from SomeExtension.xml (e.g., <Library unid="0xDA7AE000"/>)
3. On load I got: "Line 286: = expected"
The problem, I believe is that the code in <Globals> has embedded tags. E.g., on line 286 it reads:
The <OnUpdate and <OnFireWeapon> comments are using XML tags, which are confusing the parser (because the XML parser doesn't know about TLisp comments).
The easiest solution is to wrap the whole thing in a CDATA block:
A better fix is to have the game automatically assume that <Globals> is a CDATA block.
1. I copied the library to Extensions
2. I added a reference to it from SomeExtension.xml (e.g., <Library unid="0xDA7AE000"/>)
3. On load I got: "Line 286: = expected"
The problem, I believe is that the code in <Globals> has embedded tags. E.g., on line 286 it reads:
Code: Select all
; Use in <OnUpdate with AU_AmmoBoxHandler in <OnFireWeapon>
The easiest solution is to wrap the whole thing in a CDATA block:
Code: Select all
<Globals>
<![CDATA[
....
]]>
</Globals>
- digdug
- Fleet Admiral
- Posts: 2620
- Joined: Mon Oct 29, 2007 9:23 pm
- Location: Decoding hieroglyphics on Tan-Ru-Dorem
oh, wow, didn't notice that at all.The <OnUpdate and <OnFireWeapon> comments are using XML tags, which are confusing the parser (because the XML parser doesn't know about TLisp comments).
I better make sure not to use <> into any comments in my Globals.
George's <![CDATA[]]> solution lets me at least start getting actual error messages.digdug wrote:oh, wow, didn't notice that at all.The <OnUpdate and <OnFireWeapon> comments are using XML tags, which are confusing the parser (because the XML parser doesn't know about TLisp comments).
I better make sure not to use <> into any comments in my Globals.
Literally is the new Figuratively
-
- Developer
- Posts: 2997
- Joined: Thu Jul 24, 2003 9:53 pm
- Contact:
Ugh--I forgot about that.pixelfck wrote:Unfortunately, the <![CDATA[ ... ]]> solution is not without flaw. When enclosing you tLisp code in a CDATA-block, the parser does not correctly parse &foo; entities
~Pixelfck
I honestly will never understand, why would anyone comment like this:
When you can use:
Code: Select all
; this is a comment, and devious potential bug if white-spacing isn't correct
Code: Select all
<!-- Anything between these marks is ignored by the XML parser -->
Fiction is reality, simplified for mass consumption.
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
PGP: 0x940707ED, 5DB8 4CB4 1EF5 E987 18A0 CD99 3554 3C13 9407 07ED
Bitcoin: 1LLDr7pnZDjXVT5mMDrkqRKkAPByPCQiXQ
; comments only comment out anything that is behind them, and on the same line.
<!-- --> comments will comment out everything between the first set of symbols, and the second. This has a few minor disadvantage: Every time you type it down, the code editor will, if it have highlighting features, highlight the WHOLE file starting from the <!-- to the end. Another disadvantage is that if you forget to type in the --> at the end of your comment, it can take a chunk of your code as comments as well.
To put it shortly, the ; comment is more specific and easier to control, and the <!-- --> is for longer comments spanning multiple lines, but is harder to control.
<!-- --> comments will comment out everything between the first set of symbols, and the second. This has a few minor disadvantage: Every time you type it down, the code editor will, if it have highlighting features, highlight the WHOLE file starting from the <!-- to the end. Another disadvantage is that if you forget to type in the --> at the end of your comment, it can take a chunk of your code as comments as well.
To put it shortly, the ; comment is more specific and easier to control, and the <!-- --> is for longer comments spanning multiple lines, but is harder to control.
Yes, look at my avatar, I have a wyvera type ship.