Author Topic: Moving an Image  (Read 1023 times)

Is it possible to move or copy images through script?
I tried reading an image and copying the code, but that didn't seem to work. Any help?

For what reason do you need to copy or even move an "image"?

For what reason do you need to copy or even move an "image"?
Organizing your screenshots into folders in-game or copying a photo from a mod into the screenshots folder and just general know-how.
« Last Edit: July 31, 2010, 03:20:42 PM by lilboarder32 »

Not sure it can be done. I could imagining opening a image as a text file, saving it like a buffer, then outputting it elsewhere in the same filetype. But I bet there would be some major problems with that.

Well is Ephi ever makes that backup system, you can check that.
He said it would backup saves and screenshots.

Well is Ephi ever makes that backup system, you can check that.
He said it would backup saves and screenshots.
I think that involves storing it online by posting binary code to the site or something. Well I'm pretty sure that's how he handled screenshots in the Mod Manager.

I know it's possible to move and copy files with ascii encoding. (normal text like characters)
Just google "torquescript binary file io" or something like that.

I know it's possible to move and copy files with ascii encoding. (normal text like characters)
Just google "torquescript binary file io" or something like that.
I tried that and came up with nothing. They all just come up with basic file object methods. I think I need to know how to save the image as a buffer like MegaScientifical said. Any thoughts?
« Last Edit: August 02, 2010, 12:37:18 PM by lilboarder32 »

Well, referencing buffer like objects that connect to the internet. I'd take the stupid way, and probably ruin the game.

fileCopy(source, destination) ?

fileCopy(source, destination) ?

Wow, that really exists? That seemed WAAAY too straightforward and obvious to be considered. o_o

fileCopy(source, destination) ?
No, I tried that right away. It doesn't actually copy it.

Works fine for me. Are you sure you're typing the right things in?

Works fine for me. Are you sure you're typing the right things in?
I was hoping you'd say that. I'll have to try again. I tried before fileCopy("screenshots/ACMCity.jpg","screenshots/ACM/ACMCity.jpg"); as a test and nothing seemed to happen. I tried doing that same thing, but with apostraphes instead of quotes and it echoed something like "file 124 not found". How did you do it?

The command will not create destination directories. You'll have to make those yourself and then copy the file.