• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Where is the correct place to check for conditions in an asm file?

Messages
49
Country
ca-britishcolumbia
I've been having problems with my windsock crashing FS. I manually editted the .asm file to rotate the windsock with the wind, and also to only display the windsock at certain windspeeds. The idea was to display different windsocks at different speed ranges (0-4, 5-8, 9-13, etc). So, in addition to rotating with the wind, there will be a different windsock at 5 knots as opposed to 15 knots. I made a total of 6 different windsocks for this purpose, and placed them all in the same location, since only one should be visible at a time.

The problem is that everything seems fine when I start at the project airport, but when I fly there from a different airport, FS locks up. I've narrowed teh problem down to my windsocks, and I think taht it has to do with the fact that I manually editted the .asm files, since I am new at BGLC stuff. My question is where in the .asm file would you place a conditional display check?

Here's a snippet of my code:

VERTEX_DEF 0.520000, 5.136000, -0.628000, 0.999769,-0.019149,-0.009733, 0.750000,0.200300 ; 460 part= 1 prim=6
VERTEX_DEF 0.520000, 5.728000, -0.384000, -0.996213,-0.006735, 0.086691, 0.750000,0.000500 ; 461 part= 1 prim=6
VERTEX_DEF 0.520000, 5.728000, -0.384000, 0.996213, 0.006735,-0.086691, 0.750000,0.000500 ; 462 part= 1 prim=6
VERTEX_LIST_END
BGL_RETURN
vertex_riff_end_windsock0004 label word

bgl_riff_start_windsock0004 label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_windsock0004 - $ - 4
LOD_0_windsock0004 label BGLCODE

IFIN1 speedfail, 0C72h, 0, 4 ; display only if wind is between 0 and 4 knots, else goto Label Speedfail

; NonAlpha
windsock_NonAlpha label BGLCODE
POINT_VICALL windsock0004_MasterScale_1, 0, 0, 0, 0, 0, 0, 0, 0, global_winds_surface_direction ; Node 1 - MasterScale
BGL_END
BGL_RETURN

windsock0004_MasterScale_1 label BGLCODE
MATERIAL 0,0 ; <255,255,255,255> TR_09.BMP;TR_09_LM.BMP;;
DRAW_TRI_BEGIN 0, 50
DRAW_TRI 40, 34, 30 ; poly=35 part=1
DRAW_TRI 37, 45, 48 ; poly=67 part=1
DRAW_TRI 37, 39, 45 ; poly=66 part=1

Of course, this is just the "middle part" between the VERTEX_DEF and DRAW_TRI words. At the very end of the asm file is the speedfail label.

The rotate-to-wind part was taken from another post in the tutorials section, but I am not sure about the IFIN1 section. Should this go before the "VERTEX_DEF" words? Maybe this should go before the texture, material or vertex lists?

Thanks (in advance) for all your wisdom!

- Martin
 
Hi Martin,

I think your fail label is at the wrong place. Due to the structure of the MDL file you do not exit if like you should this way. Try to place it here:

Code:
bgl_riff_start_windsock0004 label BGLCODE
db 'B','G','L',' '
dd bgl_riff_end_windsock0004 - $ - 4
LOD_0_windsock0004 label BGLCODE

IFIN1 speedfail, 0C72h, 0, 4

; NonAlpha
windsock_NonAlpha label BGLCODE
POINT_VICALL windsock0004_MasterScale_1, 0, 0, 0, 0, 0, 0, 0, 0, global_winds_surface_direction ; Node 1 - MasterScale
speedfail label word
BGL_END
BGL_RETURN

windsock0004_MasterScale_1 label BGLCODE
 
Thanks Arno - that seems to have fixed my problem with FS crashing. I've managed to fly into the airport several times in a row now without the sim crashing on me. I'll keep testing it, but it seems stable now.

- Martin
 
As we are right talking of conditions etc, I have a basic question about the new RIFF format.

What I know is, that MakeMDL throws out 2 source files of an object. xx.asm and xx_0.asm. THe first one contains "header" information and the latter one the shape/model info.

Now, in the header asm the model is wrapped in through include xx_0.asm command. In the good old FS2002 days, I used to make LOD object calls there: Putting the IFIN 33Bh conditions and let the code decide which LOD model to load. Worked fine!

But now, I see no impact in FS. BGLC_9 compiles it with no error...
So my question: Where exactly in the new asm's can I use the BGL Opcodes??
What works so far is to use them in the model asm in the block
Code:
bgl_riff_start_blabla label BGLCODE
db 'B','G','L',' '

Whereas in the header asm the model call is done in the block
Code:
exterior_riff_start_0 label BGLCODE
    db  'E','X','T','E'

Is this the reason?!? I just want to have control over my LOD models again :cool:

Thanks for every input!

Jeff
 
Hi Jeff,

You need to do your LOD checks after the start of the BGL section. This is also where MakeMDL puts the LOD code when you export with a LOD from GMax.

I have not fully tested the new format (that is ongoing work of the RIFF group), but I think the BGL section is the only section where you can make your own tweaks with the commands we are used to. Most other sections have a special function and only certain commands are allowed there.
 
Ah just as I thought....
Well, more trial and error sessions ahead! That's what "advanced" scenery designing is all about...:D

Jeff
 
Back
Top