Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Read from file.... (https://forums.graalonline.com/forums/showthread.php?t=24766)

joseyisleet 02-28-2002 06:32 PM

Read from file....
 
-=Josey=-
It would be nice to have a function that would read text from a file (not like an npc). Something like:

NPC Code:

if (playertouchsme){
say2 filenamehere,toplinetostartwith,bottomlinetoendwit h;
}


It would be nice to have a function like this. Almost every programming engine has one. Like VB's:

NPC Code:

Private Sub Label_Click()
text1.text = app.Path & "/textfilhere.txt"
End Sub


This would be really handy. Just a suggestion though.

Cybnext_Design 02-28-2002 08:19 PM

Re: Read from file....
 
Quote:

Originally posted by joseyisleet
-=Josey=-
It would be nice to have a function that would read text from a file (not like an npc). Something like:

NPC Code:

if (playertouchsme){
say2 filenamehere,toplinetostartwith,bottomlinetoendwit h;
}


It would be nice to have a function like this. Almost every programming engine has one. Like VB's:

NPC Code:

Private Sub Label_Click()
text1.text = app.Path & "/textfilhere.txt"
End Sub


This would be really handy. Just a suggestion though.

I believe this is being implemented in the new version. And will be:

NPC Code:

say2 #txt(<textfilename>);


amonrabr 02-28-2002 09:04 PM

yap
 
and IT would be nice if we could use "resourcestring" like the translations that Stefan made.

joseyisleet 02-28-2002 09:04 PM

-=Josey=-
Yay! I've been thinking about that for a few weeks now, finally decided to post it. It'll be great for some new NPCs.

Saga2001 03-01-2002 01:09 AM

Quote:

Originally posted by joseyisleet
-=Josey=-
Yay! I've been thinking about that for a few weeks now, finally decided to post it. It'll be great for some new NPCs.

it would be really cool to be able to do like file read and output from there...and move the cursor in the file...but that would take a lot of coding...

Python523 03-01-2002 09:46 AM

Wouldn't using a txt file for a sign be as laggy as putnpc?

Tyhm 03-01-2002 09:57 AM

I think all signs should use pictographs, Mario Style, to instantly convey the information in all languages.

Barring that (hee hee), add a number to each sign indicating language. Default = Server language (if there is no language number), otherwise like 0=English, 1=French, 2=German, 3=Spanish, 4=Japanese (wow, that'd be hard...), etc. Then when making your levels, the Sign Editor defaults to your language, if you have someone to add the signs in other languages they can add Sign1-French: "Voulez-vous le nachos, dammit?" or whatever.
Touching a sign brings up the sign in your language. If it doesn't have an entry in your language, it brings up the sign in the server's default language. Say would act just like touching a sign, say2 would only work for the server default language, say3 language,text; would override it (if you encounter say3 and the language matches, skip the next say2 if it follows immediately/only seperated by other say3s)

Virtually useless on Classic though - I'd have to have someone redo every sign in every level...'cuz I sure ain't doin' it...maybe after I retire...could be good on multilingual servers though.

amonrabr 03-03-2002 07:53 AM

Or using like Delphi for ALL the strings,integers,flags,arrays....

if (playerenters){this.flag.LoadFromFile('\texts\a.tx t');}

or setstring flag,LoadFromFile('name.txt');

and to save:

flag.SaveToFile('name.txt');

Graal uses ShortStrings, so the txt file cant be bigger than 256bytes


All times are GMT +2. The time now is 10:43 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.