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.


Welcome to MAXScript.
-- Error occurred in attachNocrash()
-- Frame:
-- Error occurred in attachNocrash()
-- Frame:
Found it in: gmax\gamepacks\fs2004\scripts and load "AttachToolGmax.ms" as mentioned by you
This is how the script looks like:
--Set up Flightsim Effects Directory
fsRoot = getSavePath caption:"Flightsim Effects Directory"
if fsRoot == undefined then
(
fsRoot = "C:\\Program Files\\Microsoft Games\\Flight Simulator 9\\Effects\\"
)
--Set up Rollouts
attachTool = newRolloutFloater "Attach Point Tool!" 300 400
Rollout extraRollout "Attach params:"
(
)
Rollout extraRollout2 "Attach Objects:"
(
)
--Set up array function
objArray =#()
fn fixArrayNames objArray =
(
for i = 1 to objArray.count do
(
objName = getFileNameFile objArray[i]
objArray[i] = objName
)
)
--Set up array of effects
effectsList = getFiles (fsRoot + "\\*.fx")
insertItem "None" effectsList 1
fixArrayNames effectsList
--Set up function to attach names
attachType = "attachpt_"
attachName = "Default"
attachText = "Default"
fn attachPart attachType attachName attachText =
(
if $ == undefined then
(
messagebox "Please select an object to use as attach point"
return false
)
if skipToString ($.name as stringstream) (getfilenamefile maxfilename) != undefined then
(
messageBox "Please do not attach to your main objects, this will blow them away."
return false
)
fullXML = ("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?> <FSMakeMdlData version=\"9.0\">" + attachText + "</FSMakeMdlData>")
setUserPropBuffer $ fullXML
$.name = (attachType + attachName)
)
--Get GUID from GUID to names.txt
fn getGUID objName fullObjectName =
(
fileIn = openFile (fsRoot + "\\tools\\utils\\bin\\GUID_to_names.txt")
skipToString fileIn fullObjectName
skipToString fileIn "0"
objectGuid = readLine fileIn
objGUID = ((substring objectGUID 1 8) + (substring objectGUID 12 8) + (substring objectGUID 23 8) + (substring objectGUID 34 8))
attachText = ("<Attachpoint name=\"attachpt_" + objName + "\"> <AttachedObject> <LibraryObject name=\"" + objGUID + "\" scale=\"1.0\"/> </AttachedObject> </Attachpoint>")
attachPart "attachpt_" objName attachText
)
--Main Rollout tool
Rollout attachRollout "Attach!"
(
radiobuttons attachTypes "Attach Type:" labels:#("Effect","Object","Platform","Empty","No Crash") columns:1 default:0
on attachTypes changed attachNewState do
(
removeRollout extraRollout attachTool
removeRollout extraRollout2 attachTool
if attachTypes.state == 1 then
(
Rollout extraRollout "Attach Effect"
(
edittext effectName "Effect Name:" fieldWidth:200
dropdownlist attachedEffect "Effect to attach:" items:effectsList height:30
edittext effectParams "Effect Params:" fieldwidth:180 height:100
button attachEffect "Attach an Effect!"
on attachEffect pressed do
(
attachText = ("<Attachpoint name=\"attachpt_" + effectName.text + "\"> <AttachedObject> <Effect effectName=\"" + attachedEffect.selected + "\" effectParams=\"" + effectParams.text + "\"/> </AttachedObject> </Attachpoint>")
attachPart "attachpt_" effectName.text attachText
)
)
addRollout extraRollout attachTool
)
if attachTypes.state == 2 then
(
Rollout extraRollout "Attach Library Object"
(
edittext objectName "Object Name:" fieldWidth:200
edittext attachedCustom "Custom GUID:" fieldwidth:200
button attachCustom "Attach an object!"
on attachCustom pressed do
(
attachText = ("<Attachpoint name=\"attachpt_" + objectName.text + "\"> <AttachedObject> <LibraryObject name=\"" + attachedCustom.text + "\" scale=\"1.0\"/> </AttachedObject> </Attachpoint>")
attachPart "attachpt_" objectName.text attachText
)
)
addRollout extraRollout attachTool
)
if attachTypes.state == 3 then
(
Rollout extraRollout "Set up a platform!"
(
edittext platformName "Platform Name:" fieldwidth:180
dropdownlist surfaceType "Surface Type:" items:#("CONCRETE","GRASS","WATER","GRASS_BUMPY","ASPHALT","SHORT_GRASS","LONG_GRASS","HARD_TURF","SNOW","ICE","URBAN","FOREST","DIRT","CORAL","GRAVEL","OIL_TREATED","STEEL_MATS","BITUMINUS","BRICK","MACADAM","PLANKS","SAND","SHALE","TARMAC","WRIGHT_FLYER_TRACK","last") height:30
button createPlatform "Create a platform!"
on createPlatform pressed do
(
attachText = ("<Platform name=\"platform_" + platformName.text + "\" surfaceType=\"" + surfaceType.selected + "\" /> <NoCrash/> ")
attachPart "platform_" platformName.text attachText
)
)
addRollout extraRollout attachTool
)
if attachTypes.state == 4 then
(
Rollout extraRollout "Attach beacon or other empty!"
(
edittext emptyName "Name of empty:" fieldwidth:100
button attachBeacon "Attach an empty!"
on attachBeacon pressed do
(
attachText = ("<Attachpoint name=\"attachpt_" + emptyName.text + "\"> </Attachpoint>")
attachPart "attachpt_" emptyName.text attachText
)
)
addRollout extraRollout attachTool
)
if attachTypes.state == 5 then
(
Rollout extraRollout "Remove Crash Boxes from object!"
(
button attachNocrash "Remove Crash Boxes!"
on attachNocrash pressed do
(
attachText = ("<NoCrash/>")
attachPart "" $.name attachText
)
)
addRollout extraRollout attachTool
)
)
)
addRollout attachRollout attachTool


One thing I just noticed is that for some reason since the installation of the FSX gamepack I now have an "FSTools" option on the menu bar which was never there in the FS2004 version previously and it doesn't work with the FS2004 gamepack.
Notice that I have four separate folders for GMax, and four separate Desktop Icons to load GMax configured to use only one Gamepack folder.Directory of C:\gmax\gamepacks
01/28/2010 06:06 PM <DIR> fs2002
01/28/2010 06:11 PM <DIR> fs2004
05/07/2009 07:14 PM <DIR> fs2004_scenery
04/07/2010 11:49 AM <DIR> FSX_GmaxGamePack

C:\MSFS\gmax\gamepacks\fs2002
C:\MSFS\gmax\gamepacks\fs2004
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack
C:\MSFS\gmax\gamepacks\fs2002\FS2002_SDK
C:\MSFS\gmax\gamepacks\fs2002\images
C:\MSFS\gmax\gamepacks\fs2002\plugins
C:\MSFS\gmax\gamepacks\fs2002\scenes
C:\MSFS\gmax\gamepacks\fs2002\scripts
C:\MSFS\gmax\gamepacks\fs2002\texture
C:\MSFS\gmax\gamepacks\fs2002\FS2002_SDK\BGLC_SDK
C:\MSFS\gmax\gamepacks\fs2004\docs
C:\MSFS\gmax\gamepacks\fs2004\extras
C:\MSFS\gmax\gamepacks\fs2004\plugins
C:\MSFS\gmax\gamepacks\fs2004\scenes
C:\MSFS\gmax\gamepacks\fs2004\scripts
C:\MSFS\gmax\gamepacks\fs2004\texture
C:\MSFS\gmax\gamepacks\fs2004\tools
C:\MSFS\gmax\gamepacks\fs2004\scenes\texture
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\Plugins
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\scenes
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\scripts
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\textures
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\scenes\Clouds
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\scenes\Oil_Rig_Sample
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\scripts\startup
C:\MSFS\gmax\gamepacks\FSX_GmaxGamePack\textures\DDSFiles

