Page 1 of 1

[Source] Open Halo Parser

Posted: Tue Jul 20, 2010 3:54 pm
by Modzy
What is it?
[/color]

The Open Halo Parser is what I use to power all of my Halo-based applications. It is a set of classes and methods for parsing Halo maps very quickly and easily, allowing you to get your application up and running in very little time.

This release is the first public version. It has been trimmed down and refined from previews demos (see dev forum for demos, if you've permission).

How Does it Work?
[/color]

Simply add the OHP folder to your REALBasic project, and you can start using it. You can use commands to start such as:

Code: Select all

//For this demo, f will be a folder item that has been pointed to a map file.
Dim new_map As New halo_map
new_map.load(f)
The code above will load all of the map information; all header data, index header data, tag offsets, names, lengths, sbsp information, etc.

The info of a loaded map can be used very easily. Like, displaying the scnr's name:

Code: Select all

//new_map is a halo_map that has been loaded
MsgBox new_map.tags(0).name //tag number 0 will always be the scnr, because it is the first tag in the map.
Or maybe display the very last tag's name?

Code: Select all

//new_map is a halo_map that has been loaded
MsgBox new_map.tags(new_map.tag_count - 1).name //tags() array is zero-based
Note: Things like arrays and dictionaries are zero-based, while tag counts and reflexive counts are one-based.

All of the basic map information can be gained from these methods. It is the very basic things all map editors have in common: map parsing. These methods are very light and fast, best there is in my opinion.
This source is free to be used in anyway the downloader likes. All I ask is for credit if it is used within an application.
Download RB Project File
Download PDF of Code

Re: [Source] Open Halo Parser

Posted: Tue Jul 20, 2010 6:12 pm
by Amy
: D Great, thank you so much Modzy!

Re: [Source] Open Halo Parser

Posted: Wed Jul 21, 2010 12:22 am
by Sparky
any way to apply this to objective-c?

Re: [Source] Open Halo Parser

Posted: Wed Jul 21, 2010 1:03 am
by Modzy
Sparky wrote:any way to apply this to objective-c?
The concepts and such can be ported. It'll just take someone who knows how to code in Objective-C and has the time and is willing to do so. I'm only one of those three at this point in time.