FSDeveloper Community

Go Back   FSDeveloper Community > Microsoft Flight Simulator development > Scenery Design - 3D Objects > GMax and 3DS Max

GMax and 3DS Max Use this forum to discuss your GMax and 3DS Max problems

Reply
 
Thread Tools Display Modes
  #1  
Old 03 May 2012, 15:40
AeroFiles's Avatar
AeroFiles AeroFiles is offline
  faroeislands
Location: Toftir
Join Date: May 2009
Posts: 292
Send a message via Skype™ to AeroFiles
gmax fs9 attach point tool

I can't use the attach point tool in gmax for fs9.
is there some place to download it?
in fsx verson it works fine.
__________________
Creator of: Billund Airport FSX and FS9
Now Making: Ottawa Airport FSX and Vagar Airport FSX remake.
Reply With Quote
  #2  
Old 03 May 2012, 18:48
JRobinson JRobinson is offline
  unitedstates
Location: -
Join Date: Aug 2007
Posts: 560
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.

In the past you had to click "MaxScript > Run Script" and then navigate to gmax\gamepacks\fs2004\scripts and load "AttachToolGmax.ms" to attach anything to an FS9 model. This approach seems to still work with my installation anyway so maybe it will work for you as well?

Jim
Reply With Quote
  #3  
Old 04 May 2012, 08:22
AeroFiles's Avatar
AeroFiles AeroFiles is offline
  faroeislands
Location: Toftir
Join Date: May 2009
Posts: 292
Send a message via Skype™ to AeroFiles
Does not work for me.
It wants me to find the attach point tool which I find.
It then wants me to navigate to teh Effects folder of fs9.

Then the attach point tool opens but when I click remove crash boxes I get the error, Unknown property 'name' in undefined.



Code:
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
__________________
Creator of: Billund Airport FSX and FS9
Now Making: Ottawa Airport FSX and Vagar Airport FSX remake.

Last edited by AeroFiles; 04 May 2012 at 08:25.
Reply With Quote
  #4  
Old 04 May 2012, 16:42
JRobinson JRobinson is offline
  unitedstates
Location: -
Join Date: Aug 2007
Posts: 560
I've never used the attach tool to remove crash boxes, but I just tried it and got no errors. I initially tried to remove the crash box from [object]_LOD_100 and got a warning telling me not to attach nocrash to my main objects because it would "blow them away", but then I renamed it [object] instead, and was allowed to attach the nocrash without incident.

There's an "AttachTool.doc" in gmax\gamepacks\fs2004\docs, nocrash is explained on page 13, looks like a PITA to me. It appears it's purpose is to remove crash boxes from part of the geometry where you'd keep the crash boxes on the remaining geometry (i.e. a platform). IIRC you can specify nocrash globally in the makemdl.cfg.

Your maxscript appears to be identical to mine from a quick glance of the first few lines.

I use MCX to remove crash boxes from my FSX models, in fact it's a fixed setting in MCX, and I remove crash boxes from every model I process through it (because I once gained several FPS when I removed crash boxes from a vegetation object that I'd placed hundreds of times).

Jim
Reply With Quote
  #5  
Old 04 May 2012, 20:53
n4gix n4gix is offline
  unitedstates
Location: Hammond, Indiana
Join Date: Sep 2006
Posts: 8,528
Quote:
Originally Posted by JRobinson View Post
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.
Jim, in that case it would appear that you've not kept your GMax gamepack folder structure such that each version's tools are isolated from each other as they must be...
Quote:
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
Notice that I have four separate folders for GMax, and four separate Desktop Icons to load GMax configured to use only one Gamepack folder.
__________________
Bill Leaming
3d Modeler Max/GMax
C & XML Gauge Programmer
Eaglesoft Development Group
http://eaglesoftdg.com

Intel® Core™ i7-3770k 4.2GHz - Crucial 16GB DDR3 - Dual Radeon HD770 1GB DDR5 (Crossfire) - Eco II Watercooling - Win7 64bit
Intel® Core™ i7-2600k 3.4GHz - Crucial 4GB DDR3 - NVIDIA GeForce GTX550Ti 1GB - Win7 64bit
Intel® Core™ i7-860 2.8GHz - Crucial 8GB DDR3 - NVIDIA GeForce GTS240 1GB - Win8 64bit
NOTE: Unless explicitly stated otherwise, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...
Reply With Quote
  #6  
Old 04 May 2012, 22:44
JRobinson JRobinson is offline
  unitedstates
Location: -
Join Date: Aug 2007
Posts: 560
Thanks Bill, actually I didn't install the FS9 gamepack, I copied the FS2002 and FS2004 gamepack installations from my old XP machine so maybe that's the problem. Here's what my directory structure looks like:

Code:
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
The "target" field of my FS2004 shortcut looks like this:

%GMAXLOC%Gmax.exe -i gamepacks\FS2004\gmax.ini -p gamepacks\FS2004\plugin.ini

Do you have the following files in gmax\ui\macroscripts BTW? These are the only files I'm finding outside of the gamepacks folder that appear to be FS related and they show today as their file date, nearly every other file in the gmax directory has a file date of 11/1/2002.

Tools-AnimationManager.mcr
Tools-AttachPointTool.mcr
Tools-FSCloudTool.mcr
Tools-LODNameTool.mcr

How they got there I have no clue, they aren't present in the "Microsoft Flight Simulator X SDK\SDK\Environment Kit\Modeling SDK\FSX_GmaxGamePack" folder which I copied directly into the gmax folder. They appear to be responsible for the FSTools menu in FS20004, and if I try to use these tools, I get a "-- No ""+"" function for undefined" error with what appears to be the exact code from the respective .mcr script displaying in a small window beneath the error alert.

Also, on very rare occasions I've noticed the FSX version will load without the FSTools menu, but that's only happened once or twice and closing & re-starting gmax has always taken care of that problem. Either way, both gamepacks seem to work correctly with the exception of the FSTools menu in FS9. I've got all the FSX material options for FSX, standard & multi-materials only for FS9, and oddly enough the FSTools menu isn't there when running the FS2002 gamepack, however I haven't exported anything for FS2002 since moving to Win7 so don't know if that one works correctly or not (don't really care, if you know what I mean ).

Guess I should delve deeper and see why I have an FSTools menu for FS9, honestly I hadn't even noticed prior to seeing this thread. I'm leaning towards "If it ain't broke, don't fix it", lol.

(...oh, and the BGLC_SDK is something I put there myself long ago, it's not necessarily supposed to be there)

Jim
Reply With Quote
  #7  
Old 05 May 2012, 16:41
n4gix n4gix is offline
  unitedstates
Location: Hammond, Indiana
Join Date: Sep 2006
Posts: 8,528
Okay, now I'm puzzled. I see now that even I have an "FS Tools" item on the top menu bar, and see the same "error message(s)" when attempting to use any of them.

Yes, I too have the same macroscripts in the C:\gmax\ui\macroscripts subfolder. I'm going to assume they were placed there during the installation of the FSX SDK, although for some reason my GMax-FS9 installation is calling for them from the FS Tools menu entry!

Since I've never had any occasion to use any of those "tools" in my FS9 aircraft modeling, I simply never even noticed the new menu entry!

My shortcut's Target is:
C:\gmax\gmax.exe -q -i gamepacks\FS2004\gmax.ini -p gamepacks\FS2004\plugin.ini

My plugin.ini is:
[Directories]
Standard gmax plug-ins=StdPlugs\
Additional gmax plug-ins=plugins\
FS2004=gamepacks\FS2004\plugins\
[Help]

In any case, I've now edited my Custom UI and removed the problematic "FS Tools" menu entirely. When I can make some time, I'll figure out how to create a Macroscript to generate a new "FS Tools" menu item with the only two FS9 scripts: Attachpoint and CloudShapes...
__________________
Bill Leaming
3d Modeler Max/GMax
C & XML Gauge Programmer
Eaglesoft Development Group
http://eaglesoftdg.com

Intel® Core™ i7-3770k 4.2GHz - Crucial 16GB DDR3 - Dual Radeon HD770 1GB DDR5 (Crossfire) - Eco II Watercooling - Win7 64bit
Intel® Core™ i7-2600k 3.4GHz - Crucial 4GB DDR3 - NVIDIA GeForce GTX550Ti 1GB - Win7 64bit
Intel® Core™ i7-860 2.8GHz - Crucial 8GB DDR3 - NVIDIA GeForce GTS240 1GB - Win8 64bit
NOTE: Unless explicitly stated otherwise, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...

Last edited by n4gix; 05 May 2012 at 17:12.
Reply With Quote
  #8  
Old 06 May 2012, 03:49
JRobinson JRobinson is offline
  unitedstates
Location: -
Join Date: Aug 2007
Posts: 560
I moved those four files out temporarily, then I statrted the FSX gamepack and it put them all right back again so apparently there's something in one of the FSX scripts that does that. What's really odd is that I double clicked gmax.exe in the root folder and it still loaded with an FSTools menu! Odder (is that a word?) still, is that the FSTools menu is absent when you start the FS20002 gamepack .

Oh well, works fine as it is so I think I'll just build some models, lol .


Always enjoy the discussion with ya Bill,

Jim
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with my slice plane tool? Gmax DeltaRomeo Modeling 6 22 Apr 2011 19:53
[FSXA] Empty Attach Tool jtanabodee GMax and 3DS Max 3 23 Jun 2010 22:06
[FSXA] Gmax Objects > Object Placement Tool brown_baer GMax and 3DS Max 7 30 Apr 2010 21:56
gmax attachment tool sunnlite GMax and 3DS Max 6 16 Aug 2006 16:54
Attach Point question... Rick Tobin GMax and 3DS Max 4 12 Jan 2005 14:31


All times are GMT -4. The time now is 15:20.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.