Jump to content
Sign in to follow this  
Guest

API's in Gmax

Recommended Posts

Guest

Once again I'm completely stuck with Gmax etc! :-newbie I have downloaded fsregen and middleman 12 and I want to turn the gmax object file into an api file. In the fsregen manual it says I need Middleman to create the asm file necessary to create the api. When I use it however only a bgl file is formed and no asm files. How do I get these asm files to show?Any help appreciated:-wave

Share this post


Link to post
Share on other sites
Guest

the best way to do this is to not use middleman at all. The manual was written for the previous version of makemdl.exe.Get the latest makemdl.exe from the fs2002 sdk. Don't rename the exe file, and put middleman somewhere else for now.Export your model, and you'll see the options boxes...just check the box "keep files", and hit ok.You should get three files, a bgl file, an asm file, and an asm_0 file. Delete the bgl file.Now boot fsregen. for the input file, browse to your asm file.give fsregen a unique guid number...remember must be in hexidecimal, so only use numbers 0-9 and letters a-f, and form an id that is 4 sets of 8 characters. I include my name (using zeros for Os) because if anyone else replicates your number then fs will get confused.Then click to add that file.Then give fsregen your library file name, and create the library file.Then compile the library file....mylibrary.asm using bglc.exethen create the calling api, George has now automated that in fsregen. The calling file is myfile.api, which you use in your assembly program, like Airport, or fssc, or groundmaker...etc.Bob Bernstein

Share this post


Link to post
Share on other sites
Guest

Having a terrible time with FSregen....I have done the export and kept the files, and when I point the input to my .ASM file, it says [unable to open this file (already processed?)]So I never get the green light to go any further....Help?

Share this post


Link to post
Share on other sites
Guest

do you have an asm file and an asm_0 file?

Share this post


Link to post
Share on other sites
Guest

Once I compile the file with BGLC (I used the BGLC that came with the special effects SDK) a bgl file is created. How do I get the api from there?Thanks:-wave

Share this post


Link to post
Share on other sites
Guest

Yeah,You are using the wrong menu for this particular thing. Create API's in the Library Compiler window (click on the box at the bottom of the screen). The above is in FSregen, of course. Then Bob's steps will work like a charm.

Share this post


Link to post
Share on other sites
Guest

I still am unsure, after I create the library source file I then put it through BGLC which makes a bgl file. How do I make the api from the bgl file? If I do all but the BGLC bit and create an api I get the 'some scenery objects will not display' error message. So how do I create the api file from the bgl file because I cant seem to do it in fsregen as it will only accept asm files.Thanks for the help(a very confused) Jamie :-wave

Share this post


Link to post
Share on other sites
Guest

< You don't! You make it seperately. George has just added this functionality to Fsregen, but you seem a tad confused about fsregen...perhaps it would be easier to understand if you did a manual api file to start with. I don't have any examples of my own files here at work today, but I found some of Arno's code in an old thread and took the liberty to copy it here (sorry Arno, hope you don't mind): Area( 5 %1 %2 22 )PerspectiveCall( :L1 )ShadowCall( :L2 )Jump( : ):L1Perspective:L2mif( %11 )RefPoint( 2 :E1 0.6 %1 %2 E= %11 v1= %10 %13 %14 )melseRefPoint( 7 :E1 0.6 %1 %2 v1= %10 %13 %14 )mifendRotatedCall ( :R1 0 0 %5 )Return:R1CallLibObj( 0 12345678 12345678 12345678 12345678 ):E1ReturnEndAIf you just copy this and alter the line that starts with CallLibObj, you'll have your own api scasm file. So startup notepad or wordpad or word...and past this text into a new file. name it what you want but the file type is .api. Then edit the CallLibObj by changing the numbers Arno demo'd with 12345678 to be exactly the same as the GUID you put into fsregen for a given object.Save the file, and then you'll be able to add this "macro" into a scenery using Airport, or FSSC, or other assembly programs.Bob Bernstein

Share this post


Link to post
Share on other sites
Guest

I tried that but it wont work because the notepad refuses to save as anything but a .txt file. What I now want to know is what I do with the bgl file once I have created it because I can also create the api from the library compiler and add it into airport. I assume it (the bgl file) has some importance since the object wont work without it.Thanks,:-wave

Share this post


Link to post
Share on other sites
Guest

you put it in your scenery folder. Which one depends on what ur up to. If you want ur objects to be available for all your scenery you may want to put it in a main scenery directory. I put all my library bgls in my remote scenery directorys...because I'll be uploading my projects and I don't want to have to find them later...also most of my objects are custom to individual projects. The general use objects I put in a different bgl, called general.bgl. I put this in my remoter dirs also, but I copy it and use it in lots of places.You can always save files as a unique file type...I don't have time to fool with it at the moment, but heck...if nothing else just go into dos and rename it using the command:ren yourfile.txt yourfile.apiYou probably can also use a macro called myfile.txt....the convention of having macros named .api is not something scasm cares about, its just a reference tag in a scasm "macro" command, which works like an "include" as simple redirection for compilation into machine language.Bob B

Share this post


Link to post
Share on other sites
Guest

Thanks Bob and all who replied, it works now :D .(a triumphant) Jamie :-wave

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...