Sign in to follow this  
Guest moomox

Help, Help, I'm being repressed!

Recommended Posts

I've been trying to get the SPRITE_VICALL command to work correctly, and have aquired a large headache in the proccess...I'm guessing Sir ARNO Lord of the BGL code will know this one.:-lolI'm building trees in GMax (using a single vertical plane)The trees show up fine in FS2002, but every modification I have attempted to make to the SPRITE_VICALL rotates the tree in some weird ways... it actually banks the tree like it's blowing down in a windstorm! Argggg!Any help would be much appreciated!ThanksDavid

Share this post


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

It's a bit hard for me to answer without an example code, but I'll give it a try :).In the .asm file made by GMax there is a place where there is a BGL_CALL to the actual code, if you replace that by:

BGL_SPRITE_VICALL label, 0, 0, 0, 0, 0, 0, 0, 1, 0

I think it should work (or I hope :)). On the place of label, you should place the label that was in the BGL_CALL before.If it doesn't please post the asm file so I can indicate the correct spot.Arno


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

Share this post


Link to post
Share on other sites

(In the voice of a teenage girl)Oh my god...it...like...works!Thanks Arno, you da man!David

Share this post


Link to post
Share on other sites

Hi Arno,I tried the above code on a billboard-style tree I made and all I get are BGL errors. Can you tell me where I'm going wrong? Here's my original code:;compile with BGLC /BGL C:BGLToolstreeTest.asmheader label word dw 0001 ; 00 World set number dd 0006218B6H ; 02 North bound dd 0006218A8H ; 06 South bound dd 0A00C3A32H ; 10 East bound dd 0A00C3A30H ; 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 0310Ch ;;lat min (inclusive) 512M units dw 0310Dh ;;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 0006218AFh,0A00C3A31h ; 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, 27, 131072, 0006218AFh, 012D8h, 0A00C3A31h, 08BE3h, 0, 0 BGL_CALL OBJECT_0_BEGIN ; I tried BGL_SPRITE_VICALL OBJECT_0_BEGIN, 0, 0, 0, 0, 0, 0, 0, 1, 0 hereOBJECT_0_RETURN label word BGL_RETURNOBJECT_0_BEGIN label wordmodel_outside label BGLCODE BGL_CALL model_crash ; I tried BGL_SPRITE_VICALL model_crash, 0, 0, 0, 0, 0, 0, 0, 1, 0 heremodel_shadow label BGLCODELOD_0 label BGLCODE BGL_JUMP_32 LOD_0Lmodel_inside label BGLCODE BGL_RETURNmodel_crash label BGLCODE BGL_CRASH_START model_crash_end, 13 BGL_CRASH_OCTTREE crash_end_1 dw CRASH_FLAG_OBJECT ; crash type dw 21 ; nodes used real4 0.000000,-0.188076,-12.768074 ; Box x,y,z real4 17.312706,51.938118,25.536345 ; Box w,h,d dw 1, 6, 11, 16, 21, 21, 21, 21 ; base offset into node table, one for each top-level branch ; So if you take branch 2 (count from 0), you add 11 to indices you encounter on that branch ; Nodes (254=empty 255=full, else an index into branch) OCTTREE_NODE 0, 0, 0, 0, 254, 254, 254, 254 ; node 0 OCTTREE_NODE 1, 2, 3, 4, 254, 254, 254, 254 ; node 1 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 2 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 3 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 4 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 5 OCTTREE_NODE 1, 2, 3, 4, 254, 254, 254, 254 ; node 6 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 7 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 8 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 9 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 10 OCTTREE_NODE 1, 2, 3, 4, 254, 254, 254, 254 ; node 11 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 12 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 13 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 14 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 15 OCTTREE_NODE 1, 2, 3, 4, 254, 254, 254, 254 ; node 16 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 17 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 18 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 19 OCTTREE_NODE 255, 255, 255, 255, 254, 254, 254, 254 ; node 20crash_end_1 label wordmodel_crash_end label word BGL_RETURNLOD_0L label BGLCODE include C:BGLToolstreeTest_0.asmOBJECT_0_END label wordEOFI commented the places I tried substituting the SPRITE_VICALL above.thanks,

Share this post


Link to post
Share on other sites

I created a single vertical plane in Gmax with the tree texture I want, applied to that plane...You will see below where I inserted the lineSPRITE_VICALL OBJECT_0_BEGIN, 0, 0, 0, 0, 0, 0, 0, 1, 0Notice, I got rid of the "BGL" in front of SPRITE_VICALLThis is the BGL Code;compile with BGLC /BGL D:GMax ProjectsASM TreesT_WC_1.asmheader label word dw 0001 ; 00 World set number dd 0004BAF0FH ; 02 North bound dd 0004BAEFFH ; 06 South bound dd 0D2D6CE83H ; 10 East bound dd 0D2D6CE81H ; 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 025D7h ;;lat min (inclusive) 512M units dw 025D8h ;;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 0004BAF07h,0D2D6CE82h ; 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, 5000, 17, 131072, 0004BAF07h, 0AA0Eh, 0D2D6CE82h, 08FA2h, 0, 0; BGL_CALL OBJECT_0_BEGIN SPRITE_VICALL OBJECT_0_BEGIN, 0, 0, 0, 0, 0, 0, 0, 1, 0OBJECT_0_RETURN label word BGL_RETURNOBJECT_0_BEGIN label wordmodel_outside label BGLCODE BGL_CALL model_crashmodel_shadow label BGLCODELOD_0 label BGLCODE BGL_JUMP_32 LOD_0Lmodel_inside label BGLCODE BGL_RETURNmodel_crash label BGLCODE BGL_CRASH_START model_crash_end, 15 BGL_CRASH_OCTTREE crash_end_1 dw CRASH_FLAG_OBJECT ; crash type dw 5 ; nodes used real4 -15.000000,-0.002694,0.000000 ; Box x,y,z real4 30.000200,30.000200,10.000067 ; 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 BGL_RETURNLOD_0L label BGLCODE include D:GMax ProjectsASM TreesT_WC_1_0.asmOBJECT_0_END label wordEOFLater!David

Share this post


Link to post
Share on other sites

Hi Bill,The first place should be correct:

SCALE_AGL OBJECT_0_RETURN, 10000, 27, 131072, 0006218AFh, 012D8h, 0A00C3A31h, 08BE3h, 0, 0BGL_CALL OBJECT_0_BEGINOBJECT_0_RETURN label word

then becomes:

SCALE_AGL OBJECT_0_RETURN, 10000, 27, 131072, 0006218AFh, 012D8h, 0A00C3A31h, 08BE3h, 0, 0BGL_SPRITE_VICALL OBJECT_0_BEGIN, 0, 0, 0, 0, 0, 0, 0, 1, 0 hereOBJECT_0_RETURN label word

If it still doesn't work, can you maybe place the errors that might give a clue :).Arno


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

Share this post


Link to post
Share on other sites

Humm, might be the BGL indeed. That is confusing me now and then. Commands like BGL_JUMP_32 only work with it in front, while others don't seem to do.....Arno


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

Share this post


Link to post
Share on other sites

Well this is interesting... I got it to compile by following the advice to leave the "bgl" off and just call "SPRITE_VICALL". However, when I place the final bgl in a scenery file it doesn't show up. Can't quite figure out what's up. The only clue is that I put the bgl file in my "scenery" folder and forgot to put the corresponding texture in "texture" at first, and I got a 1px wide line sliver that shows up about where the tree should be. But when I put the proper texture in place... nothing. It's almost as if the sprite were perpetually turned perfectly perpendicular to me and not facing me. Any idea what could cause that?Thanks for the help!

Share this post


Link to post
Share on other sites

Wow, a real-time conversation with Arno! Either I'm up too late or you're up too early! Probably a little of both. Yes, I'm embarassed to say that you're right... I checked the model and it was modeled along the wrong axis. I rotated it 90 degrees and now it works a treat! Thanks for the help, Arno.BTW, do you have the SCASM code anywhere for doing something like this with a library object I make in FSRegen? I know I'll lose my original asm file when I do that and I really like the trees I've made and may want to place them as APIs in Airport.thanks again,

Share this post


Link to post
Share on other sites

Up early :-hmmm, don't think the boss would like it if I would still be asleep now :) (I think 10.30 in the morning here).But back to the question, try to use a calling API like this:

Area()PerspectiveCall( :L1 )ShadowCall( :L1 )Jump( : ):L1RefPoint()RotateToAircraft( :R )Return:RCallLibObj()ReturnEndA

I didn't fill in all the commands (like Area, RefPoint,...) because I don't have an example here and I would make errors if I did it by mind :), but you can copy that part from the old calling API. I think you should get the idea this way.Arno


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

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