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

FS2004 help with maxscript for hangar

Messages
92
Country
us-colorado
I'm attempting to script some of my monotonous work (basically the purpose of scripting) using GMax and maxscript. The first task I was looking to script was taking a box that I previously created and sized and turning that box into a simple hangar shape with its sides UVW Mapped, unwrapped and ready for copy/pasting into photoshop. Step 1 of this script would be to transform the box into the hangar shape. The method I learned to do this:
1. With box highlighted, convert box into editable poly.
2. Go to polygon selection mode (make sure Edged Faces selected by right-clicking on Perspective viewport) and select the box's top.
3. On Modify menu, enter value for Extrusion and select Extrude button to add a new extrusion on top of the box. This will become the roof.
4. Change to Vertex selection mode and highlight the 2 top vertices and select Collapse. Repeat for other top 2 vertices to create roof shape.
5. Change into polygon selection mode and scroll to bottom of Modify menu (under Surface Properties) to change the material IDs for the two new triangles on each peak of the roof from 1 (which is the roof's material ID) to match the material ID for the front and back of the hangar.
6. Delete the bottom poly (since it won't be needed nor textured).

Part II of my script would be to exit from polygon mode, select Modifier List dropdown-UVW Map and then Unwrap UVW. Select Edit button on Parameters menu to open Edit UVWs dialog. Select each side, then move to a designated spot for copy/paste into photoshop.

I tried to use the Macro Recorder to convert my actions to maxscript. For part I above, this is the result:
convertTo $ PolyMeshObject
$.useSubdivisionDisplacement = off
$.displaceSplitMesh = on
$.displaceMethod = 3
$.displaceSteps = 2
$.displaceEdge = 20
$.displaceDistance = 20
$.displaceAngle = 10
$.viewDependent = off
subobjectLevel = 4
select $.baseObject.faces[#{1}]
subobjectLevel = 1
set coordsys world
select $.baseObject.verts[#{9..10}]
select $.baseObject.verts[#{10..11}]
subobjectLevel = 4
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
select $.baseObject.faces[#{}]
actionMan.executeAction 0 "40020"

After saving the script and creating a new box to convert, I received unknown property errors for all of the $.baseObject.faces[#{}] lines of code. I also noticed that maxscript doesn't seem to see the values I enter in for the extrusion nor the face values. Is this a lost cause with maxscript? Does it not have the granularity to accomplish tasks like this? I could try to use autoit, but wanted to try maxscript first.
Thanks,
Eric
 
I'm not sure why it came out like that. When I recreated the script using macrorecorder, I got better numbers for those lines:
select $.baseObject.verts[#{11..12}]
select $.baseObject.verts[#{9..10}]

Those vertices correspond to the ones being collapsed making the roofline.
Eric
Edit: Still didn't work though
 
Last edited:
Back
Top