Hello,
is it possible to access a certain file on my harddrive every frame update?
Cheers,
Xergi
Hello,
is it possible to access a certain file on my harddrive every frame update?
Cheers,
Xergi
There is no real I/O support exposed in UnrealScript.
Also, you don't want to do something very slow like I/O every frame.
What are you trying to do?
Michiel 'El Muerte' Hendriks
Magicball Network - Little Big Adventure community
the Unreal Admin page - Unreal server administration
UnrealWiki - UnrealScript and UnrealEd wiki.
UnCodeX - powerful UnrealScript tool for programmers
I´m trying to get input data (maybe 16 bytes every frame) from a tracking application like max or vvvv into UDK.
Using TCP Socket access might work, but I´m looking into a more simple alternative to this.
-> vvvv writes data into a file on a ramdisk, UDK should read this data every few frames.
TCPLink is the only possible method. Because all files used by the engine (i.e. configuration files) are cached in memory. Thus updating those files as no effect in game. Also, passing the data through the TCPLink is much faster than using file i/o (even if using a ramdisk)
Michiel 'El Muerte' Hendriks
Magicball Network - Little Big Adventure community
the Unreal Admin page - Unreal server administration
UnrealWiki - UnrealScript and UnrealEd wiki.
UnCodeX - powerful UnrealScript tool for programmers
There is actually support for file writing! Although you are very stricted but its verly well possible using the FileWriter - class
source/**
* Copyright 1998-2009 Epic Games, Inc. All Rights Reserved.
*
* This is a simple class that allows for secure writing of output files from within Script. The directory to which it writes
* files is determined by the file type member variable.
*/
class FileWriter extends Info
native;
Visit Renegade-X
You could add a console command (e.g. named DoSomething) for retrieving the information, then externally modify a file in the Binaries folder, named ConsoleCommand.txt, like so:
DoSomething Data
Then ingame, call 'exec ConsoleCommand.txt' to retrieve the information in the file through the 'DoSomething' console command.
This will be very slow (especially for each tick), so you should use the TCPLink stuff instead.
I think what he is really trying to say is:
1.) Build a program listening for TCP inbound (I recommend using C# on windows, fast and easy development, also you could use any other programming language with a TCP interface). Here you can access a DB, File-System or any other resource you need.
2.) Implement a class extending from TCPLink communicating with your program you created in 1.) (this step goes in UScript)
3.) Create a (exec) function to call your class created in 2.) (also Uscript)
this should do it.
Visit Renegade-X
Well, no that's not quite what I meant, I didn't explain it very well I guess; describing again:
An external program can modify ConsoleCommand.txt with the data it wants to pass on to UScript, and ingame the script can call the command 'exec ConsoleCommand.txt' to grab the data inside ConsoleCommand.txt.
What happens when 'exec ConsoleCommand.txt' is called, is the game executes the information in that file as console commands, so you can route the data put in that file through a console command ingame, and grab it that way.
Does that actually work? I haven't seen anything about executing console commands like that.

Hey Shambler! Long time no hear. Good to see you're still around in the Unreal world.
This technique goes all the way back to the original Unreal Tournament. Haven't seen it used for quite some time.
http://wiki.beyondunreal.com/Legacy:...nsole_Commands
Hey Solid Snakeya I'm about, but not nearly as active.
fritzmonkey: Yea it works, though TCPLink is far more preferable.
Bookmarks