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

FSDS - scenery lights and pre-process problems

Messages
69
Country
scotland
Hi all,

I recently upgraded FSDS to V3, and have mastered the rather tortuous taks of getting FSDS objects into FS2004 via XML (rather than via SCASM as in the past).

I am making scenery objects, some stationary, some moving, and using Sbuilder to place the objects.

V3 has no zbias on parts, but I eventually worked out that decals could still be done (add a new DECAL_ texture).

However, I can't get lights to show - and pre-processing has now become an unsupported add-on.

Previously, if parts were called light_beacon they showed up as point light sources, but now (according to the MakeBGL readme) you need to make the material name LIGHT_BEACON to get this effect ... but I've done that and my lights don't show (any time).

Also, I previously used pre-processing to get lights to be off in the daytime and on otherwise, but this is now not supported - how do I re-enable the pre-processing?

Considering the original FSDS object and the final FS2004 object are still the same, all this aggro seems rather un-necessary!

Thanks for any hints on how to solve these upgrade problems.


Iain.
 
Last edited:
Hi Iain,

V3 has no zbias on parts, but I eventually worked out that decals could still be done (add a new DECAL_ texture).

Not 100% sure for FSDS, but MakeMDL does support using zbias, you need to use it as a prefix in the material name (at least that is how you set it in GMax, not sure if the FSDS generated X files work the same).

Previously, if parts were called light_beacon they showed up as point light sources, but now (according to the MakeBGL readme) you need to make the material name LIGHT_BEACON to get this effect ... but I've done that and my lights don't show (any time).

There is a bug in MakeMDL that adds some aircraft specific code around such lights, which causes them to never show. My MDL Tweaker tool has an option to fix that bug. But like I mentioned above, I am not sure if this works with FSDS, I have only tested it with GMax MDL files. If you can send me a MDL file that should have a light made with FSDS I can test it if you like.

Also, I previously used pre-processing to get lights to be off in the daytime and on otherwise, but this is now not supported - how do I re-enable the pre-processing?

No, unfortunately MakeMDL does not support such conditions. So to get those results you will have to hand tweak the ASM source files a little bit.
 
Hi Arno,

Thanks for your reply.

Not 100% sure for FSDS, but MakeMDL does support using zbias, you need to use it as a prefix in the material name (at least that is how you set it in GMax, not sure if the FSDS generated X files work the same).

Yes, this does work the same in FSDS.

There is a bug in MakeMDL that adds some aircraft specific code around such lights, which causes them to never show. My MDL Tweaker tool has an option to fix that bug. But like I mentioned above, I am not sure if this works with FSDS, I have only tested it with GMax MDL files. If you can send me a MDL file that should have a light made with FSDS I can test it if you like.

I have attached a MDL - both tweaked and untweaked - but neither show lights correctly in FS ... the object is a ship with four navigation lights. See if you can make anything of it.

No, unfortunately MakeMDL does not support such conditions. So to get those results you will have to hand tweak the ASM source files a little bit.

I am experienced in API hand-editing, but with FSDS MDL output, there is no API or ASM code to edit, everything is a MDL or BGL file. I note that MDLtweaker can output ASM code (I can see my four lights in there!) but this code can't then be reconverted to a MDL. It would be fine if FSDS3 still offered ASM code output!

Many thanks for your help,


Iain.
 

Attachments

Hi again,

Using info from Rhumbafloppy in an old thread, I have successfully added a light MDL to my library, and can get it display in FS OK.

However, it is mentioned that the light can be "attached" to another MDL, which is what I want to do - add nav lights to a ship object - but how do I specify the attachment of the light MDL to the ship MDL?

Thanks,


Iain.
 
Hi Iain,

I have attached a MDL - both tweaked and untweaked - but neither show lights correctly in FS ... the object is a ship with four navigation lights. See if you can make anything of it.

Thanks, I'll take a look at them. Hopefully I can learn some things about the FSDS structure of the MDL files from it.

I note that MDLtweaker can output ASM code (I can see my four lights in there!) but this code can't then be reconverted to a MDL. It would be fine if FSDS3 still offered ASM code output!

That function in MDL Tweaker is not really finished yet indeed, I mainly used it to debug the tweaks. But you can save the ASM code for FSDS as well, you just need to tell MakeMDL to save the sources automatically. That can be done by creating a makemdl.cfg file that contains the option Keep=1. Due to the way FSDS compiles, the ASM files are saved in the FSDS root as _temp.asm.

However, it is mentioned that the light can be "attached" to another MDL, which is what I want to do - add nav lights to a ship object - but how do I specify the attachment of the light MDL to the ship MDL?

I have no idea how this can be done in FSDS. In GMax attaching object can be done with a special script. This enters some code in the properties of the object that MakeMDL then uses to create the proper code. But I have no idea if FSDS can also add this special code.
 
Last edited:
Hi Arno,

I've done some more experimentation in FSDS V3 and got a result!

With reference to the material names (in the MakeMDL documentation), I have confirmed that creating a part with material name LIGHT_NAV_red, LIGHT_STROBE_pink etc. works (i.e. creates a bright dot) except for LIGHT_BEACON which appears to do nothing (this was the one I was using before)! LIGHT_TAXI and LIGHT_LAND produce beams, and LIGHT_STROBE flashes.

In addition to creating the MDL from FSDS, I also have to run your MDLtweaker and do the BGL_LIGHT fix to get the lights to show, but they do work when I do that.

Now it would be nice to get the lights to go off during the day!

Many thanks for your help.


Iain.
 
Hi Iain,

In addition to creating the MDL from FSDS, I also have to run your MDLtweaker and do the BGL_LIGHT fix to get the lights to show, but they do work when I do that.

I did check the MDL files you attached and I assume they are using the LIGHT_BEACON option? The structure of the code is a little different there and this causes MDL Tweaker to not apply the tweaks correctly. So I will have to update that, so that these will also be working again in the future.

Now it would be nice to get the lights to go off during the day!

For the moment that is only possible when tweaking the ASM code manually (for example MDL Tweaker can only apply conditions to the entire object, not yet to parts of it). Did you try to capture the ASM files already, as I posted?
 
Hi Arno,

Yes, the code I sent contained LIGHT_BEACON, which I have since established is the only material that appears to not show as a light!

I have subsequently changed to use LIGHT_NAV, which also does not show right out of FSDS, but when tweaked with MDLtweaker it does show as a light dot OK.

I did look at the ASM files produced by MDLtweaker, but have not tried to re-assemble them. Now that LIGHT_NAV is producing lights OK direct from FSDS via MDLtweaker, I am happy with that!

Thanks again for your help.


Iain.
 
Hi Iain,

Yes, the code I sent contained LIGHT_BEACON, which I have since established is the only material that appears to not show as a light!

Yes, that is what I am saying. None of the lights work out of MakeMDL directly. But there is a bug in MDL Tweaker that causes it to not fix the BGL_BEACON correctly, while it fixes the others. So the fact that they do not show is due to the tweak in MDL Tweaker.

I did look at the ASM files produced by MDLtweaker, but have not tried to re-assemble them.

The code by MDL Tweaker does not compile. It was mainly put in as a debuggin tool for me. You need to ask MakeMDL to keep the files for you, as I explained in one of the posts above.
 
I have been successful in applying preprocessing conditions in FSDS3. I just finished up a set of 6 carriers and put Colregs (Rules of the nautical road)lighting on them, as well as runway, edge, and task lighting. Although the lighting doesn't compare to effects based lighting or rumbaflappy's bgl lighting, it's ok for the colregs stuff. The steps follow:

1. With the part selected, right click and go to Current Item Properties.
2. Name the part. I named Mine bright_light_beacon.
3. Select the "Material" button, and when the material list comes on click "Add" and select the color of your light. (since I always forget which is ambient, diffuse, etc, and the light will only be seen at night, I just make all the color blocks the same..lol). I set specular strength to 800. Title the color and press OK.
4. You should see your new color highlighted on the material list. Press OK again.
5. Below the Pre-Process dialog box, press "Add". The "Add Predraw Process" box appears. Pick "Condition".
6. To the right of the Condition Name box, select "Load Preset".
8. I use "Night" as this turns on the lights from dusk till dawn as required.
9. Press OK on the part Properties dialog box, and you're done.

You'll note that the preset conditions are pretty close to the conditions in Arno's Conditional Animation Tool, and it appears that you can use them in much the same way. Some work, some don't, at least I haven't been able to get them to. I'll keep on using Arno's CAT (thanks!). I used the CAT to animate the blast shields on the carriers so they will go down as the aircraft approaches them, and back up after the aircraft clears them.


Jim
 
Hi Jim,

Thanks for your comments. This is the same way that I've always added pre-conditions in FSDS V2 ... but they don't seem to work in V3 - the set-up within FSDS is the same, I just can't get the nav light to appear correctly in FSDS. If I don't use MDLtweak, the light are off all the time, if I use MDLtweak then the lights are on all the time, even if I put in a precondition.

How are you outputting/compiling the scenery? I am using FSDS MDL output (which uses MakeMDL), tweak with MDLtweaker then using Library Creator to make a library BGL from the MDLs.

Thanks for your suggestions.


Iain.
 
I used the FSDS .mdl output and placed the .mdl with Scenegenx. Note that FSDS apparently restricts the preconditions to one per .mdl. I tried to have a strobe and a regular light in the same model, but when it compiled, all the lights were on all the time. I think I ended up doing the colregs and edge lighting with FSDS and (as you did) the runway lights individually with a .mdl I made by compiling the BGLC9 code. I found a way to put the "Night" coding in prior to the compile in the forums here somewhere. I'll look it up when I get home and post it here if you'd like.

Jim Dhaenens
 
Hi Jim,
I found a way to put the "Night" coding in prior to the compile in the forums here somewhere. I'll look it up when I get home and post it here if you'd like.
That would be great - thanks. I've tried adding a "night" condition to one light, then making the other lights child parts of that light, but I just get all lights on all the time ... sigh!

The FSDS docs suggest that BGLC_9 needs to be in the equation somewhere for conditions to work, but doesn't elaborate at all.

Thanks again,


Iain.
 
Darn...cleaned my computer after the last project and lost ...temporarily at least the code, but here's the finished product:

Jim
 
Last edited:
The FSDS docs suggest that BGLC_9 needs to be in the equation somewhere for conditions to work, but doesn't elaborate at all.

That would be interesting. I guess that statement can only be true if FSDS3 is capable to create the ASM code itself (so without MakeMDL) and then compile that into a MDL object. This approach would indeed allow you to bypass some of MakeMDL's limitations. But I have never heard of FSDS being capable to do that.
 
An interesting possibility, Arno. You have to tell FSDS3 where BGLC9 is when you set it up. Is there any way for you to tell BGLC9 to keep it's files? The way FSDS3's script works, it wipes them all clean after the .mdl is made. I'd be very interested in seeing the output to see how it's making things happen.

Jim
 
Hi Jim,

BGLC_9 does not remove any of the files it uses, so it must be FSDS or MakeMDL that does that. For MakeMDL you will have to create a file called makemdl.cfg in the same folder as the EXE. If you put this text in the file, your ASM files are saved:

Code:
[Options]
Keep=1

So this is a way to keep the ASM files. It seems that FSDS3 always compiles in its own root older, to a MDL file called _temp.mdl. This is probably copied to the real destination afterwards. So you will also find the ASM files (_temp.asm and _temp_0.asm) in the FSDS root folder.

But as far as I know BGLC_9 is not involved in that process. Would be interesting to know where that one kicks in.
 
Hi Arno/Jim,

I have successfully captured the ASM file from MakeBGL (actually 2 files, a header and the main code) and have successfully assembled the ASM into a MDL using BGLC_9 - though I still have to MDLtweak the MDL to get the nav lights to show.

I have two questions:
- whatever MDLtweaker does to fix the lights in the MDL, can I apply that fix within the ASM code, so that I don't have to tweak the MDL?
- is there an example of ASM code to handle the day/night condition so that I can include this around the lights code?

Thanks for any suggestions on the above.

Regards,


Iain.
 
Hi Iain,

- whatever MDLtweaker does to fix the lights in the MDL, can I apply that fix within the ASM code, so that I don't have to tweak the MDL?

You need to remove the IFIN1/IFMSK commands that are placed around the lights by default. These use variables that only exist for aircraft and not for scenery. It is a bit hard to tell you exactly which lines to remove without seeing the code, as for example a flashing light still needs some of the lines to get it to flash.

- is there an example of ASM code to handle the day/night condition so that I can include this around the lights code?

Have a look at this article in the Wiki. It gives a very basic overview of how to use the IFIN1 command to add a condition. If you place the IFIN1 command around your lights, you should get the effect you want.
 
Hi Arno,

Brilliant! I used MDLtweak to output its own ASM files before and after tweaking, and compared them and saw the IFMSK. I also got the ASM IFIN1 code from the wiki, and SUCCESS - I've modified the ASM code produced by MakeMDL and got the lights to work correctly (off in daytime) without using MDLtweak.

So after a week of fiddling, and some excellent tips form this forum, I finally have my FSDS3 objects with working nav lights that are off in daytime and on otherwise - perfect!

Many thanks for all your help!

Regards,


Iain.
 
Back
Top