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

Handy Maxscript for effects...

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
The only thing Nick did not mention is that you have to click the MAXScript menu in GMax and then select "Run script", after which you can browse for the script file. But those menu names are quite obvious :D.

LOL! Thanks Arno. Sometimes even I miss the "blindingly obvious..." :cool:

Also, perhaps it should be mentioned that you have to actually place the script in the \scripts folder in your gamepack's sub-folder... :D
 
Messages
40
Does this also work in bgl files that have been modified to become 2D objects by changing the ASM code?
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi,

This script works in GMax, so that means it is before you export to MDL/BGL file.

When placing effects you do not have to use the tweaks for ground polygons either, so I think you should just export as normal MDL file with the effects placed. And do a seperate export selected for the ground polygons so you can tweak their code.
 

jtanabodee

Resource contributor
Messages
3,921
Country
thailand
Hi everyone,
I just read about this and wondering if it can be use with objects. Like an elevated highway with light in the middle of the high way.
Best Regards,
jtanabodee
 
Messages
1,101
Country
unitedkingdom
Thanks everso much for this script,
two questions, when the effect is placed, how big does the box have to be,
And does GMAX produce a effect file: EG. .fx file?

Thanks in anticipation!

Piran
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
I just read about this and wondering if it can be use with objects. Like an elevated highway with light in the middle of the high way.

Yes, should be possible as long as you place the dummy box at the right altitude.
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
Messages
32,883
Country
netherlands
Hi Piran,

when the effect is placed, how big does the box have to be

No, that does not matter. It is just a dummy object. The origin of the object is used for the position of the effect.

And does GMAX produce a effect file: EG. .fx file?

No, you have to select the existing FX file you want to use.
 
Messages
107
Country
vietnam
I don't know how to create the effect file .
After create the box and convert it to Editable Mesh . What's next ??? Please explain me the detail (how fool am I :confused:)
Thanks
 
Messages
107
Country
vietnam
Fs2004

Hi, I'm using FS2004
I used the Script and followed this article for creating a runway edge lights
http://www.fsdeveloper.com/wiki/index.php?title=Apron_lighting_using_effects_and_GMax

But when I exported to .MDL file (FS2004 gamepack) and compiled to .BGL file via FS2k2 Makemdl, I didnt see the light in FS (attached image) :confused:

Here is the edited script :
Code:
strAttachNumber = 0
           for obj in $box* do
           (
           	obj.name = ("attachpt_rwylights" + (strAttachNumber as string))
           	strBufferText = ("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?> <FSMakeMdlData version=\"9.0\"><Attachpoint name=\"attachpt_rwylights" + (strAttachNumber as string) + "\"> <AttachedObject> <Effect effectName=\"fx_navwhi\" effectParams=\"\"/> </AttachedObject> </Attachpoint></FSMakeMdlData>")
           	setUserPropBuffer obj strBufferText
           	strAttachNumber += 1
           )
Please help me, thanks .
 

Attachments

  • rwyedge_light.jpg
    rwyedge_light.jpg
    93.8 KB · Views: 516
Messages
337
Country
ireland
Hi,

This is the method I use for all my Eiresim Scenery's.

First off though you will have to rename all your boxes "day" and then clone all these and call them "night"

You can actually write a script to do this automatically in gmax instead of renaming them all one by one.

The reason you will have two is that you need to create one set for day/night and another for dawn/dusk and the above is the easiest method.

Ok once the above is done save your gmax file and then run the following scripts

For dawn/dusk:

strAttachNumber = 0
for obj in $day* do
(
obj.name = ("attachpt_rwylights" + (strAttachNumber as string))
strBufferText = ("<?xml version=\"1.0\"
encoding=\"ISO-8859-1\" ?> <FSMakeMdlData
version=\"9.0\"><Attachpoint name=\"attachpt_rwylights" +
(strAttachNumber as string) + "\"> <AttachedObject> <Effect
effectName=\"fx_navwhi\" effectParams=\"DAWN=1;DUSK=1\"/>

</AttachedObject> </Attachpoint></FSMakeMdlData>")
setUserPropBuffer obj strBufferText
strAttachNumber += 1
)



and then for day/night:


strAttachNumber = 0
for obj in $day* do
(
obj.name = ("attachpt_rwylights" + (strAttachNumber as string))
strBufferText = ("<?xml version=\"1.0\"
encoding=\"ISO-8859-1\" ?> <FSMakeMdlData
version=\"9.0\"><Attachpoint name=\"attachpt_rwylights" +
(strAttachNumber as string) + "\"> <AttachedObject> <Effect
effectName=\"fx_navwhi\" effectParams=\"DAY=0;NIGHT=1\"/>

</AttachedObject> </Attachpoint></FSMakeMdlData>")
setUserPropBuffer obj strBufferText
strAttachNumber += 1
)




Terry
 
Messages
107
Country
vietnam
Dear Terry,
Thanks a lot . I have a question . I dont know about the way to rename all boxes into "day", and "night" using the script or...???

Another question : Because I dont want edit a coordinate from .XML file for using my lights as object library, then I export the .MDL file to .BGL by using FS2k2 makemdl.exe (my lights will put exactly based on my ground/apron polygons) . Is it a right way ???
I'll edit the script as you said .
Regards
 
Last edited:
Messages
337
Country
ireland
To rename all the boxes just use this below (edit to your desire)..Mine renames anything called "day" to "hello"

strAttachNumber = 0
for obj in $day* do
(
obj.name = ("hello" + (strAttachNumber as
string))

)


For these lights please use the fs2004 gamepack. Just place your boxes/lights in gmax, run the scripts and export.
 
Messages
107
Country
vietnam
Hi again Terry,
Thanks a lot, I tried more and it worked :)
I consider the fx_navwhi.fx turn my lights to BLUE, with runway edge lights, I want to chose WHITE color, which fx file in FS's Effect folder should I select and how to make them brighter ???

Attached file
 

Attachments

  • rwyedge_light_1.jpg
    rwyedge_light_1.jpg
    43.6 KB · Views: 532
Last edited:
Messages
290
Country
germany
Just one thing i want to talk about.

I used this script to ad the attachpoint settings to the dummys, in my case spheres cause the pivot is allready centered (modified the script to work with spheres).
Then i exported to .x and then to mdl via xtomdl (3dsmax), but when i quickly viewed the model via ModelConverterX i saw no attachpoints. So i compared the properties with the one in a gmax file that i have and found a differents.

This script adds: "<?xml version="1.0" encoding="ISO-8859-1" ?>..... ", but in the example i saw: "FSXML = <?xml version="1.0" encoding="ISO-8859-1" ?>...".
So the FSXML was missing. When i add this couple of signs the attachpoint shows up in MCX.

So for FSX i should add this to the script?
 
Messages
32
Country
turkey
hi I use 3dsmax7

now

I edit effectboxwriter.ms in notepad and

strAttachNumber = 0
for obj in $box* do
(
obj.name = ("attachpt_Ltcewh" + (strAttachNumber as string))
strBufferText = ("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?> <FSMakeMdlData version=\"9.0\"><Attachpoint name=\"attachpt_Ltcewh" + (strAttachNumber as string) + "\"> <AttachedObject> <Effect effectName=\"Ltcewh\" effectParams=\"DAWN=1;DUSK=1\"/> </AttachedObject> </Attachpoint></FSMakeMdlData>")
setUserPropBuffer obj strBufferText
strAttachNumber += 1
)

* ı create effect and rename "Ltcewh"

3DSMAX
* create box 0.30m, 0.30m, 0.30m
* right click convertto mesh
* select box and maxscript > run script > effectboxwriter.ms
* box autorename "attachpt_Ltcewh"
* aces tool > export lod > edit,create and export "ltcewh.X" file and drop it xtomdl
* library creator > new library > add mdl > "ltcewh.mdl"
* generate library "fspath\addon scenery\myscenery\scenery"

parse complete!

now

* I start FSX
* run object placament tool
* ADD > scenery > ltcewh add but no effect :(

what problems
 
Messages
290
Country
germany
When you right klick on the box(attachpoint) in 3ds max and choose Object Properties, what does it state under "User Defined"?

And mybe you also post your Effect, maybe there is the problem
 

jtanabodee

Resource contributor
Messages
3,921
Country
thailand
I know this script for a long time. But this is the first time I try to use it.
In my airport, VTBS, there are 1366 taxi light pole and I have made all the poles already. The frame rate was 28-32. After I do all the attachments and import to the FSX, the frame rate drop by half to 17. Is that normal? Did I do something wrong? Do I need to do anything else?
 
Messages
6
Country
austria
This script helped me a lot but since i already had lots of different names applied to my objects and didnt want to rename them all i changed the script a bit to add the effects to all selected objects regardless of their names. I thought i share it here as well in case someone is in the same situation i was in. If someone else already uploaded something like this here please appologize for uploading the same thing again.
 

Attachments

  • EffectMultipleBoxesAnyName.zip
    502 bytes · Views: 265

nickw

Administrator
Staff member
Messages
694
Country
ireland
Wow. This thread lit up when I left to raise the kids. Seems it's still doing well.

I've missed this stuff

New Flight Sim coming. Exciting times.
 
Top