Jump to content
Sign in to follow this  
arno

Object library and LODs

Recommended Posts

Guest

Hi!I'm from Finnish Scenery Designers and I'm working on gates for EFHK scenery. What I would like to do is an API macro for the gate and different LOD stages for it so that I could use the same API macro for all the gates.I've created a 3d-model for the gate on gmax and two different LOD models for it which I've exported using MDLCommander to get x-files for both of them. Then I created the BGL and tested it in FS and LODs work just fine.Now I want to compile the gate into a API macro and I'm using FSregen for this. When I compiled it into a macro only another of the LOD stages got compiled and different LOD stages naturally won't work in FS.The orginal asm source looks like this:-------------------------------------------------------------;compile with BGLC /BGL D:EFHK-scenerysceneryportti.asmheader label word dw 0001 ; 00 World set number dd 000664911H ; 02 North bound dd 0006648EFH ; 06 South bound dd 011C1556DH ; 10 East bound dd 011C1556BH ; 14 West bound dw 20 dup(0) dd (offset OBJECT_DATA) - (offset header) dw 33 dup(0) OBJECT_DATA label word db 21 ;;LATBAND_REL dw 03324h ;;lat min (inclusive) 512M units dw 03325h ;;lat max (exclusive) dd (offset OBJECT_0) - (offset OBJECT_DATA) db 0 ;;EOL OBJECT_0 label BGLCODE db 12 ; NEAR_FAR_HUGE_OBJECT_HEADER dd 000664900h,011C1556Ch ; latitude,longitude db 100 ; image power dd (offset OBJECT_0_END) - (offset OBJECT_0) OBJECT_0_START label word IFIN1 OBJECT_0_FAIL, image_complex, 2, 32767 ADDOBJ OBJECT_0_SCALE SHADOW_CALL OBJECT_0_SCALEOBJECT_0_FAIL label BGLCODE BGL_JUMP_32 OBJECT_0_END OBJECT_0_SCALE label BGLCODE SCALE_AGL OBJECT_0_RETURN, 10000, 19, 131072, 000664900h, 0BCE1h, 011C1556Ch, 03DD2h, 0, 0 BGL_CALL OBJECT_0_BEGINOBJECT_0_RETURN label word BGL_RETURNOBJECT_0_BEGIN label wordmodel_outside label BGLCODE VAR_BASE_OVERRIDE VAR_BASE_GLOBAL IFIN1 model_shadow, SHADOW_FLAG,0,0 IFSIZEV LOD_1, 301,1000 ; lod = 150.000000LOD_0 label BGLCODE BGL_JUMP_32 LOD_0LLOD_1 label BGLCODE BGL_JUMP_32 LOD_1Lmodel_inside label BGLCODE BGL_RETURNmodel_shadow label BGLCODE IFSIZEV SHADOW_1, 301,1000 ; lod = 150.000000SHADOW_0 label BGLCODE BGL_JUMP_32 LOD_1LSHADOW_1 label BGLCODE BGL_JUMP_32 LOD_1LLOD_0L label BGLCODE include D:EFHK-scenerysceneryportti_0.asmLOD_1L label BGLCODE include D:EFHK-scenerysceneryportti_1.asmOBJECT_0_END label wordEOF-------------------------------------------------------------And the one created by FSregen 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 0551EDCD8h dd 04522A406h dd 0551EDCD8h dd 04522A406h dw 14 dup(0)LIBRARY_DATA label word dd (offset LIBRARY_0) - (offset LIBRARY_DATA) dd 0551EDCD8h, 04522A406h, 0DF1173A0h, 0F816D284h dd 0,6,8 dd (offset LIBRARY_DATA)LIBRARY_0 label word dd 0551EDCD8h, 04522A406h, 0DF1173A0h, 0F816D284h db 100 dd (offset LIBRARY_0_HE) - (offset LIBRARY_0) dd (offset LIBRARY_0_END) - (offset LIBRARY_0_START) dd 19 dd 131072 dd 0 dd 0 db "portti" dd 0LIBRARY_0_HE label wordLIBRARY_0_START label word include D:FSregenportti_0.asmLIBRARY_0_END label word dd 0,0,0,0-------------------------------------------------------------How should I edit it to get LODs to my object library?

Share this post


Link to post
Share on other sites

FsRegen only takes one version of the object, I think the best workaround is to just make two GMax models and add them both to the library (with a different ID). Then change the API so that it calls one of these objects depending on the range 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

Yes, sounds wise. How can I make an API macro which appears only if the distance is over 500 meters?

Share this post


Link to post
Share on other sites

Try to replace the line that calls the object by something like this:IfVarRange( :lowdetail 33B 0 500 )CallLibObject( 0 12345678 12345678 12345678 12345678 ) ; high detail objectJump( :further ):lowdetailCallLibObject( 0 12345678 12345678 12345678 12345678 ) ; low detail object:furtherArno


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

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