Welcome to Phrogram Sign in | Join | Help
in Search


Trouble accessing my 2D images

Last post 05-12-2008, 11:00 AM by christmaswhistler. 9 replies.
Sort Posts: Previous Next
  •  05-03-2008, 8:18 PM 6618

    Trouble accessing my 2D images

    Hi

    I am extremely new to programming. I am having trouble getting the UFO image to show when I run the program below or any other program using sprites/images.

    Program UFO

    UFO

    Method Main()

    Define MySprite As Sprite

    Define MySprite As Sprite

    MySprite.Load( "Ufo.gif")

    MySprite.MoveTo (200,200)[this is line 5}

    MySprite.Show()

    End Method

    End Program

     When I run the program, a message returns as "Runtime error on line 5 in file UFO.kpl: The image file 'ufo.gif' could not be found".

    I am having trouble finding the 2D images I downloaded.  Can someone tell me how to do so. How do I get the images to show up in Picture Browser? Should the images be saved in My Pictures or in my Phrogram files. I absolutely have no idea how to do it.

     Thanks

    "Ufo.gif")

    MySprite.MoveTo (200,200)[this is line 5}

    MySprite.Show()

    End Method

    End Program

     When I run the program, a message returns as "Runtime error on line 5 in file UFO.kpl: The image file 'ufo.gif' could not be found".

    I am having trouble finding the 2D images I downloaded.  Can someone tell me how to do so. How do I get the images to show up in Picture Browser? Should the images be saved in My Pictures or in my Phrogram files. I absolutely have no idea how to do it.

     Thanks

    End Method

    End Program

     When I run the program, a message returns as "Runtime error on line 5 in file UFO.kpl: The image file 'ufo.gif' could not be found".

    I am having trouble finding the 2D images I downloaded.  Can someone tell me how to do so. How do I get the images to show up in Picture Browser? Should the images be saved in My Pictures or in my Phrogram files. I absolutely have no idea how to do it.

     Thanks


    Tracey Laweloa
  •  05-05-2008, 9:01 AM 6619 in reply to 6618

    Re: Trouble accessing my 2D images

    tracey,

    Howdy.  I place my image files in a subdirectory called \bin underneath the parent directory where the Phrogram program resides.  So, an example is in order.  If your program "UFO" is located in:

    C:\Documents and Settings\Administrator\My Documents\My Phrogram Files\UFOdir

    Then, you should place the image files in the \bin subdirectory such as:

    C:\Documents and Settings\Administrator\My Documents\My Phrogram Files\UFOdir\bin

    If you have downloaded some files... and cannot find them now might I suggest:

    a) If you can remember their names - use Windows Explorer's search feature to find the files.  Note the directory they are in.

    b) Download the files again - but this time place them into the \bin subdirectory you need them in.

    Regards,


    ChristmasWhistler
    http://www.christmaswhistler.com
    (\ _/)
    (- . -) This is bunneh. Copy and paste him to
    (")-(") your signature, so that he may gain popularity and eventually rule the world
  •  05-05-2008, 9:53 AM 6620 in reply to 6619

    Re: Trouble accessing my 2D images

    Phrogram should be able to find images if they are in

    1) the Media Files directory

    2) the same directory as you .kpl file

    3) the /bin directory for your file. However in general I would not recommend placing them there. the /bin folder is really jsut a temporary folder that we make to compile to programs in.

    In addition you can give a full file path "c:\something\something\ufo.gif" - but remember this might not work on other peoples computers.

     


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  05-07-2008, 9:24 AM 6631 in reply to 6620

    Re: Trouble accessing my 2D images

    ZMan,

    Thanks for the added information.  I remember my thinking a long time ago when I placed my first file for I/O in \bin... "Hey, it works!  Later I will figure out what is the best solution."  I guess it is later now (smile).

    I do indeed keep the (what could be) hundreds of supporting files in the /bin subdirectory for my Boo! Phrogram... as I wanted to "hide" the mass of files in a subdirectory.  Is there a way to open and read or write a file that is in a subdirectory under the directory that holds the .kpl Phrogram file... other than the explicit full file path you offered above? 

    That is, relative to the directory that holds the .kpl file?

    Assuming the .kpl file is in the parent directory:

    C:\something\UFOdir

    I would like to find the file:

    C:\something\UFOdir\SupportFiles\UFO.GIF

    ??? Maybe with the syntax such as ???

    FileExists ( "..\SupportFiles\UFO.GIF" )

    Regards,


    ChristmasWhistler
    http://www.christmaswhistler.com
    (\ _/)
    (- . -) This is bunneh. Copy and paste him to
    (")-(") your signature, so that he may gain popularity and eventually rule the world
  •  05-07-2008, 12:09 PM 6632 in reply to 6631

    Re: Trouble accessing my 2D images

    We certainly need to do some thinging around what happens when people provide thier own content. The original thoughts were always that people learning would use the assets we provided.

    The only recognition we provide for your own assets is when you build a stanalone exe - we ask what your assets are.

    Seems like what we really need is a way to group your program with your assets.

    How about in a future version the .phrogram (yes we will change it next time) file is NOT a text file but actually a renamed ZIP.

    Inside the ZIP is your source code text file and a folder with all of your assets. You would add the assets into Phrogram through the IDE. We would know where to look and also people could actually email all their source around in a single file.

    This does mean you couldn't open your source up with notepad though

    [Note: This discussion moved to a new thread http://phrogram.com/forums/thread/6646.aspx]


    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  05-07-2008, 3:22 PM 6633 in reply to 6632

    Re: Trouble accessing my 2D images

    ZMan,

    From your response I get the impression that I cannot open a file in a subdirectory without specifying the full and complete path.  Is that correct?

    Well, let me explain what my Phrogram does today.  It is a play-by-email game (all those fancy MMORGs are just a passing fad... play by e-mail is going to make a comeback!).  The program Boo! allows up to 15 players to plot what their character should do for the next turn.  This plot file is written to the \bin directory as a new text file.  That file would then be e-mailed as an attachment to the other (up to) 14 players.  On my system - I would receive the plot files for the other 14 players - and place them all in \bin.  When Boo! starts it automatically looks to the \bin directory for any new plot files.  It reads in all of them and updates a master game file of all the plot events.  When Boo! sees that all the plot files for a certain turn have been read in... then it allows the user to play that turn.

    Given the extremes: 15 players for 10 turns... this could see 150 files in the \bin directory for just one game.  A second game could have 150 more files, etc.

    Note: I *could* delete the plot file when I have finished reading it in... but that is not a high priority right now.

    In addition (if the above is not crazy enough for you) each player can customize the icon for their character and record WAV files saying "Boo!"  So, even though I will have "standard" images and WAV files for your use... I want to provide the ability for you to use your own files.

    If all those files were wrapped inside of a zip file - that would be too difficult for the average user to package correctly, me thinks.

    If all those files are in a single directory - same comment.  Very difficult for the average user to find the right file amoungst 100s to send to the other players after a turn has been plotted.

    So, maybe a hybrid of your idea and some flexibility that I need.  Static input resources could be identified and pointed to via the IDE.  These could be zipped up automatically for package distribution.  Items to go here would be static graphics, MRI (my name for all user read text) translations, sound files, etc.  Things you do not want the humans or program to change.

    And, the ability to open files that are programmatically determined in any subdirectory based upon the content of master configuration files or user input.  For example, the first question I ask the user is "What is the name of the game?"  I use this information to read in the master game file that contains *everything* known about the current game (all turns, events, and the names of other support files such as maps, player images, sound files, etc.).

    I will close by adding that I do not fully understand what you suggested above.  I am confused by the runtime only environment that I have grown up with using KPL/Phrogram.  Now that I have Standard and the ability to package and export... well I have this ability but have not played with it much so I do not fully appreciate (understand) your comments.  So, take my suggestions with a grain of salt.  Hopefully, I was able to express the complexity that I have - and you can adjust future versions of Phrogram to best fit the needs of the wider community.

    Regards,


    ChristmasWhistler
    http://www.christmaswhistler.com
    (\ _/)
    (- . -) This is bunneh. Copy and paste him to
    (")-(") your signature, so that he may gain popularity and eventually rule the world
  •  05-07-2008, 3:25 PM 6634 in reply to 6618

    Re: Trouble accessing my 2D images

    tracey,

    Sorry to highjack your thread.  Did you get your program to work using one of ZMan's suggestions?

    Regards,


    ChristmasWhistler
    http://www.christmaswhistler.com
    (\ _/)
    (- . -) This is bunneh. Copy and paste him to
    (")-(") your signature, so that he may gain popularity and eventually rule the world
  •  05-12-2008, 8:54 AM 6663 in reply to 6618

    Re: Trouble accessing my 2D images

    how do u write that?!?!!!!!!!!!!!!!!!!(- . -) copy and paste him he will rule!!!!!!!!!!!
    Filed under: , ,
  •  05-12-2008, 9:16 AM 6665 in reply to 6663

    Re: Trouble accessing my 2D images

    How do you do what? You need to be a little more clear in your emails to get good answers.
    Managed DirectX and XNA ? Check out http://www.thezbuffer.com
  •  05-12-2008, 11:00 AM 6668 in reply to 6663

    Re: Trouble accessing my 2D images

    Jj9595,

    To add the "bunneh" to your signature here in these forums...

    1) Make sure you are signed in to the Phrogram forums

    2) Copy the "bunney" text (highlight, then Ctrl-C) from my signature.

    3) In the upper right of the masthead you will see "Signed in as Jj9595".  Click on Jj9595.

    4) In the Signatures and bio tab - paste (Ctrl-V) the "bunneh" text.

    Regards,


    ChristmasWhistler
    http://www.christmaswhistler.com
    (\ _/)
    (- . -) This is bunneh. Copy and paste him to
    (")-(") your signature, so that he may gain popularity and eventually rule the world
View as RSS news feed in XML