Page 1 of 2
[Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 24 Nov 2011, 17:06
by seeba
A short while ago, I tried to include a library (only for testing purpose) in a manialink-maniascript. I simply took the example Gugli
posted in the syntax basics.
I saved the script in the folder of the xml-file as well as in the \Maniaplanet\Scripts\-folder in my documents. Also, I tried both complete paths and relative ones, as well as only the name... None worked, all it said was:
[SCRIPT] ERROR (line:3 column:32) Include "LibName" was not found.
Script compilation failed.
Is this only possible in editor-scripts? For I saw in the AutoGen-script that they should work...
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 24 Nov 2011, 19:44
by gouxim
What code did you write to include your Lib?
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 24 Nov 2011, 20:29
by seeba
I tried:
#Include "TimeLib" as TimeLib
as well as
#Include "TimeLib.Script.txt" as TimeLib
as well as
as well as
#Include "./TimeLib.Script.txt" as TimeLib
None of them worked.
My xampp was activated and the index.php was in the same folder as the TimeLib.Script.txt...
I even copied the file directly into the ManiaPlanet\Scripts\-folder with the same result...
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 24 Nov 2011, 21:11
by konte
seeba wrote:#Include "./TimeLib.Script.txt" as TimeLib
In an example code, I have this one working ... (but I think the second one works, too). Did you restart TM when testing it?
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 24 Nov 2011, 22:48
by seeba
I think I did not... I will test it again, thank you konte
Very odd indeed if it's going to work^^
I will edit the result inside of this post
Edit:
It still doesn't work. I restarted TM, uploaded it to a proper server, tried it in the \ManiaPlanet\Media\Manialinks\-folder. I'm kind of clueless now...
Code: [noparse]
http://destroflyer.mania-community.de/o ... /index.php[/noparse]
[noparse]
http://destroflyer.mania-community.de/o ... Script.txt[/noparse]
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 25 Nov 2011, 11:33
by gouxim
I asked Gugli about HTTP includes a couple weeks ago, it does not work for now.
Did you try
Code: Select all
#Include "TimeLib.Script.txt" as TimeLib
while putting TimeLib.Script.txt at the
root of your Maniaplanet folder in your documents?
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 25 Nov 2011, 16:07
by seeba
I did not, but I will at once and tell you
Edit: Not working, I've tried to put the file directly into the folder C:\Users\seeba\Documents\ManiaPlanet\ ...
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 25 Nov 2011, 18:03
by konte
I tried it again, and apparently it doesn't work for Manialinks :/
(well, Includes in Manialinks would only make sense with HTTP requests anyway...)
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 25 Nov 2011, 18:19
by seeba
You're right Konte, and thanks for testing by the way
Edit: However, I don't quite understand the technical difference between the <include> of Manialinks and the #Include of Maniascript.
(I do understand the difference concerning their functions
)
Technically, both should work pretty equally, or is there a huge difference?
Re: [Bug?] Custom Libs not working in Manialink-Maniascript
Posted: 25 Nov 2011, 18:22
by gouxim
seeba wrote:However, I don't quite understand the difference between the <include> of Manialinks and the #Include of Maniascript. Technically, both should work pretty equally, or is there a huge difference?
I remember Gugli told me the problem was that #Include are done at ManiaScript compil time, and waiting for the HTTP request (which are SsssslLLLloooOWWWwwwwww) was difficult .
<include> are different because it's not about ManiaScript and compilation, it's just a manialink stuff ; the internals are very different and this feature has been around for a long time.
By the way, for manialib, we use and <include> to require it easilly on every page (and the manialib.xml file contains a <script> tag)