"Bin" expression

This forum is currently in read-only mode.
From the Asset Store
Add this awesome sound effects to make your visual novel come to life!
  • We have an "AppPath" expression, and it's really useful for loading external files.

    I propose a "Bin" expression for loading files stored as resources. Any files, whatever they may be (as long as it's a file that some object or construct itself can open).

    The idea came to me when I was thinking about the .mesh files exported by the mesh editor. I thought it may be possible to do a sort of frame-by-frame animation on a mesh by loading a series of .mesh files. I thought storing the .mesh files into the binary might be nice, but then there'd have to be a "Load mesh from resource" action, etc. Then it occurred to me that if you were allow the loading of files from binary, you'd have to add the "Load file from resource" action to all objects for whatever other file types, and that wouldn't really be necessary if you had a more general "Bin" type expression.

    It would also be useful for text files, .ini files, hell... even .jpgs or whatever else. Wherever you have to load a file, just use

    Bin "filename.ext"[/code:hfo4t2zi]
    
    Of course, this feature would have to come after the capability to use resources for more than just sounds.
  • That's a good idea, actually. How about calling it getfilename("resource name")? If it hadn't already, it'd just dump a resource to a temporary file and return that path.

  • I think dedicated actions make it a bit easier and have the advantage of being able to pick the resource. Submit it to the feature tracker.

  • That's a good idea, actually. How about calling it getfilename("resource name")? If it hadn't already, it'd just dump a resource to a temporary file and return that path.

    If not "Bin" then how about getResource("name.ext")? getfilename might be a bit confusing, as folks might think they're getting an actual external file. Might as well call a spade a spade.

    Submit it to the feature tracker.

    Okay, will do.

    E: Done

  • Possibly better called 'fileresource', as there are several types of resources.

  • That's true, I didn't think about that. I think it needs a nice, snappy name like AppPath, though. Something short, sweet, and to the point.

    "BinFile" or "ResFile" or maybe "Banana"

  • FileRes sounds like a good one.

  • Binfile is a good name for it.

  • Inc for included

    Incfile?

  • Why BinFile? Not every file is binary. Every file is a file .

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Why BinFile? Not every file is binary. Every file is a file .

    Because it's a file packed in the binary. "Binary" being another word for "executable computer file."

  • LoadResource

    BinLoad

    BinLaden?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)