The Daily Click ::. Forums ::. Klik Coding Help ::. Storing Active Pictures
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
10th November, 2013 at 10/11/2013 10:41:34 -

I'm wondering if there are any precautions I can take when using Active Pictures? I really don't like that they're stored externally, I keep getting the feeling that they may not be in the correct directory when other people play... Do the active pictures just need to be stored in the same directory as the executable? Would creating an installer be a good idea? (I'm guessing the built-in MMF installer option wouldn't also install Active Pictures to the correct location, would it?)

 
Image

Tell 'em Babs is 'ere...

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49567

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
10th November, 2013 at 10/11/2013 22:08:11 -

If they're stored in the same directory as the exe just reference them directly eg. "image.png"
If they're stored in a subfolder you should be able to do "sub\image.png"

Just zip everything together and you should be fine. Most people know to keep the files in the same directory.
If you're worried about it just use the file object or something to check if the files exist and show a message to the user if they don't.

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5815

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
10th November, 2013 at 10/11/2013 22:16:34 -

I think you can choose external files to be included in the executable somehow? It's something I've never dealt with, though, and I think you might end up having to manually select each file you'd want to include, which doesn't sound ideal.

You should be able to store everything in a subdirectory with some simple expression use. Of course, you can use apppath$ to get your game's drive and directory on the computer, (or appdrive$ + appdir$ if you somehow prefer that) and then add whatever data directory you want:

apppath$ + "data\file.dat"

Or however you want to do it.

You shouldn't need an installer, so long as you set up the directory structure properly within your zip, but you still might get people who, for reasons beyond me, will try to run games straight from the zip file, or else only extract the .exe file. To counteract this, you can put a simple initialization test somewhere at the beginning of the game (like the title screen, or even on its own frame), where you use the File Object to test if a particular file exists in your data directory, and if it doesn't, you display a message such as "please unzip all files before playing".


EDIT - dang, beaten!

Edited by Fifth

 
Go Moon!

nim



Registered
  17/05/2002
Points
  7233
11th November, 2013 at 11/11/2013 06:59:41 -

I would just put any external files in a subfolder and reference them with apppath$+"subfolder/filename.png" but if you want to learn about including binary data within your exe file then this article by LB will help: http://www.create-games.com/article.asp?id=2181

 
//

nim



Registered
  17/05/2002
Points
  7233
11th November, 2013 at 11/11/2013 07:03:09 -

Double post, sorry.

Any reason why you absolutely have to use the Active Picture object, by the way?

Edited by nim

 
//

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
11th November, 2013 at 11/11/2013 23:32:23 -

Thanks everyone, I didn't know about using "apppath$' so I think that should be good.

nim, I'd rather not be using active pictures - I asked a while ago about the best method of having a continuously scrolling background and foreground, and still have a large, scrolling frame. The main suggestion for this effect was to use Active Pictures. I originally tried with Actives, but I couldn't get them to continuously scroll like the Active Pictures do.

 
Image

Tell 'em Babs is 'ere...
   

Post Reply



 



Advertisement

Worth A Click