FSDeveloper Community

Go Back   FSDeveloper Community > Microsoft Flight Simulator development > Aircraft Design > Modeling

Modeling Use this forum for all your modelling related discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 14 Apr 2012, 23:22
Devinci Devinci is offline
  senegal
Location: Dakar (GOOY)
Join Date: Mar 2010
Posts: 211
Visibilty tag on Aircraft

Hello,
I am trying to make an object appear and disappear with a click on a switch. But I'm new into xml and It's not working in fsx yet. I also have some issues with the mouse click not showing on certain objects. I tried to reset the scale and transform but without success.
Code:
<Animation name="TEST_SWITCH" guid="6fb8860d-52a2-4d84-8041-526c6e256644" length="50" type="Sim" typeParam2="TEST_SWITCH" typeParam="AutoPlay" />
	<Animation name="TEST_VISIBILITY" guid="28bd9da6-7e2b-40d2-b00c-f0b30fc5c94c" length="50" type="Sim" typeParam2="TEST_VISIBILITY" typeParam="AutoPlay" />

<PartInfo>
   <Name>TEST_SWITCH</Name>
   <AnimLength>50</AnimLength>
		<Animation>
			<Parameter>
				<Code>(L:testswitch, bool) 100 *</Code>
				<Lag>600</Lag>
			</Parameter>
        </Animation>
   <MouseRect>
			<Cursor>Hand</Cursor>
			<tooltip_id>TEST_L:VARIABLES</tooltip_id>
			<callback_code>
     (L:testswitch, bool) ! (>L:testswitch, bool)
			</callback_code>
   </MouseRect>
</PartInfo>


<PartInfo>
   <Name>TEST_VISIBILITY</Name>
	<VisibleInRange>
	<Parameter>
	  <Code>(L:testswitch, number) 100 *</Code>
 	  <Lag>10</Lag>
	</Parameter>
		<minvalue>0</minvalue>
		<maxvalue>50</maxvalue>
	</VisibleInRange>
</PartInfo>
I changed some code that looked like FS9 only. But in max which one should I use? (Test_Visibility or Test_ Switch) for the switch and object. Also for the mouse rect attach point?

Thanks
__________________
Sagga Toure
Devinci Design and Development (www.3-dev.com)
KSAN X released!
FSX Gold Ed, Level-d 767, PMDG J41, PMDG 747-8, ConcordeX, Airsim A320, FS2 crew voice. Intel core i7950 oc 3.840 Ghz, corsair xms 3x2Gb ddr3 ram 1666Mhz, Gigabyte x58A-UD3 LGA1336, H70 water cooling, Nvidia GTX570, 64gbSSD, 1T hdd, rocketfish 900W psu, Asus 27", Roswill challenger mid tower case. Saitek X52 Pro flight joystick, Saitek Pro Flight Yoke and Rudder Pedals, TrackIR 5 +TrackCliP PRO
Reply With Quote
  #2  
Old 19 Apr 2012, 22:50
Devinci Devinci is offline
  senegal
Location: Dakar (GOOY)
Join Date: Mar 2010
Posts: 211
Here is the working. I found it here: http://www.aerodynamika.com/cgi-bin/...num=1311699730

But the code was missing something. Also I had many issues with the different locations of modeldef.xml

Did you know that max uses both modeldef files? the one in bin and the one in the plugin folder? I wish I knew it before!

Code:
<Animation name="hide_pilots_yoke" guid="54647385-cff7-679c-a657-9b9cd33e4f12" length="100" type="Sim" typeParam2="hide_pilots_yoke" typeParam="AutoPlay" />
    <Animation name="yoke_pilot" guid="54577386-cff7-679c-a658-ab9cd33e4f13" length="100" type="Sim" typeParam2="yoke_pilot" typeParam="AutoPlay" />

<!--          Pilot's Yoke XML Scripts     -->
   <PartInfo>
    <Name>hide_pilots_yoke</Name>
        <MouseRect>
            <Cursor>Hand</Cursor>
            <TooltipText>Hide Pilot's Yoke</TooltipText>
            <CallbackCode>
                (L:YokePilot,bool) ! (&gt;L:YokePilot,bool)
            </CallbackCode>
        </MouseRect>
   </PartInfo>

 
 
 <PartInfo>
    <Name>yoke_pilot</Name>
          <Visibility>
               <Parameter>
              <Code>(L:YokePilot,bool) 0 &gt; if{ 0 } els{ 1 }</Code>
               </Parameter>
        </Visibility>
    </PartInfo>
__________________
Sagga Toure
Devinci Design and Development (www.3-dev.com)
KSAN X released!
FSX Gold Ed, Level-d 767, PMDG J41, PMDG 747-8, ConcordeX, Airsim A320, FS2 crew voice. Intel core i7950 oc 3.840 Ghz, corsair xms 3x2Gb ddr3 ram 1666Mhz, Gigabyte x58A-UD3 LGA1336, H70 water cooling, Nvidia GTX570, 64gbSSD, 1T hdd, rocketfish 900W psu, Asus 27", Roswill challenger mid tower case. Saitek X52 Pro flight joystick, Saitek Pro Flight Yoke and Rudder Pedals, TrackIR 5 +TrackCliP PRO
Reply With Quote
  #3  
Old 20 Apr 2012, 13:46
lionheart lionheart is offline
  us-arizona
Location: In the land of hot dust, cactii, and blue skies.
Join Date: Oct 2005
Posts: 5,284
Send a message via Yahoo to lionheart
Hello Devinci,

My humble apologies for not getting to you in time. I had some visibility codes that I could have shared.

The yoke hide code is brilliant, works well.

I have another that can hide one, unhide another (for engines and cowlings swapouts), and I have one that can switch through 3 items as well (for pilots and military loadouts) that I can share as well.

Just let me know.


Bill
LHC
Reply With Quote
  #4  
Old 20 Apr 2012, 13:53
lionheart lionheart is offline
  us-arizona
Location: In the land of hot dust, cactii, and blue skies.
Join Date: Oct 2005
Posts: 5,284
Send a message via Yahoo to lionheart
I went ahead and posted the codes.


This first one is Pilots; male, female, both, none. The fist block is the switch, the other 4 are the Hierarchies that disappear/appear that you attach the pilots (or things) to.
Code:
    <Animation name="ave_pilot_selector" guid="25CD48DC-E813-4817-902E-0E8D2C229521" length="100" type="Sim" typeParam2="lhc_pilot_selector" typeParam="AutoPlay" />


 <PartInfo>
  <Name>ave_pilot_selector</Name>
    <Animation>
      <Parameter>
        <Code>
           (L:AVEpilot press,bool) 10 *
        </Code>
       <Lag>100</Lag>
      </Parameter>
    </Animation>
  <MouseRect>
  <Cursor>Hand</Cursor>
 <TooltipText>Pilot Selector System (%((L:AVE PILOT SHOW,enum))%{case}%{:0}Male)%{:1}Female)%{:2}Couple)%{:3}Empty)%{End}</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>(M:Event) 'LeftSingle' scmp 0 == if{ (L:PILOT SHOW,enum) 1 + 4 % (>L:PILOT SHOW,enum) 1 (>L:XMLSND38,enum) 1 (>L:AVEpilot press,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ (>L:AVEpilot press,bool) }</CallbackCode>
  </MouseRect>
  </PartInfo>

  <PartInfo>
    <Name>ave_pilot_male</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 0 ==
          (L:AVE PILOT SHOW,enum) 2 ==
          or
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

  <PartInfo>
    <Name>ave_pilot_female</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 1 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

  <PartInfo>
    <Name>ave_pilot_couple</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 2 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

  <PartInfo>
    <Name>ave_no_pilots</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 3 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>


This one is for engines/cowlings swapping, etc.



Code:

    <Animation name="lhc_luggage_unloader" guid="33AEF277-7CA7-40a1-95A0-3895B2E8A1DB" length="100" type="Sim" typeParam2="lhc_luggage_unloader" typeParam="AutoPlay" />


 <PartInfo>
  <Name>lhc_luggage_unloader</Name>
    <Animation>
      <Parameter>
        <Code>
           (L:lhc_pushbaggageunload,bool) 10 *
        </Code>
       <Lag>100</Lag>
      </Parameter>
    </Animation>
   <MouseRect>
  <Cursor>Hand</Cursor>
 <TooltipText>LUGGAGE LOAD AND UNLOAD (%((L:LHC_BAGGAGE_UNLOAD,enum))%{case}%{:0}LUGGAGE LOADED)%{:1}LUGGAGE UNLOADED)%{End}</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>(M:Event) 'LeftSingle' scmp 0 == if{ (L:LHC_BAGGAGE_UNLOAD,enum) 1 + 2 % (>L:LHC_BAGGAGE_UNLOAD,enum) 1 (>L:XMLSND38,enum) 1 (>L:lhc_pushbaggageunload,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ (>L:lhc_pushbaggageunload,bool) }</CallbackCode>
</MouseRect>
  </PartInfo>


  <PartInfo>
    <Name>lhc_baggage_loaded</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:LHC_BAGGAGE_UNLOAD,enum) 0 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>


  <PartInfo>
    <Name>lhc_baggage_unloaded</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:LHC_BAGGAGE_UNLOAD,enum) 1 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

On the last one, you would use the first viz as Cowling on, second is Cowling Off. The engine would be linked to Cowling Off, and the Cowling linked to Cowling On. Thus, clicking Cowling Off switch will blink out the cowling and the engine instantly appears at the exact same time.

Brilliant code. thanks to Doug Callen for that.


Note that these use 'many' L:vars in them, so be careful in resetting them to other functions as they can be very tricky.

Last edited by lionheart; 20 Apr 2012 at 13:55.
Reply With Quote
  #5  
Old 20 Apr 2012, 14:02
n4gix n4gix is offline
  unitedstates
Location: Hammond, Indiana
Join Date: Sep 2006
Posts: 8,556
Quote:
Originally Posted by Devinci View Post
Did you know that max uses both modeldef files? the one in bin and the one in the plugin folder? I wish I knew it before!
No it won't IF you have Max configured correctly!

When I first set up Max, I configured it so that it would use only the modeldef.xml file in the ..\bin folder.

Which is of course the same copy that GMax uses. Hence I only need to maintain a single source file for everything.

The Max exporter will use the paths that you set up in Customize/Configure System Paths/3rd Party Plug-Ins:
Code:
New Entry              E:\FSX_SDK\Environment Kit\Modeling SDK\3DSM9\Plugins\
New Entry1             E:\FSX_SDK\Environment Kit\Modeling SDK\bin\
When exporting, it will look first in the ..\Plugins folder for modeldef.xml file. If it can't find it there, then it will look in the ..\bin folder!

The path used by the compiler is of course specified in the CMD line parameter, so it can be located wherever you tell it to look...

...which should be of course the ..\bin folder!

The GMax exporter/compiler automatically uses the single ..\bin\modeldef.xml file.
__________________
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; 20 Apr 2012 at 14:07.
Reply With Quote
  #6  
Old 20 Apr 2012, 15:53
Devinci Devinci is offline
  senegal
Location: Dakar (GOOY)
Join Date: Mar 2010
Posts: 211
Quote:
Originally Posted by lionheart View Post
I went ahead and posted the codes.


This first one is Pilots; male, female, both, none. The fist block is the switch, the other 4 are the Hierarchies that disappear/appear that you attach the pilots (or things) to.
Code:
    <Animation name="ave_pilot_selector" guid="25CD48DC-E813-4817-902E-0E8D2C229521" length="100" type="Sim" typeParam2="lhc_pilot_selector" typeParam="AutoPlay" />


 <PartInfo>
  <Name>ave_pilot_selector</Name>
    <Animation>
      <Parameter>
        <Code>
           (L:AVEpilot press,bool) 10 *
        </Code>
       <Lag>100</Lag>
      </Parameter>
    </Animation>
  <MouseRect>
  <Cursor>Hand</Cursor>
 <TooltipText>Pilot Selector System (%((L:AVE PILOT SHOW,enum))%{case}%{:0}Male)%{:1}Female)%{:2}Couple)%{:3}Empty)%{End}</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>(M:Event) 'LeftSingle' scmp 0 == if{ (L:PILOT SHOW,enum) 1 + 4 % (>L:PILOT SHOW,enum) 1 (>L:XMLSND38,enum) 1 (>L:AVEpilot press,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ (>L:AVEpilot press,bool) }</CallbackCode>
  </MouseRect>
  </PartInfo>

  <PartInfo>
    <Name>ave_pilot_male</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 0 ==
          (L:AVE PILOT SHOW,enum) 2 ==
          or
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

  <PartInfo>
    <Name>ave_pilot_female</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 1 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

  <PartInfo>
    <Name>ave_pilot_couple</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 2 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

  <PartInfo>
    <Name>ave_no_pilots</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:AVE PILOT SHOW,enum) 3 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>


This one is for engines/cowlings swapping, etc.



Code:

    <Animation name="lhc_luggage_unloader" guid="33AEF277-7CA7-40a1-95A0-3895B2E8A1DB" length="100" type="Sim" typeParam2="lhc_luggage_unloader" typeParam="AutoPlay" />


 <PartInfo>
  <Name>lhc_luggage_unloader</Name>
    <Animation>
      <Parameter>
        <Code>
           (L:lhc_pushbaggageunload,bool) 10 *
        </Code>
       <Lag>100</Lag>
      </Parameter>
    </Animation>
   <MouseRect>
  <Cursor>Hand</Cursor>
 <TooltipText>LUGGAGE LOAD AND UNLOAD (%((L:LHC_BAGGAGE_UNLOAD,enum))%{case}%{:0}LUGGAGE LOADED)%{:1}LUGGAGE UNLOADED)%{End}</TooltipText>
<MouseFlags>LeftSingle+LeftRelease</MouseFlags>
<CallbackCode>(M:Event) 'LeftSingle' scmp 0 == if{ (L:LHC_BAGGAGE_UNLOAD,enum) 1 + 2 % (>L:LHC_BAGGAGE_UNLOAD,enum) 1 (>L:XMLSND38,enum) 1 (>L:lhc_pushbaggageunload,bool) } (M:Event) 'LeftRelease' scmp 0 == if{ (>L:lhc_pushbaggageunload,bool) }</CallbackCode>
</MouseRect>
  </PartInfo>


  <PartInfo>
    <Name>lhc_baggage_loaded</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:LHC_BAGGAGE_UNLOAD,enum) 0 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>


  <PartInfo>
    <Name>lhc_baggage_unloaded</Name>
    <Visibility>
      <Parameter>
        <Code>
          (L:LHC_BAGGAGE_UNLOAD,enum) 1 ==
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>

On the last one, you would use the first viz as Cowling on, second is Cowling Off. The engine would be linked to Cowling Off, and the Cowling linked to Cowling On. Thus, clicking Cowling Off switch will blink out the cowling and the engine instantly appears at the exact same time.

Brilliant code. thanks to Doug Callen for that.


Note that these use 'many' L:vars in them, so be careful in resetting them to other functions as they can be very tricky.
Thanks a lot Bill, this is gonna be very very useful!
__________________
Sagga Toure
Devinci Design and Development (www.3-dev.com)
KSAN X released!
FSX Gold Ed, Level-d 767, PMDG J41, PMDG 747-8, ConcordeX, Airsim A320, FS2 crew voice. Intel core i7950 oc 3.840 Ghz, corsair xms 3x2Gb ddr3 ram 1666Mhz, Gigabyte x58A-UD3 LGA1336, H70 water cooling, Nvidia GTX570, 64gbSSD, 1T hdd, rocketfish 900W psu, Asus 27", Roswill challenger mid tower case. Saitek X52 Pro flight joystick, Saitek Pro Flight Yoke and Rudder Pedals, TrackIR 5 +TrackCliP PRO
Reply With Quote
  #7  
Old 20 Apr 2012, 15:58
Devinci Devinci is offline
  senegal
Location: Dakar (GOOY)
Join Date: Mar 2010
Posts: 211
Quote:
Originally Posted by n4gix View Post
No it won't IF you have Max configured correctly!

When I first set up Max, I configured it so that it would use only the modeldef.xml file in the ..\bin folder.

Which is of course the same copy that GMax uses. Hence I only need to maintain a single source file for everything.

The Max exporter will use the paths that you set up in Customize/Configure System Paths/3rd Party Plug-Ins:
Code:
New Entry              E:\FSX_SDK\Environment Kit\Modeling SDK\3DSM9\Plugins\
New Entry1             E:\FSX_SDK\Environment Kit\Modeling SDK\bin\
When exporting, it will look first in the ..\Plugins folder for modeldef.xml file. If it can't find it there, then it will look in the ..\bin folder!

The path used by the compiler is of course specified in the CMD line parameter, so it can be located wherever you tell it to look...

...which should be of course the ..\bin folder!

The GMax exporter/compiler automatically uses the single ..\bin\modeldef.xml file.
I only had the path to the plugin folder in max. But it seems to me the one in bin is used for the visibility and mouse clicks, etc and the one in plugin folder for animation manager.
I also use the one in bin for the compile aircraft. I will try to only work on a single modeldef because it's very confusing.

Thanks I'll try using both path in max, but I suppose I should delete the modeldef in the plugin folder so that max will use the one in bin?


Regards,
__________________
Sagga Toure
Devinci Design and Development (www.3-dev.com)
KSAN X released!
FSX Gold Ed, Level-d 767, PMDG J41, PMDG 747-8, ConcordeX, Airsim A320, FS2 crew voice. Intel core i7950 oc 3.840 Ghz, corsair xms 3x2Gb ddr3 ram 1666Mhz, Gigabyte x58A-UD3 LGA1336, H70 water cooling, Nvidia GTX570, 64gbSSD, 1T hdd, rocketfish 900W psu, Asus 27", Roswill challenger mid tower case. Saitek X52 Pro flight joystick, Saitek Pro Flight Yoke and Rudder Pedals, TrackIR 5 +TrackCliP PRO
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
Creating a multi-pose set Gman Static Aircraft Model Maker 0 25 Nov 2010 13:27
Making a single static aircraft library Gman Static Aircraft Model Maker 1 24 Nov 2010 18:41
Playing Back Sim with Two Aircraft Mike Truly General chat 3 01 Jun 2010 08:55
Depicting Parking Spaces in ADE Phantoms ScruffyDuck Software Tools (Not ADE) 42 06 May 2007 08:54


All times are GMT -4. The time now is 22:46.

Kirsch designed by Andrew & Austin


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