How to make a unanimation modelpart clickable

#1
Hi,Everyone!I want to change some of the switches that I can't click. I know that I need to use AttchTool, but I can't find it in my SDK. I found their "name" in INIT.xml. (What does this mean? What should I do to achieve my goal?Help much apperaciated!
 

tgibson

Resource contributor
#2
You can use ModelConverterX. I think the Hierarchy Editor can make a part clickable by clicking the Mouse Rectangle section and choosing from the list.
 
Last edited:

tgibson

Resource contributor
#4
In the Hierarchy Editor you can highlight selected parts in red. It has to turn red at some point if it's in there.

If it's combined with other parts, setting CollapseModelParts to FALSE in the Options might separate it. You will need to Import it again after setting that.
 
#5
In the Hierarchy Editor you can highlight selected parts in red. It has to turn red at some point if it's in there.

If it's combined with other parts, setting CollapseModelParts to FALSE in the Options might separate it. You will need to Import it again after setting that.
Hi,Tgibson!Thanks for your help!But I still can't find it in the HAIRARCHY editor. If there is no code for these switches, what do these names mean?
 

tgibson

Resource contributor
#6
The entries in the drop down box for the Mouse Rectangle line are located in the modeldef.xml file (the one that you pointed MCX to in the Options). If there is not an appropriate definition there, you would have to add one of your own to that file.
 
#7
Hi,tgibson!Yes, I did not find these definitions in the modeldef. I think I can add this code by modifying the modeldef in the SDK. How do I edit this code?
 

tgibson

Resource contributor
#8
1. Copy a section from PartInfo to /PartInfo that has code similar to what you want.
2. Paste it back in between parts.
3. Give it a new Name.
4. Edit the code as required.
5. If this is for an animation, copy a line like this (simple visibilities do not need this):

<Animation name="lever_trimtab_aileron_key" guid="d603198d-182b-46cd-a15b-bf862dc37195" length="100" type="Sim" typeParam2="lever_trimtab_aileron_key" typeParam="AutoPlay" />

6. Paste it back just above the part you made.
7. Change the names in quotes to the name you just created in step 3 (two places).
8. Change the GUID - either use an online GUID generator or just change a number or two in this one (do not add or delete characters).
9. Check if the new GUID is unique in this file (Edit/Find).

Hope this helps,
 
#9
1. Copy a section from PartInfo to /PartInfo that has code similar to what you want.
2. Paste it back in between parts.
3. Give it a new Name.
4. Edit the code as required.
5. If this is for an animation, copy a line like this (simple visibilities do not need this):

<Animation name="lever_trimtab_aileron_key" guid="d603198d-182b-46cd-a15b-bf862dc37195" length="100" type="Sim" typeParam2="lever_trimtab_aileron_key" typeParam="AutoPlay" />

6. Paste it back just above the part you made.
7. Change the names in quotes to the name you just created in step 3 (two places).
8. Change the GUID - either use an online GUID generator or just change a number or two in this one (do not add or delete characters).
9. Check if the new GUID is unique in this file (Edit/Find).

Hope this helps,
Hi,tgibson!Thanks for your help again!If it doesn't have animations, then I only need to make the first four steps in modeldef.xml, right?
 
#11
Correct, if it only has a Visibility section and no Animation section.
Hi,tgibson!Oh. . My God, I found that I seem to be mistaken, I have nothing to gain after adding the code, I think the original model does not have the corresponding ATTCHPOINT for these switches.
 

tgibson

Resource contributor
#13
Hi,

You do not need an attachpoint to make a part clickable. In the image below I chose the fire handles (which do nothing in my VC) and added the Mouse Rectangle switch_landing_light:

dc6b_vc_mouserect_mcx.jpg


When I load the VC into FSX, I can click on the fire handles and the landing lights turn on and off:

dc6b_vc_mouserect.jpg


There is no attachpoint at the fire handles.

Note that if your code does not include a MouseRect section that part will not be clickable. Also, if you *only* have a MouseRect section I'm not sure that works? I've never tried it though.

Hope this helps,
 
Last edited:
#15
Hi,

You do not need an attachpoint to make a part clickable. In the image below I chose the fire handles (which do nothing in my VC) and added the Mouse Rectangle switch_landing_light:

View attachment 46173

When I load the VC into FSX, I can click on the fire handles and the landing lights turn on and off:

View attachment 46174

There is no attachpoint at the fire handles.

Note that if your code does not include a MouseRect section that part will not be clickable. Also, if you *only* have a MouseRect section I'm not sure that works? I've never tried it though.

Hope this helps,
Yes, but I couldn't find the relevant modelpart in HAIRARCHY EDITOR. After I edited the code, I still couldn't find it.Here is the code I edited I n the modeldef.xml
<PartInfo>
<Name>L:F22_SW_FLCS_BIT</Name>
<MouseRect>
<Callbackcode>
3 (&gt;K:APU_EXTINGUISH_FIRE)
</Callbackcode>
</MouseRect>
</PartInfo>
 

tgibson

Resource contributor
#16
Are saying you clicked on every part in the Hierarchy Editor and it never turned red? Even when you clicked the SceneGraphNode at the very top?
 
Top