[Bug?] Custom Libs not working in Manialink-Maniascript

You can talk about ManiaScript for ManiaPlanet here

Moderator: English Moderator

User avatar
seeba
Posts: 255
Joined: 15 Jun 2010, 17:31
Contact:

[Bug?] Custom Libs not working in Manialink-Maniascript

Post 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...
Image
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post by gouxim »

What code did you write to include your Lib?
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
seeba
Posts: 255
Joined: 15 Jun 2010, 17:31
Contact:

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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...
Image
konte
Posts: 236
Joined: 15 Jun 2010, 12:36
Location: Germany

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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?
User avatar
seeba
Posts: 255
Joined: 15 Jun 2010, 17:31
Contact:

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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 :D

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]
Image
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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?
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
User avatar
seeba
Posts: 255
Joined: 15 Jun 2010, 17:31
Contact:

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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\ ...
Image
konte
Posts: 236
Joined: 15 Jun 2010, 12:36
Location: Germany

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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...)
User avatar
seeba
Posts: 255
Joined: 15 Jun 2010, 17:31
Contact:

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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?
Image
User avatar
gouxim
Nadeo
Nadeo
Posts: 1186
Joined: 14 Jun 2010, 17:20

Re: [Bug?] Custom Libs not working in Manialink-Maniascript

Post 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)
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)
Post Reply

Return to “ManiaScript”

Who is online

Users browsing this forum: No registered users and 0 guests