Jump to content
Sign in to follow this  
Guest

Fsregen api crash detection

Recommended Posts

Guest

Hi,I read thru a lengthy thread in the forum discussing adding crash detection to an api created from gmax using fsregen.I exported the file in gmax, loaded the *.asm file in fsregen.Then clicked "create library source file".I edited this file to look like this:; Library Compiler - fsregen v0.31b by G.Ioannu ; Freeware. Commercial use is prohibited.; header label word dw 0001 dd 000989D57H dd 0FF6914C5H dd 07FFFFFFFH dd 080B60B62H dw 22 dup(0) dd (offset LIBRARY_DATA) - (offset header) dw 10 dup(0) dd 0EF4CDDC7h dd 011D72CD4h dd 0EF4CDDC7h dd 011D72CD4h dw 14 dup(0)LIBRARY_DATA label word dd (offset LIBRARY_0) - (offset LIBRARY_DATA) dd 0EF4CDDC7h, 011D72CD4h, 088BE499Dh, 02F8D33F5h dd 0,6,8 dd (offset LIBRARY_DATA)LIBRARY_0 label word dd 0EF4CDDC7h, 011D72CD4h, 088BE499Dh, 02F8D33F5h db 100 dd (offset LIBRARY_0_HE) - (offset LIBRARY_0) dd (offset LIBRARY_0_END) - (offset LIBRARY_0_START) dd 4 dd 131072 dd 0 dd 0 db "treetest" dd 0LIBRARY_0_HE label wordLIBRARY_0_START label word ; Line edited 21/01/03 00:16:01model_crash label BGLCODE BGL_CRASH_START model_crash_end, 4 BGL_CRASH_OCTTREE crash_end_1 dw CRASH_FLAG_OBJECT ; crash type dw 5 ; nodes used real4 -3.022596,-0.032766,0.000000 ; Box x,y,z real4 6.060200,6.060200,2.020066 ; Box w,h,d dw 1, 2, 2, 3, 3, 4, 4, 5 ; base offset into node table, one for each top-level branch ; So if you take branch 2 (count from 0), you add 2 to indices you encounter on that branch ; Nodes (254=empty 255=full, else an index into branch) OCTTREE_NODE 0, 254, 0, 254, 0, 254, 0, 254 ; node 0 OCTTREE_NODE 255, 254, 255, 254, 255, 254, 255, 254 ; node 1 OCTTREE_NODE 255, 254, 255, 254, 255, 254, 255, 254 ; node 2 OCTTREE_NODE 255, 254, 255, 254, 255, 254, 255, 254 ; node 3 OCTTREE_NODE 255, 254, 255, 254, 255, 254, 255, 254 ; node 4crash_end_1 label wordmodel_crash_end label word include C:My DocumentsGmax api Testtreetest_0.asmLIBRARY_0_END label word dd 0,0,0,0How do I go about creating the api and bgl from this file. Also, if I use the "SPRITE_VICALL" in the *.asm file, will this be reflected in the final bgl or will the scasm equivalent have to be used.Thanks, David.

Share this post


Link to post
Share on other sites

Hi David,You have two options:1) The best option is to copy the crash detection code from the GMax project.asm file into the project_0.asm file. There is a topic where this has been shown.2) Second option is to make some SCASM crash detection code and place that in the calling API, but it is better to put it in the library with the object, so I would advise you to use 1).FsRegen can also create the API's for you and when you compile the ASM source FsRegen made (the one you posted) with BGLC you will get your library BGL file.And if you make a change to the project.asm file so it uses SPRITE_VICALL that will not be included in the library (it only uses the project_0.asm file), so you will have to add the SCASM equivilent of the code to your calling API.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest

Thanks for the reply Arno,What I'm trying to do is add hedges on the perimeter of the airfield using the "line/macro" function in FSSC.I am not sure how to implement the first option that you suggested, or if it is suitable for placing multiple objects (like hedgerows).So I opted for the option using fsregen to create the macro. I edited the file to include rotation and ended up with the following:; --- Created by FsRegen v0.31bmif (0)Area( 5 %1 %2 1 );RotatedCall( :symbol 0 0 %5 )Jump( :endsymbl ):symbolRefPoint( 7 : 0.5 %1 %2 )Points( 0-4 0 0-4 0 03 0 03 0 00 0 0)Poly( a 0 1 2 3 )Poly( a 0 4 3 )Return:endsymblEndAmifendArea( 5 %1 %2 22 )perspectivecall( :OBJ );shadowcall( :OBJ )jump( : ):OBJmif( %11 )refpoint( 2 :END %4 %1 %2 E= %11 v1= %10 %13 %14 )melserefpoint( 7 :END %4 %1 %2 v1= %10 %13 %14 )mifendRotateToAircraft( :ROT 0 0 0 0 0 1 0 0 0 );rotatedcall( :ROT 0 0 %5 )return:ROTcallLibobj( 0 EF4CDDC7 11D72CD4 88BE499D 2F8D33F5 ):ENDreturnEndAThis works ok, but if the aircraft gets too close to the object the graphics start jumping (seems to quickly zoom in and out), could this be something to do with the two refpoint lines?Thanks again, David

Share this post


Link to post
Share on other sites

>This works ok, but if the aircraft gets too close to the >object the graphics start jumping (seems to quickly zoom in >and out), could this be something to do with the two >refpoint lines? Humm, I don't know what you mean there. Can you maybe make a screenshot or so?Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Arno

If the world should blow itself up, the last audible voice would be that of an expert saying it can't be done.

FSDeveloper.com | Former Microsoft FS MVP | Blog

Share this post


Link to post
Share on other sites
Guest

Hi Arno,Sorry for the delay, been recovering from an argument with a ladder.Here are a couple of screenshots of the problem, it only occurs when near to the objects.David(I used bumpy the other day, thanks for the program)

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...