I’m thinking this probably isn’t difficult, I just don’t know how to do it.
I want to add a text adventure engine onto my website. The engine is Cycon Online Gaming Engine. I don’t know anything about Java, other than it’s a programming language.
There’s a download page. I’ve downloaded the .jar file (I’m not quite sure I understand what that is, mind you). I’ve downloaded the data file. But I can’t download the Engine files (which are all .class files, I think) as they’re not available compiled.
Do I not need those additional files if have the .jar file? I’ve put the .jar file and the data files onto my site at hhop.godsandartists.com, along with an index file that includes the applet. It won’t work.
Assuming that the software even works (it seems to on his site), what have I done wrong? Am I just missing the .class files? How do I compile them from the available source files, if that’s what I have to do?
You don’t need to get the class file, it’s in the jar file(jar files are essentially a bunch of class files in a zip file) Try adding the attribute codebase="." to the applet tag.
java.lang.NoClassDefFoundError: GameInfoOBJ
at CogEngine.init(CogEngine.java:151)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
First thing I would suggest you do is temporarily rename the jar file to “.zip”. If it was Foo.jar, rename it to Foo.zip.
Windows XP (assuming that’s what you’re using) will then happily open it and show you the contents. If not, use your favorite Zip utility to browse it.
Somewhere within that jar file should be GameInfoOBJ.class. Do you see it?
DarrenS, I looked into the .jar file and I didn’t find a GameInfoOBJ file. That’s going to be a key problem, isn’t it. Since that is the file that the error message said it was looking for?
DarrenS, I looked into the .jar file and I didn’t find a GameInfoOBJ file. That’s going to be a key problem, isn’t it. Since that is the file that the error message said it was looking for?
I suppose I’m getting all messed up because of the different versions and different archives.
I’ve downloaded the Cycon Odyssey 0.98.2 files and the readme says that it is for development version 1.1.6 (rather than the “stable” version). So that’s why I downloaded the .jar file for 1.1.6. I looked into the .jar file and didn’t see the GameInfoOBJ.class file. Odyssey 0.98.1 says its for ver 1.1.3, which doesn’t appear to be available.
Also, the instructions for installation that you put up say to point the browser to the CogEngine.html file. But there’s no such file in the CogEngine-1.0-classes.tgz file. I guess that means I have to create it, but I’m not sure how to write it. I stole the source for his games page and it points to the .jar file on his site, which is why I’ve tried to set mine up in a similar way.
I could try the 0.98.2 file with the 1.0 engine, but I’m not sure how to write the code to insert the applet if there’s no .jar file.
Sorry if this is getting a bit bunged up. I was hoping it would be quicker and easier than this so as not to require too much time.
As usual with open source stuff, it assumes you’re a developer; it’s a lot more hands on than you might be used to.
I dug a bit deeper, and even got as far as creating an HTML page with a vald applet tag, that loads the sample database. However, the applet is then throwing an exception. I think it’s because, looking at the source, it doesn’t seem to like the format of the CyconOdyssey.dat file - it’s trying to import it into a Java object and getting a “ClassCastException”. I don’t have time to dig any further right now, but I’ll paste the HTML I came up with in case you want to try. Also, you might want to try emailing the author on SourceForge.
<applet codebase="." code="CogEngine.class" archive="CogEngine-1.1.6-Jython_Applet.jar" width="648" height="480" align="center">
<param name="DatabaseFilename" value="CyconOdyssey.dat">
<hr>
If you were using a Java-enabled browser you would see the applet.
<hr>
</applet>
I’ve e-mailed the author and he has said he hasn’t worked on it for a long time, but will try to recall how it all works and get back to me. Hopefully that will yield positive results. Thanks again!