Java Applets are pissing me off

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • evilbutterfly
    FFR Player
    • Apr 2003
    • 5784

    #1

    Java Applets are pissing me off

    So I'm making my game, and I decide to make an applet out of it so I can show you all. It loads in images and sounds just fine, but there's one huge problem.

    I can't load in simple ****ing text files. It says I don't have the permission to do it, even though the freaking things are in the same directory as the game, it's not like I'm trying to jack into the user's system and read their personal files. The text files are just files that tell the game which enemies to load in and when. I made it like that so I didn't have to hardcode the levels and so I could later make a level editor that creates these level files.

    So I ask you guys, do you know a way to load in text files for an applet? Like, say I hosted the game at ffr.com/myGame and I had the text files in that same folder with the game. Everything I can find on Google is overly complicated and doesn't even do what I need. -___-
    So I've gone completely slack-ass and haven't done any work on creating games. =(

    In less-depressing news, I got a job for an online business (which sells non-electronic games, of all things!) which has taught me a lot about marketing online and all that jazz.

    So now I'm on Twitter @NoahWright.
    And I write the blog for their website.

    Plus I do cool programming in-house that you'll never see. =O
  • DJSBX
    FFR Music Producers
    FFR Music Producer
    • Oct 2003
    • 514

    #2
    Re: Java Applets are pissing me off

    make sure that the correct permissions are set. Like make sure the file is accessalble or editable or whatever you need. (i.e. CHMOD 775)


    Check Out My website!
    http://www.djsbx.com

    Comment

    • evilbutterfly
      FFR Player
      • Apr 2003
      • 5784

      #3
      Re: Java Applets are pissing me off

      See that might be important but I'm not on Linux. There's no way for me to make the files any more accessible than they already are.

      =\
      So I've gone completely slack-ass and haven't done any work on creating games. =(

      In less-depressing news, I got a job for an online business (which sells non-electronic games, of all things!) which has taught me a lot about marketing online and all that jazz.

      So now I'm on Twitter @NoahWright.
      And I write the blog for their website.

      Plus I do cool programming in-house that you'll never see. =O

      Comment

      • taifunbrowser
        FFR Player
        • Jul 2006
        • 33

        #4
        Re: Java Applets are pissing me off

        eh? if you load the .txt files by the URL class and have full path (i.e., can't be relative, has to be http://mydomain/mysubdirectory/myfile.txt), then applets CAN'T stop you from loading it.

        You probably just tried to load them as files, when now that you're on a webserver you have to treat them all like urls.

        edit: also, you can store .txt files in .jar files, theres tutorials on that too. (to get them out, I think its ClassName.GetClassLoader.GetResource("resourcename")), but thats very rough so look up a better tutorial first

        Comment

        Working...