|
Author
|
Topic: Parsing Mission Files
|
Tailslide Pilot
|
posted 05-17- 02:28 PM
I'm toying with the idea of making a mission editor with the features I want. If you've written code (in any language) to parse the mission files I would be eternally grateful if I can sneak a peek. I made a C++ class for parsing .par files if anyone wants it. TS ------------------ Patch It! TS Aircombat
IP: Logged |
Bryan Russell Pilot
|
posted 05-17- 08:30 PM
Mission files are just property lists aren't they?I did it a really messy way to parse the prop lists in OPS. Basically split them into expressions (which is some like '<keyword> (proplist)' ) and then recursivly handle each expression, based on the keyword. I'll grab the bit for you tonight if you want. Probably a better way may be to use bison and flex, the proplists are a very simple structure so it shouldn't be a big job, assuming you can figure out the parser  Bryan IP: Logged |
Tailslide Pilot
|
posted 05-17- 08:50 PM
Theres other stuff to it besides whats in the actual mission file.. squadron lists, airport lists, etc.. I know a couple people have already written the code for this but if I have to I'll write it myself and post it for everyone. I believe all the mission property lists at least the ones the editor generates are pretty much flat. Is it possible to go beyond what the editor does? I remember someone toying around with using obProb to make thing happen randomly in the missions... TS
IP: Logged |
Tailslide Pilot
|
posted 05-17- 08:51 PM
Using bison and flex for this would be like killing a fly with a bazooka 
IP: Logged |
Bryan Russell Pilot
|
posted 05-17- 10:38 PM
"Using bison and flex for this would be like killing a fly with a bazooka"I wouldn't say that, probably no heftier than if you wrote the code yourself. Damn sight easier with the bazooka anyway, rather than chasing it all over the room with the wimpy fly swatter or thong. (I'm not sure if I'm still in metaphor mode here or not ) I played with obProb, and it doesn't work. CTDs the game or just ignores the stuff in the obProbs. Good job for the mythical SOS  Can't help with the other files, but shouldn't it be simple once the prop list parsing is sorted? Assuming you know what’s where. IP: Logged |
Tailslide Pilot
|
posted 05-18- 02:23 AM
All the squadrons are scattered around in .par files and ppf files in the squadrons directory. I extracted them all and I'm just going to hard code them for now, I have some plans that would require a standardized set of squads anyways. BzzzzzzzZZZZZZZZZZzzzzzzzzzzz
KABOOM! (in a southern drawl) Yep, them flies're might tasty with a little BBQ sauce. TS
IP: Logged |
bjorn Pilot
|
posted 05-18- 12:23 PM
I've had it on my mind for some time now to write a flex/bison parser for property lists (for syntax checking them, it's so easy to get a detail wrong.) Since the jug is now in plane packing I'll probably deal with the parser this weekend, depending on weather and mood. I'll post an update later on... _ /Bjorn.IP: Logged |
Tailslide Pilot
|
posted 05-18- 12:40 PM
My app is in javascript is there any way I can use this? I've only used the grammer parsers for Unix I havent installed the windows versions yet. TS
IP: Logged |
bjorn Pilot
|
posted 05-18- 12:42 PM
If you don't want the .l and .y files, I can always post the generated .[ch]. _ /Bjorn.
IP: Logged |
Tailslide Pilot
|
posted 05-18- 12:46 PM
Is there any way to make it generate javascript or java code? TS
IP: Logged |
bjorn Pilot
|
posted 05-18- 02:56 PM
No idea...  _ /Bjorn.
IP: Logged |
Tailslide Pilot
|
posted 05-18- 03:02 PM
Can you post the C source generated if its not really huge? Maybe it wouldnt be that hard to port. I know it's dumb writing something like this in DHTML but I need the practice TS
IP: Logged |
spin Pilot
|
posted 05-18- 11:42 PM
Tailslide,DO you want my mission generator file? I've broken out the different terrain target lists, ground objects, and the lines required into different sheets in Excel. This might be a start for you - that is if you can wade through all the stuff I built in to my rather brute force method.
IP: Logged |
Tailslide Pilot
|
posted 05-19- 02:00 AM
Spin, That would save me lots of time, please email! Thanks!!! TS [This message has been edited by Tailslide (edited 05-19-2000).] IP: Logged |