User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Question about storing external images

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)

    Question about storing external images

    I work with some external map-images (.png) that are loaded to the surface-object on runtime. Is there a way to include external images into the .exe, so I can call them from the game's Apppath$ ? If I add them by using the installer they are exposed in the game's directory and editable for everyone, which is not what I want the player to do. Of course I could work around this by pre-baking the surface object with the needed images and build the app then, but as I do a lot of editing with external tools I find this workaround quite inconvinient for the development process and would love to avoid it. I did not find a possibility to add images using the "Data Elements" in Fusion's editor. Also added the images to the binary data, just to try, but that does not load with the built application.
    Thanks for your help!

  2. #2
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    417
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    You may try using an app like Thinstall. The "correct" purpose of it is to make portable versions of applications in a self-contained EXE, but it will also bake in all the files and DLLs in the program's folder to said EXE which includes the map data you've mentioned. This let you keep doing the thing you're doing now and once game is built, you can just run it through Thinstall to make it a single exe with no access to map pictures.

  3. #3
    Clicker Fusion 2.5Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    781
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    I havent used Surface extension but can't you add them as assets? I do this with arrays and text file and call on them with Apppath$, this way the player cant edit the txt files (that i use for loot tables) since they are embedded into the .exe.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the replies guys!
    @Darkhog: That software sounds very interesting, I'll check it out for sure, seems very handy and could solve my issue.
    @ zip2kx: Could you explain what you mean by "add them as assets". I know where to put binary data, but I've not found an option to add pictures to the games's "data elements". And as I said, if I add them by using the installer, they'll be exposed.

  5. #5
    Clicker Fusion 2.5Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    781
    Mentioned
    17 Post(s)
    Tagged
    0 Thread(s)
    If you go to Data Elements (button next to the event list editor), Binary Data and press add files you can add pictures. I just tried it out and used an Active Picture object to load the added image with Apppath$+"(imgname.jpg)". Seems to work as it's supposed to


  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    937
    Mentioned
    47 Post(s)
    Tagged
    0 Thread(s)
    Hmm, I had added the pictures there too but surface object was not able to load them, could be that you`re right and it is a flaw of this extension, but I'll double check this for sure. Maybe I just made a typo or something. Thanks for your help!

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    This is something I would be glad if someone could clarify,
    according to Fusion help file:


    • Binary file temporary filename retrieves the pathname of the temporary file for the specified embedded binary file. Parameter = full pathname of the binary file. Extract Binary File must be called before calling this expression. If Extract Binary File was not called or if the file was not found in the list of embedded binary files, then this function returns the pathname given as parameter without change.
    • Extract Binary File : extracts an embedded binary file to a temporary file. Embedded binary files are specified in the Binary Data tab of the Data Element editor. You must pass a full pathname as parameter, e.g. Apppath$ + "name_of_your_file". You can retrieve the pathname of the temporary file with the Binary File Temporary Pathname expression.
    • Release Binary File : deletes the temporary file for a given binary file. Same parameter as for the Extract Binary File action (full pathname of the binary file). Note: there is a use count, so if you call twice Extract File, the temporary file will be removed only after the second call to Release File.


    So theorically this should work:

    start of frame
    >>> (special conditions) extract binary file: "fullpath\filename.extension"
    >>>
    (surface object) load image from file: BinFileTempName$("fullpath\filename.extension")


    But, at least on another test computer I've checked it on, it doesn't work, and it does not seem a surface fault,
    because it's the BinFileTempName$("") which is returning the absolute path when launched on another machine (with WinXP),
    and that path is clearly not existing on the other machine.
    It's like the binary is not found or the function not called:


    If Extract Binary File was not called or if the file was not found in the list of embedded binary files,
    then this function returns the pathname given as parameter without change.

    Oddly enough, it does work on the computer I've built it on, because even if I delete the "source" file, the image shows,
    so it would indicate it correctly reads the embedded binary source,
    and in fact the BinFileTempName$ expression returns a temporary filename in the Appdata folder.

    I think it might the same issue Ryan was talking about in this thread:
    https://community.clickteam.com/threads/58595-Binary-Data-How-to-use-it-and-what-it-is?p=442034&viewfull=1#post442034

    Wonder if it's a Win7 vs WinXP issue, since I'm building in Windows7, like Ryan in that thread, or else if it's more widespread.
    Is anyone having this issue or did anyone got this working correctly - with/without Win7?
    (files built on one machine but then launched on another, to be 100% sure)

  8. #8
    Clicker Install Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Darkhog's Avatar
    Join Date
    Jan 2009
    Location
    /dev/null
    Posts
    417
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Don't even bother with the binary data. Even if you get the file name right, half of the time it failed to load properly, know from the experience. What would work best would be if you can tell where to extract the files yourself. Not only it would lessen the probability of bugs, because you could e.g. extract them to a static directory or Apppath$, but it also would mean you could easily create custom "fancy" installers (just hold all the stuff in the binary data and extract them to the install directory).

  9. #9
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,006
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Binary Data works by storing the binary in the compiled executable and you then tell Fusion to extract the file temporarily, you can then reference it using its filename you imported it with, this is stored internally. This file will remain extracted until you manually remove it from the hard drive using 'release binary'.

    I wrote a guide on using Binary here: http://download.clickteam.com/tutorials/en/binary-data.pdf - When you import a file into binary in Fusion, say the filename is "c:\test.ini" - this data is stored under a kind of label in the compiled app as "c:\test.ini" so you always call the file by using its name "c:\test.ini". When it is 'actually' extracted to the hard drive, it is given an obscure filename, which is why you use BinFileTempName$("c:\test.ini") you are retrieving the actual filename of the temporary file under the label "c:\test.ini".

    With regards to your issue Julian, Binary is a way forward, but can't you just simply 'Include external files'? The principal is the kinda the same. By checking 'Include External Files' in the App's properties, when you to a Compile, Fusion will gather all the files that are called externally and pack them up with the executable...
    Want to learn Clickteam Fusion 2.5?




  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    That's a very well laid and clear guide Danny,
    I think I was doing the same, but it doesn't work for me:

    start of frame
    >>> (special conditions) extract binary file: "fullpath\filename.extension"
    >>>
    (any object) reference file: BinFileTempName$("fullpath\filename.extension")


    when the app is launched on another machine
    BinFileTempName$("fullpath\filename.extension")
    returns the absolute pathname
    (the "binary data tag" in other words)
    and not the temporary flename

    I had noticed this issue a while back but never digged much into because I didn't really need to,
    and was thinking I was doing something wrong.

    Also, the (simpler) binary data procedure had worked perfectly fine in android for me in the past,
    so don't know if this might indicate it to be a Win(7?) related issue as Ryan was speculating in that post
    ...or if instead I'm still missing something

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Protect external videos and images
    By MEHRDAD in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 7th November 2014, 06:38 AM
  2. Recommendations for uploading and storing images in iOS app?
    By chris_o in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 14th November 2013, 07:43 AM
  3. objects and external images
    By Sambo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 2nd May 2012, 12:23 AM
  4. Questions about Storing External Data
    By Simion32 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 1st March 2007, 11:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •