Sign in to follow this  
rhumbaflappy

Library for dynamic objects

Recommended Posts

Hello,I have posted this topic already in a forum at scenerydesign.org but it seems there is a problem that nobody knows to solve.I made a library file with selfmade objects from gmax and converted to a lib.bgl with FSRegen.At first, with the default code from FSREGEN the object shows up for the duration of the dwait command an then disapears. Actually it jumps arround on the airport when you move your viewpoint.With the help of a guy from the other forum I changed the code to look like below, but now the object doesn't show up anymore.The big question is now how do we have to change the FSREGEN code to make a library for dynamic objects.By the way: the dynamic scenery file is working fine with default objects.Question No. 2 is: How can we use the hundreds of new library objects from FS2004 for dynamic scenery files. I tried to use the GUIDS call that works swith a normal scenery on api but obviously not for dynamic.Iam only interested in Groundobjects like cars etc since we have AI.....Any help apreciated.Gerdheader 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 023041961h dd 011051963h dd 023041961h dd 011051963h dw 14 dup(0)LIBRARY_DATA label word dd (offset LIBRARY_0) - (offset LIBRARY_DATA) dd 023041961h, 011051963h, 0EDDF2004h, 000000001h dd 0,6,8 dd (offset LIBRARY_DATA)LIBRARY_0 label word dd 023041961h, 011051963h, 0EDDF2004h, 000000001h db 100 dd (offset LIBRARY_0_HE) - (offset LIBRARY_0) dd (offset LIBRARY_0_END) - (offset LIBRARY_0_START) dd 0 ; changed from 7 to 0 dd 131072 dd 2 ; changed from 0 to 2 dd 0 db "Bus" dd 0LIBRARY_0_HE label wordLIBRARY_0_START label wordSHADOW_VPOSITION 0 ;insertedSUPER_SCALE Bus_shadow_off, 0, 0, 6 ;insertedSHADOW_VICALL Bus_draw, 18h ;insertedBus_shadow_off label dword ;insertedVPOSITION Bus_end, 0, 0, 0 ;insertedSUPER_SCALE Bus_end, 0, 0, 6 ;insertedVINSTANCE_CALL Bus_draw, 18h ;insertedSETWRD 2Ch, 2 ;insertedBus_end label dword ;insertedBGL_RETURN ;insertedBus_draw: ;insertedinclude F:gmaxFrankfurtLib_ObjectsBus_0.asmLIBRARY_0_END label worddd 0,0,0,0This from the dyn.text: SET_LAT_ANCHOR LAT48_N50:00:00.00eddf_bus label word ADD_OBJECT_LIBRARY eddf_behave1, 00110000b+0, 023041961h, 011051963h, 0EDDF2004h, 000000001hDYN_EOFeddf_behave1 label word SET_LLA LAT48_N50:01:52.80, LON48_E08:34:18.60, ALT48_50 SET_HEADING ANGL16_270 DWAIT

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hello Gerd,I have made numerous libraries using gMax objects and FSRegen. The only thing that I have changed in the asm files is TEXTURE_DEF TEXTURE_AIRCRAFTtoTEXTURE_DEF TEXTURE_BUILDINGOtherwise, textures will not be displayed as distance increases.Perhaps, you could indicate more precisely what you have changed in the code and exactly what you mean by <>Best regards.Luis

Share this post


Link to post
Share on other sites

You might wait for an updated GMAX_SDK before you do to many things with dynamic objects.W. Sieffert

Share this post


Link to post
Share on other sites

To Louis & W.well, we are talking about libraries for Dynamic Scenery! This seems to be not the same as static Objects.My Library was working OK when I placed the objects as static.But now I want my own bus to move arround on the airport. That should be possible.And I mean exactly what I say when I say it jumps around on the airport.At the beginn of this dynamic .bgl file there is a dwait command. You can see the object standing there. After the wait command the object is suposed to move. But first it disapears!Then, when you look from above where it might be, you can see it popping up at random places all over the airport. If you stand still it stands still, if you move your viewpoint a little, it will pop up at another place.There is dynamic ground scenery with custom objects all over the place. It must work somehow.I don't want to wait for MS to come up with a gmax SDK, just another paper nobody understands. It might take until FS 2006.........If you should have a small library with objects in it that will move around, just send me a sample, maybe I can find the mistake.Gerd

Share this post


Link to post
Share on other sites

Hi Gerd.Have you tried BusyObjects?BusyObjects allows you to move regular scenery objects:http://www.brainon.ch/area51/brf/BusyObjects/It just seems that would be a decent solution rather than trying to hack the Dynamic Library code.Regarding Dynamic Libraries.Christian Stock has decompiled this code, and perhaps he will respond to this post. I haven't really looked at it, but it should be possible to use one of the previously released Scenery SDKs to find the needed code. If I find time, I'll look for it. :)Dick

Share this post


Link to post
Share on other sites

Hi Gerd.I did make a dynamic object with Gmax and fsregen:http://forums.avsim.net/user_files/58376.jpgThat gave me 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 0E6497D16h dd 04F483517h dd 0E6497D16h dd 04F483517h dw 14 dup(0)LIBRARY_DATA label word dd (offset LIBRARY_0) - (offset LIBRARY_DATA) dd 0E6497D16h, 04F483517h, 0679A249Fh, 013EC27D3h dd 0,6,8 dd (offset LIBRARY_DATA)LIBRARY_0 label word dd 0E6497D16h, 04F483517h, 0679A249Fh, 013EC27D3h db 100 dd (offset LIBRARY_0_HE) - (offset LIBRARY_0) dd (offset LIBRARY_0_END) - (offset LIBRARY_0_START) dd 102 dd 32 dd 2 dd 0 db "DynamicSphere" dd 0LIBRARY_0_HE label wordLIBRARY_0_START label word include C:Documents and SettingsDick.LUDOWRDesktopDynamicLibraryresourceNewResourceDynamicSphere_0.asmLIBRARY_0_END label word dd 0,0,0,0But you're not done... The "_0" code needs to have an adition:......................;; Modeling units = 2.0000; Radius = 101.6299; Radius in meters = 101.6299; Radius in modeling units = 204;Sphere_topG0 label BGLCODE; Dynamic Code SHADOW_VPOSITION 0 SUPER_SCALE Call_SphereTest, 10000, 105, 16 SHADOW_VICALL Draw_SphereTest, 18hCall_SphereTest label word VPOSITION Return_SphereTest, 10000, 105, 0 SUPER_SCALE Return_SphereTest, 10000, 105, 16 VINSTANCE_CALL Draw_SphereTest, 18h SETWRD 2Ch, 25Return_SphereTest label word BGL_RETURNDraw_SphereTest label word; End Dynamic Code BGL_BEGIN 0800h ; version = 8.00 MATERIAL_LIST_BEGIN MATERIAL_DEF 0.690196,0.101961,0.101961,1.000000, 0.690196,0.101961,0.101961, 0.000000,0.000000,0.000000, 0.000000,0.000000,0.000000, 0.000000 ; 0 MATERIAL_LIST_END VERTEX_LIST_BEGIN VERTEX_DEF -101.592003, 103.256004, 0.000000, -1.000000, 0.000000, 0.000000, 0.000000,1.000000 ; 0 part= 1 prim=0 VERTEX_DEF -99.672005, 83.744003,.........http://forums.avsim.net/user_files/58378.jpgI've attached a zip file for you to play with.Dick

Share this post


Link to post
Share on other sites

Yep, we got it......the bus is now showing up and is moving just the way it should but........it is hovering about 2 or 3 meter over the ground.The final code is listed below.Since I didn't know what I was actually doing, Is there an altitude setting in the lines I inserted?Can I get an explanation about what the numbers mean that were inserted:SHADOW_VPOSITION 0 ;??????SUPER_SCALE Call_bus, 10000, 105, 16 ;???????SHADOW_VICALL Draw_bus, 18h ??????Call_bus label wordVPOSITION Return_bus, 10000, 105, 0 ;???????SUPER_SCALE Return_bus, 10000, 105, 16 ;????????VINSTANCE_CALL Draw_bus, 18h ;???????SETWRD 2Ch, 25 ;????????Return_bus label wordBGL_RETURNDraw_bus label wordAnyway, thanks a lot for your help. My sleepless nights are over now.RegardsGerd; 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 023041961h dd 011051963h dd 023041961h dd 011051963h dw 14 dup(0)LIBRARY_DATA label word dd (offset LIBRARY_0) - (offset LIBRARY_DATA) dd 023041961h, 011051963h, 0EDDF2004h, 000000001h dd 0,6,8 dd (offset LIBRARY_DATA)LIBRARY_0 label word dd 023041961h, 011051963h, 0EDDF2004h, 000000001h db 100 dd (offset LIBRARY_0_HE) - (offset LIBRARY_0) dd (offset LIBRARY_0_END) - (offset LIBRARY_0_START) dd 7 dd 32 dd 2 dd 0 db "Bus" dd 0LIBRARY_0_HE label wordLIBRARY_0_START label wordSHADOW_VPOSITION 0SUPER_SCALE Call_bus, 10000, 105, 16SHADOW_VICALL Draw_bus, 18hCall_bus label wordVPOSITION Return_bus, 10000, 105, 0SUPER_SCALE Return_bus, 10000, 105, 16VINSTANCE_CALL Draw_bus, 18hSETWRD 2Ch, 25Return_bus label wordBGL_RETURNDraw_bus label wordinclude F:gmaxFrankfurtLib_ObjectsBus_0.asmLIBRARY_0_END label word dd 0,0,0,0

Share this post


Link to post
Share on other sites

Hi Gerd.I also played with the code, as my huge sphere was also floating.What I found was I had to lower the onject in Gmax, and recompile it. I'm still not getting any shadows!My next move from here would be BusyObjects.Dick

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