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

Gmax FS2004 part code question

Messages
10,163
Country
us-arizona
Hey Guys,

I am trying to make my rear cargo hatch on a plane to 'disappear' so that its a Sky Diver transport plane when you want it to be, (door hides and plane appears to look like a sky diver shuttle).

My problem is that I wish to have a 'physical' switch in the VC that will hide the door and for some reason I cant get it to work. So, it must be something small that I am missing, as I have tried quite a number of variations on the code to get this to work.

Presently the switch will animate, but the Sky Door system will not function per the switch/part.

Any idea's?




Code:
<part>
	<name>sky_door_switch</name>
	<animation>
		<parameter>
			<sim>
				<variable>(L:sky_door_visible, bool)</variable>
				<units>bool</units>
				<scale>50</scale>
			</sim>
			<lag>400</lag>
		</parameter>
	</animation>
	<mouserect>
		<cursor>Hand</cursor>
		<tooltip_text>Hide Cargo Door for Sky Diver Mode</tooltip_text>
		<event_id>(L:sky_door_visible, bool) ! (>L:sky_door_visible, bool)</event_id>
	</mouserect>
</part>




<part> 
      <name>sky_door</name>
            <visible_in_range>
               <parameter>
               <code>(L:sky_door_visible, bool)</code>
               </parameter>
           <minvalue>-1</minvalue>
           <maxvalue>0</maxvalue>
    </visible_in_range>
</part>


Sky Door code by Bill Leaming, Switch code by Stephen Barstow, modified by myself to try to get it to work.




Bill
 
<Sim> & <Variable> are only used with default tokens.
Custom (L:var,unit) must use <code> instead.

<Event_id> may only be used for default commands.
Custom (L:var,unit) type commands must use <callback_code>

Code:
<part>
   <name>sky_door_switch</name>
      <animation>
	<parameter>
	  <code>(L:sky_door_visible, bool) 50 *</code>
 	  <lag>400</lag>
	</parameter>
      </animation>
   <mouserect>
	<cursor>Hand</cursor>
   <tooltip_text>Hide Cargo Door for Sky Diver Mode</tooltip_text>
   <callback_code>(L:sky_door_visible, bool) ! (>L:sky_door_visible, bool)</callback_code>
   </mouserect>
</part>

<part> 
 <name>sky_door</name>
    <visible_in_range>
       <parameter>
          <code>(L:sky_door_visible, bool)</code>
       </parameter>
       <minvalue>-1</minvalue>
       <maxvalue>0</maxvalue>
    </visible_in_range>
</part>



Bill
 
Ahhhhhhhh.....

drats.. You know, I thought I tried code, but I was probably using a bad string though.

So close.....

Sometimes working with code is like a delicate Chinese puzzle block.



Thanks Bill
 
Back
Top