PDA

View Full Version : Arrgh! Script Module Problem



Foen
August 5th, 2008, 17:59
I have created a script module, which will eventually be used to supplement the Notes list functionality. However, whenever it loads I get the error:

Script Error: [string "scripts/notemanager.lua"]:1: unexpected symbol near 'ï'

Note that the 'ï' symbol is not the letter I, but something similar with two dots over it.

At this stage the script file is trivial:



notenode = nil;

function onInit()
notenode = nil;
end


The code in base.xml is:


<script name="NoteManager" file="scripts/notemanager.lua" />


I guess the problem is some control character (such as a wayward ctrl-z) but I can't see how to get rid of it.

Any help please?

Cheers

Stuart

Foen
August 5th, 2008, 18:03
Never mind, I over-came the problem by copying an existing script file and replacing its contents with the above.

May be something to do with file termination characters.

Stuart

Sorontar
August 5th, 2008, 18:08
Glad I could help :D

Foen
August 5th, 2008, 18:10
Always knew I could rely on your support, Sorontar. And so timely too :D

Sorontar
August 5th, 2008, 18:11
Well if you're gonna be like that, you can do it yourself next time ;)

Spyke
August 5th, 2008, 18:22
Wow, Sorontar, you just fixed my issue and I hadn't even posted it! :D

Spyke

Griogre
August 5th, 2008, 19:00
He's like that. :p

Oberoten
August 6th, 2008, 00:05
He even made my Wiki work... without even LOOKING at it!!!

MeepoSose
August 26th, 2009, 03:26
It looks like the problem is the encoding used for the file. When I create a new text file in VS2008 for a lua script, it sets the default file encoding to Unicode. FG is expecting the file to be encoded as Western European (Windows) Codeset 1252.

You can change the way the file saves with Visual Studio 2008 by opening the file in your IDE and selecting File | Advanced Save Options.



BTW, thanks for posting this thread. I thought I was doing something stupid.

Foen
August 26th, 2009, 06:12
Good spot!

Cheers

Stuart