Warcraft III resources & community, 2003–2006 · archived

File Reader

10 posts
#1

File Reader

I need a JASS Trigger that will read an imported text document, starting with the first record, assign that record to a string, text message that string to all players, and then move on to the next record, I want this loop to continue until it has text messaged all of the records in the text document with a 5 second delay between each message

I then also need a trigger that does the same thing, but with fields

Is this possible and how would I do it ?
#2
Import the txt file as war3map.wts, then do things like

TRIGSTR_101
{
"hello"
}

or something like that. The only problem with this is that it will overwrite all the strings attached to the objects you have with these strings >.>
#3
why cant I just add a new mpq file to keep all of the strings in ?

this map has no other purpose than to read text to people, but I don’t want to have to write 5,000 text message triggers, I would rather just insert all of the text into a file for it to read
#4
if youre not displaying ANYTHING else using custom strings, just look at the format of the war3map.wts file and write it out like that.
#5
but that means I would have to put 70 pages of text into that format, it would be allot easier to get a trigger that reads it for me
#6
Well, if you want to do anything, you'll have to do it that way or the standard way.
#7
There is no "have to"

if a map's mpq files can get informatio from each other in WCIII, then then it shold be posibe to have a trigger that extracts text from an imported mpq file and puts it into a string varible
#8
If the MPQ was read by JASS, of course.
#9
Ah, do not forget: JASS is a script language.
Many things you can do with a real language like C++ are not possible with JASS.
FileReader is a class of Java... Using it with an InputStreamReader allows you to read text out of files... But this is not Java - and so maybe there is a "have to".

That is the charme of script languages - try to do something without having the right tools to do it.

There may be ways to do it:
First, try what happens if you simply rename your textfile without changing the format.
Does it work? Good. Does it do not? Well... That means hard work.
But hey - I do not know what you need a map for, which just displays seventy pages of text to the player, but if it is not just something stupid, I guess, it will be worth the work.
... Or it may not be important enough for that... But is it important anyway then?
#10
so, JASS can not connect to an imported file and process it sequentially ?

and it does not matter to me what the name of the file is, I am willing to name my file anything that will work and sacrifice any other files in the process