Gothic Online Forums
File Loader v1.0 - Printable Version

+- Gothic Online Forums (https://archive.gothic-online.com)
+-- Forum: Scripting (English) (https://archive.gothic-online.com/forum-11.html)
+--- Forum: Resources (https://archive.gothic-online.com/forum-14.html)
+---- Forum: Modules (https://archive.gothic-online.com/forum-32.html)
+---- Thread: File Loader v1.0 (/thread-9.html)

Pages: 1 2


RE: File Loader v0.3 - HammelGammel - 23.12.2015

Now I'm unsure how much work this would be. But would it be possible to correct this, Nubzior?


RE: File Loader v0.4 - Nubzior - 12.01.2016

Updated! New version in first post. Remember, its only for Linux now, i want to see if crashes still happens with long strings. HammelGammel can u confirm?


RE: File Loader v0.4 - HammelGammel - 12.01.2016

That's a little hard to test for me, since I'm using windows Big Grin


RE: File Loader v0.4 - Nubzior - 14.01.2016

Ok, version 4 is released, links are in first post. Changes? Fixed readFile function.


RE: File Loader v0.4 - HammelGammel - 14.01.2016

First the good message: Just printing the buffer prints out the full lines now!

Unfortunately it seems now I'm having a few more problems with the fileloader Big Grin

First of all formatting the string still crashes and concatenation still cuts the string down to 4 letters. buffer.len() will always return 4 btw, even if print(buffer) prints a much much longer string. While string.find works perfectly fine, string.slice gives me "slice out of range", even though I know that the slice is fine. It seems to think that the string only has 4 letters. In this specific example the line in question has about 20 letters: string.find returns me 7. So far so good. But a slice from 0 to 7 is "out of range", and buffer.len() gives me 4. This is really interesting. How can this happen? It seems to be just a normal string (At least type()) tells me so, but something must be different with the string fileRead gives me.

Also fileClose gives me extremely weird errors (When it doesn't crash, which most of the time it does) in another file, that just blatantly don't make any sense at all: "Error runtime: the index '_PORTALTEMPEL_RITUAL_04;NW_TROLLAREA_PORTALTEMPEL_' does not exist". The string from the errormessage is a seemingly random part (Not a full line) from the file I am reading in an entirely different part of the code. Removing fileClose fixes it, but I'm assuming it's not a good thing to not close the file.

EDIT: Well, most of the time removing fileClose fixes it O.o But not always... It's kind of random. When using fileClose it always happens though.
Any ideas what I can do? I could really use some way of reading files, and long lines still cause all kinds of problems for me unfortunately.


RE: File Loader v0.4 - Nubzior - 30.01.2016

New version will be released soon


RE: File Loader v0.4 - HammelGammel - 30.01.2016

That's very good news Big Grin Thank you


RE: File Loader v0.4 - Nubzior - 09.02.2016

<cenura>

Edit
New version released, there is some changes of reading file, jump to first post to see example.


RE: File Loader v1.0 - HammelGammel - 09.02.2016

It works! Big Grin Thank you so much.


RE: File Loader v1.0 - Nubzior - 09.02.2016

You're welcome
<cenzura>

UPDATE
fixed bug with strings with space.