View Full Version : Hooptie Level Packages Clarified At Last
Pazolli
2002.05.05, 03:09 AM
If you download, compile and run the latest CVS code of Hooptie before you open the new "Additional Levels" directory. You might observe a surprise, hopefully there will be a single package there, with an icon named "Alan's Levels.hlvls". Open it up (using control-click "Show Package Contents") and inside you will find the level files consecutively numbered from "level1.txt" to "level4.txt" (and a CVS directory which is only there because you downloaded the file from the CVS - it need not appear in otherwise). This "file package" is what I meant when I previously referred to "document bundles". By developing an icon and making a few adjustments under the "Document Types" heading of the "Application Settings" pane of Hooptie's target, we finally have our new levels file. One that will hopefully be edited and saved to by Hooptie's editor, and one that will hopefully be loaded by Hooptie in the future.
So if anyone would like to complete the Custom Levels Loading (http://sourceforge.net/pm/task.php?func=detailtask&project_task_id=49878&group_id=31218&group_project_id=13463) task now that you have a sample of what you're meant to be loading, I would be extremely grateful. Please voice your interest below. That said there are a few important notes that I need to express:
[list=1]
In the past, this sort of bundling has been referred to as a "document bundle", rather it should be called a "file package". This correction may be more helpful when searching for help on Apple's Developer Site.
This format alone is all the Editor needs to save and load.
You can create a document such as "Alan's Levels" by simply creating a folder, dropping inside it the appropriate contents and appending the suffix ".hlvls" to it.
Note the choosen levels file suffix, ".hlvls"
[/list=1]
Hope this is useful and gets file packages off the back burner for the Editor,
Mark
DaFalcon
2002.05.05, 03:27 AM
I can certainly appreciate more now why this is a cocoa app, not carbon, and not being ported to Carbon/Classic. Seems this project is a learning experience for programming in OS X all around! Heck, if I had a copy of the Dev Tools CD (for some reason it didn't come with OS X with my mac) I might even poke around the code and try to learn some stuff :-)
I'm looking forward to being able to load level sets from within Hooptie, and I think that now I understand how to create a level set rather than just a set of text files. Cool.
Pazolli
2002.05.05, 03:40 AM
Hi DaFalcon,
Since you don't have a version of the Developer Tools I'll make sure to get you an Updater for the project, soonish (perhaps after we get the new Game Over screen up).
Mark.
P.S. All I believe is necessary for the new Game Over screen to be of shipping quality is making the "Game Over" text a bit more apparent/contrasting.
DaFalcon
2002.05.05, 05:43 AM
All I believe is necessary for the new Game Over screen to be of shipping quality is making the "Game Over" text a bit more apparent/contrasting.
Ah well, NOW you tell me :-) Just kidding, I'm glad to have taken the time to do more than just add more apparent text [see the 'Screens' thread for the final Game Over screen].
flipflop
2002.05.05, 01:22 PM
Originally posted by Pazolli
[B]If you download, compile and run the latest CVS code of Hooptie before you open the new "Additional Levels" directory. You might observe a surprise, hopefully there will be a single package there, with an icon named "Alan's Levels.hlvls".
I just updated my CVS code, compiled and ran the game. Unfortunately the package didn't work properly. That is to say "Alan's Levels.hlvls" still is a directory and not a package. I tried a reboot and a clean recompile but nothing has worked yet. I double checked the "Application Settings" and "Document Types" was updated with the right information...
Any ideas?
So if anyone would like to complete the Custom Levels Loading (http://sourceforge.net/pm/task.php?func=detailtask&project_task_id=49878&group_id=31218&group_project_id=13463) task now that you have a sample of what you're meant to be loading, I would be extremely grateful. Please voice your interest below. That said there are a few important notes that I need to express:
[list=1]
In the past, this sort of bundling has been referred to as a "document bundle", rather it should be called a "file package". This correction may be more helpful when searching for help on Apple's Developer Site.
This format alone is all the Editor needs to save and load.
You can create a document such as "Alan's Levels" by simply creating a folder, dropping inside it the appropriate contents and appending the suffix ".hlvls" to it.
Note the choosen levels file suffix, ".hlvls"
[/list=1]
Hope this is useful and gets file packages off the back burner for the Editor,
I was going to work on this once I get the basic editor up and running by (hopefully) next weekend. The weekend release will only save a simple level file the user types in -- nothing fancy like creating a file package. I already have a class interface defined, called LevelTools for encapsulating all of the level I/O and will include the ability to read a "file package" you define above. The hope is to create a class useable by both the level editor and the game. Please let me know if this is OK or if you need some code sooner than later.
Thanks for the update, this helps!
- John
Pazolli
2002.05.05, 07:27 PM
Originally posted by jnikolai
I just updated my CVS code, compiled and ran the game. Unfortunately the package didn't work properly. That is to say "Alan's Levels.hlvls" still is a directory and not a package. I tried a reboot and a clean recompile but nothing has worked yet. I double checked the "Application Settings" and "Document Types" was updated with the right information...
Any ideas?
Two, try dragging the ".hlvls" file from one directory to another and then back again. If that doesn't work, switch the document type settings to make Hooptie an "Editor" of the document (make sure you click the "Change" button, recompile and repeat the above process.
Pazolli
2002.05.07, 02:33 AM
Did either of those work? Has anyone got the level packages displaying right on their Mac?
flipflop
2002.05.07, 12:37 PM
Originally posted by Pazolli
Did either of those work? Has anyone got the level packages displaying right on their Mac?
I'm sorry but I tried both ways this morning and neither worked. Has anyone else got this to work?
- John
Kjurtyl
2002.05.07, 01:20 PM
Yes, I got mine displaying properly. I tried moving it from folder to folder and back, but that didn't work. What I did was change a few things on it under Get Info, like its locked status. Soon as I hit anything in there, it updated the file's icon to what it should be.
-Kjurtyl
flipflop
2002.05.09, 11:54 PM
Finally! What was the trick, you may ask. I just updated my CVS source tonight, recompiled and BAM! The icon changed! Yipee! My day is complete and I can now go to bed and sleep soundly :)
By the way, I like the new icons. Is that your doing DaFalcon?
- John
DaFalcon
2002.05.10, 12:35 AM
That *might* be my icon... I just made a set of icons for Hooptie based on my "H" logo I posted elsewhere on these forums. If it is a Hooptie-looking translucent package icon, then yeah, that's my doing :-) But Mark assigned it to me, otherwise I wouldn't have though of it. I didn't know it was already included, though :-)
flipflop
2002.05.10, 01:05 AM
Yep, those are the ones I see!
Great job! :)
Jealous because he can only draw sad looking stick figures,
- John
BobbyWatson
2002.05.10, 03:07 PM
None of the methods posted here worked for me, so here's what I did (the method isn't mine, it's the one described in Aaron Hillegass's excellent book, "Cocoa Programming for Mac OS X") :
-build Hooptie
-Grab the Hooptie.app file and drop it in your Applications folder
-Log out then log in
It worked for me. I also set the OS type to "hlvls", maybe that helped.
flipflop
2002.05.31, 01:12 PM
I'm close to finishing off 2 classes: LevelBundle and LevelFile which will handle the loading of level bundles (".hlvls" directories) and the underlying level files. The goal of these two classes are to make the loading and saving of bundles and level files standard between both the level editor and the game. I will submit the classes for approval before doing anything with the game code just to see if it worth the time and effort.
One concern I do have is loading the default levels stored in the game application. These classes currently do not inherently handle this and I was wondering if, when the game is released, the level files included in the application will be removed and put into a standard ".hlvls" directory.
Here is a run down of what the classes can do:
LevelBundle:
- Load all level files located in specified ".hlvls"
- Maintain which level is currently being played or edited
- Get the current, next, or requested level
- Create a new bundle
LevelFile
- Return map data as an 2D array
- Get and set all level properties
- Create a new level
- Load and Save of a level
Thanks,
- John
Kjurtyl
2002.05.31, 05:52 PM
When the game will be released, there will be a set of default levels included in the application, not outside in a .hlvls file. You will have to either look up BobbyWatson's work for ways to incorporate that ability with your classes or come up with your own.
-Kjurtyl.
BobbyWatson
2002.05.31, 09:09 PM
Originally posted by Kjurtyl
You will have to either look up BobbyWatson's work for ways to incorporate that ability with your classes or come up with your own.
Would'nt be very difficult to do, just change the default filePath in the useDefaultLevels method (I think that's the name, not sure).
flipflop
2002.05.31, 09:56 PM
It shouldn't be that difficult, as Bobby pointed out. After thinking a little bit more, the LevelBundle class takes a directory with level files in it. It's not going to matter what the name of the directory is or where it is located, in theory it should just work... Hahaha! Famous last words :)
- John
Quick sporting highlights for those who are interested (don't read if you taped these games!)
Senegal beat the defending world cup team, France 1 - 0. Nice to see the underdogs win once in a while. :)
For those who missed the game or care, Red Wings just trounced the Avalanche 7 - 0 (ouch!) and are going to the finals!
Go Red Wings!
vBulletin® v3.6.8, Copyright ©2000-2008, Jelsoft Enterprises Ltd.