NewsUnrealEdFilesModsFragBULiandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 22nd Jun 2008, 06:33 PM   #1
AJRAD
{[RTW]} Leader
 
AJRAD's Avatar
 
Join Date: Sep. 27th, 2005
Location: you tell me
Posts: 37
Reading from files

Ok... another dodgy area.
Yep I searched the wiki and the whole internets for like 2 hours and I've found nowt.
So...

Is there a built in way that I can read a text file into unrealscript as a string so I can do further stuff to it?
Like.. the file would be on the server in the system folder, I just want ut2004 to read it and put the contents in a variable.

I was thinking of just writing a quick C++ function to do it natively but the mod this is a part of needs to be downloadable by clients, and I don't think DLLs are downloaded (are they?)

Thanks in advance for any help at all.
AJRAD is offline   Reply With Quote
Old 22nd Jun 2008, 06:36 PM   #2
Angel_Mapper
Noblesse Oblige
 
Angel_Mapper's Avatar
 
Join Date: Jun. 17th, 2001
Location: Cape Suzette
Posts: 3,524
Just use an ini file and a config var.

ini would look like this:

[MyPackage.MyClass]
SomeString=Hello


class like this:

var config string SomeString;
Angel_Mapper is offline   Reply With Quote
Old 22nd Jun 2008, 07:10 PM   #3
AJRAD
{[RTW]} Leader
 
AJRAD's Avatar
 
Join Date: Sep. 27th, 2005
Location: you tell me
Posts: 37
Yep I know about inis, its just that I've already written a script that procsses the file my way, and I need to load it in unrealscript so I can send it to my webserver (using LibHTTP and I've got that bit working btw).
AJRAD is offline   Reply With Quote
Old 22nd Jun 2008, 07:15 PM   #4
Angel_Mapper
Noblesse Oblige
 
Angel_Mapper's Avatar
 
Join Date: Jun. 17th, 2001
Location: Cape Suzette
Posts: 3,524
There's no way to read from text files, so you're going to have to use ini files.
Angel_Mapper is offline   Reply With Quote
Old 22nd Jun 2008, 07:21 PM   #5
AJRAD
{[RTW]} Leader
 
AJRAD's Avatar
 
Join Date: Sep. 27th, 2005
Location: you tell me
Posts: 37
Mhm.. fine. It sucks but I suppose if you say its impossible it is. Thanks anyway
AJRAD is offline   Reply With Quote
Old 23rd Jun 2008, 08:11 PM   #6
Continuum
Lobotomistician
 
Continuum's Avatar
 
Join Date: Jul. 24th, 2005
Location: Boise
Posts: 1,305
You could create a listen/server socket (apache/http would probably have quite a bit of overhead in the http response but could probably work as well) in an external application and use the TCP client to make calls / receive the response stream (the text of your file). A bit more involved than just reading in a file but definatley doable, guess it depends on how efficient it needs to be also. It may be more efficient to process the file outside uscript.

http://wiki.beyondunreal.com/Legacy:...g_A_TCP_Client
__________________

I bet they have a dead bird stuck in there somewhere in between furniture. They're so ****ing dumb.
Continuum is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:34 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer