Board index FlightGear Development Nasal

C172 Walk feature  Topic is solved

Nasal is the scripting language of FlightGear.

C172 Walk feature

Postby murderbybox » Mon Dec 28, 2015 6:17 am

So, ive been trying to add a walk feature to the old c172, but keep coming across
Code: Select all
Nasal runtime error: undefined symbol: walk
  at /input/keyboard/key[119]/binding, line 1

Nothing i do fixes it, a little help?
murderbybox
 
Posts: 109
Joined: Mon Aug 10, 2015 5:50 pm
Location: ESNO
Callsign: Padawan
OS: Windows 10

Re: C172 Walk feature

Postby DFaber » Mon Dec 28, 2015 1:11 pm

Hi murderbybox,

murderbybox wrote in Mon Dec 28, 2015 6:17 am:Nothing i do fixes it, a little help?


what have you done so far? Did you start with the --config option or edited the -set files?

The error seems to indicate that a nasal include is missing.

Greetings
Detlef Faber
FlightGear Development:
http://flightgear-de.net

my 3D-Art:
https://www.sol2500.net
DFaber
 
Posts: 709
Joined: Fri Dec 01, 2006 8:51 pm
Location: Aachen, Germany
Version: GIT
OS: Linux

Re: C172 Walk feature

Postby MIG29pilot » Mon Dec 28, 2015 4:07 pm

Hey murder, what about the new c172?
User avatar
MIG29pilot
 
Posts: 1465
Joined: Tue May 19, 2015 5:03 pm
Location: 6 feet under Snow
Callsign: MIG29pilot
Version: 2020.1.3
OS: Windows 10

Re: C172 Walk feature

Postby wkitty42 » Mon Dec 28, 2015 5:51 pm

that's what i was wondering... the walkers are included in the new c172p...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: C172 Walk feature

Postby murderbybox » Mon Dec 28, 2015 6:47 pm

In the path part of the -set.xml, where you include the nasal paths, i put the path right to the walk.nas, and the reason im not just using the NEW c172, is because my computer at the current moment cant handle it. :(
murderbybox
 
Posts: 109
Joined: Mon Aug 10, 2015 5:50 pm
Location: ESNO
Callsign: Padawan
OS: Windows 10

Re: C172 Walk feature

Postby wkitty42 » Mon Dec 28, 2015 7:27 pm

in the new c172p, the walkers are included via the "<PropertyList>" tag... there's only one propertylist tag in a -set file... this one is listed as
Code: Select all
<PropertyList include="Aircraft/Generic/Human/Include/walker-include.xml">


further down in the -set file is a set of tags "<walker>" which sets certain aspects of the walkers used with the craft... i'm not sure if these are the same as the occupants that may be included in a craft, though... i suspect that the two are different as one is a static model and the other, the walker, is not so static...

of course, the above propertylist tag entry also requires that your $FGROOT contains the given path and walker related files... as i don't have the old 3.4 $FGROOT files any more since moving to using the repos for 3.5 and 3.7, i cannot see what's in there... my attempt at assistance may very well be fruitless :(
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: C172 Walk feature

Postby murderbybox » Mon Dec 28, 2015 7:35 pm

I dont know what you mean, the "walker-include" is there, but i dont know what to do, please help me, adding a walk feature would be great, not even a diffrent veiw, just like press "w" to walk forward, in cockpit view
murderbybox
 
Posts: 109
Joined: Mon Aug 10, 2015 5:50 pm
Location: ESNO
Callsign: Padawan
OS: Windows 10

Re: C172 Walk feature

Postby wkitty42 » Mon Dec 28, 2015 8:35 pm

oh, i though you were adding it because it was never there... according to the information in the include file i pointed to, there's nothing else needed other than maybe a custom exit point if you want to add that... all the information i have is in that include file... you should take a look at it... i don't know if you can walk around inside a craft... i would not expect so in the c172 as it is like a small 2-door car... AFAIK you have to go outside the craft to walk around... other than that, i've given all i can at this point... it looks like a simple addition of that line and bang! bob's your uncle... apparently that's not quite so :(
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: C172 Walk feature

Postby murderbybox » Mon Dec 28, 2015 8:48 pm

wkitty, could you help a bit more? Just, please tell me where and how to add it, and ill praise you as my god, even though im athiest.
murderbybox
 
Posts: 109
Joined: Mon Aug 10, 2015 5:50 pm
Location: ESNO
Callsign: Padawan
OS: Windows 10

Re: C172 Walk feature

Postby wkitty42 » Mon Dec 28, 2015 9:00 pm

where and how to add what? didn't you tell me that that include line was already in your craft's -set file? i've been dissecting the new c172p just to be able to give you the info i have provided... i've been kinda waiting on others to jump in with missing details that i just don't know about... you've heard of the expression "the blind leading the blind" right? ;) :lol:
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9146
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: C172 Walk feature

Postby murderbybox » Mon Dec 28, 2015 9:03 pm

This is MY c172p-set file
Code: Select all
<?xml version="1.0"?>
<!--
************************************************************************
JSBSim Cessna 172P with 3D cockpit.

Started October 23 2001 by John Check, fgpanels@rockfish.net
************************************************************************
-->

<PropertyList>

 <sim>

  <description>Cessna 172P Skyhawk (1981 model)</description>
  <long-description>The Cessna 172 Skyhawk is a four-seat, single-engine, high-wing fixed-wing aircraft.
      First flown in 1955 and still in production, more Cessna 172s have been built than any other aircraft.
  </long-description>
 
  <fr>
      <long-description>Le Cessna 172 Skyhawk est un avion quadriplace, monomoteur à aile haute.
        Il effectua son premier vol en 1955 et est toujours en production, plus de Cessna 172 ont été construits que tout autres avions.
        </long-description>
  </fr>
 
  <tags>
      <tag>ga</tag>
      <tag>cessna</tag>
      <tag>piston</tag>
      <tag>single-engine</tag>
      <tag>fixed-gear</tag>
  </tags>
 
  <author>David Megginson</author>
  <status>early production</status>
  <rating>
    <FDM type="int">3</FDM>
    <systems type="int">4</systems>
    <model type="int">5</model>
    <cockpit type="int">4</cockpit>
  </rating>


  <flight-model archive="y">jsb</flight-model>
  <aero archive="y">c172p</aero>

  <allow-toggle-cockpit type="bool">true</allow-toggle-cockpit>

  <model>
    <path archive="y">Aircraft/c172p/Models/c172p.xml</path>

    <livery>
      <file type="string">n301dp</file>
      <index type="int">0</index>
    </livery>

    <liverytail>
      <file type="string">n301dp</file>
      <index type="int">0</index>
    </liverytail>

    <liverywing>
      <file type="string">n301dp</file>
      <index type="int">0</index>
    </liverywing>

    <c172p>
      <immat type="bool">false</immat>
      <fairing1 type="bool">true</fairing1>
      <fairing2 type="bool">false</fairing2>
      <fairing3 type="bool">false</fairing3>
    </c172p>
    <hide-yoke type="bool">false</hide-yoke>
  </model>

  <startup>
    <splash-texture>Aircraft/c172p/splash.png</splash-texture>
  </startup>

  <!-- hide the 2D panel -->
 
  <panel>
   <visibility type="bool" archive="y">false</visibility>
  </panel>

  <!-- position the pilot viewpoint and angle -->
 
  <view>
   <internal type="bool" archive="y">true</internal>
   <config>
     <x-offset-m archive="y" type="double">-0.21</x-offset-m>
     <y-offset-m archive="y" type="double">0.235</y-offset-m>
     <z-offset-m archive="y" type="double">0.36</z-offset-m>
     <pitch-offset-deg type="double">-12</pitch-offset-deg>
   </config>
  </view>

  <systems>
    <autopilot>
      <path>Aircraft/c172p/Systems/KAP140.xml</path>
    </autopilot>
    <property-rule n="100">
      <name>FiltersOnly</name>
      <path>Aircraft/c172p/Systems/NAVandGSfilters.xml</path>
    </property-rule>
    <electrical>
      <!-- null electrical system path here so we can use a nasal based -->
      <!-- model defined later in the nasal section of this file. -->
      <path></path>
    </electrical>
  </systems>

  <sound>
   <path archive="y">Aircraft/c172p/c172-sound.xml</path>
  </sound>

  <help include="c172-help.xml"/>
 
  <checklists include="c172-checklists.xml"/>

  <tutorials include="Tutorials/c172-tutorials.xml"/>
 
  <dimensions>
    <radius-m type="double">5</radius-m>
  </dimensions>
  <aircraft-class type="string">ga</aircraft-class>
  <aircraft-operator type="string">NONE</aircraft-operator>

  <multiplay>
      <chat_display>1</chat_display>
      <generic>
        <float n="0" alias="/sim/model/door-positions/rightDoor/position-norm"/>
        <float n="1" alias="/sim/model/door-positions/leftDoor/position-norm"/>
        <float n="2" alias="/sim/model/door-positions/baggageDoor/position-norm"/>
        <int type="int">0</int>
        <int type="int">0</int>
        <int type="int">0</int>
        <int type="int">0</int>
        <int type="int">0</int>
        <int type="int">0</int>
      </generic>
  </multiplay>

  <flight-recorder>
    <replay-config type="int">0</replay-config>
    <config n="0" include="/Aircraft/Generic/flightrecorder/generic-piston-propeller-1.xml">
      <name type="string">C172p Flight Recorder</name>
    </config>
  </flight-recorder>

  <menubar include="Dialogs/c172p-menu.xml"/>
  <instrumentation n="0">
    <path>Aircraft/c172p/Systems/instrumentation.xml</path>
  </instrumentation>
 </sim>

 <!-- trim for level cruise -->

 <controls>
  <flight>
   <aileron-trim type="double">0.027</aileron-trim>
   <rudder-trim type="double">0.0</rudder-trim>
  </flight>
  <engines>
   <engine n="0">
    <magnetos type="int">3</magnetos>
    <master-bat type="bool">true</master-bat>
    <master-alt type="bool">true</master-alt>
   </engine>
  </engines>
  <lighting>
   <landing-lights type="bool">false</landing-lights>
   <taxi-light type="bool">false</taxi-light>
   <strobe type="bool">false</strobe>
   <beacon type="bool">false</beacon>
   <nav-lights type="bool">false</nav-lights>
  </lighting>
  <switches>
   <master-avionics type="bool">true</master-avionics>
   <starter type="bool">false</starter>
  </switches>
  <engines>
    <engine>
      <master-bat type="bool">true</master-bat>
      <master-alt type="bool">true</master-alt>
    </engine>
  </engines>
 </controls>

 <autopilot>
  <KAP140>
   <settings>
    <auto-pitch-trim type="bool">true</auto-pitch-trim>
   </settings>
  </KAP140>
 </autopilot>

 <consumables>
  <fuel>
   <tank n="0">
    <level-gal_us type="double">20</level-gal_us>
    <selected type="bool">true</selected>
   </tank>
   <tank n="1">
    <level-gal_us type="double">20</level-gal_us>
    <selected type="bool">true</selected>
   </tank>
  </fuel>
 </consumables>

 <instrumentation>
  <kma20 include="Aircraft/Instruments-3d/kma20/kma20init.xml"/>
  <attitude-indicator>
   <config>
    <tumble-flag archive="y" type="bool">true</tumble-flag>
   </config>
  </attitude-indicator>
  <encoder>
   <serviceable type="bool">true</serviceable>
  </encoder>
  <adf n="0">
    <ident-audible type="bool">false</ident-audible>
    <volume type="double">0.7</volume>
  </adf>
  <comm n="0">
    <power-btn type="bool">1</power-btn>
  </comm>
  <nav n="0">
    <volume type="double">0.7</volume>
  </nav>
  <comm n="1">
    <power-btn type="bool">1</power-btn>
  </comm>
  <nav n="1">
    <volume type="double">0.7</volume>
  </nav>
  <magnetic-compass>
    <pitch-offset-deg type="double">-2.7</pitch-offset-deg>
  </magnetic-compass>
 </instrumentation>

 <engines>
  <engine>
   <rpm type="double">0</rpm>
   <magnetos type="int">0</magnetos>
   <mixture type="double">0</mixture>
   <running type="bool">false</running>
  </engine>
 </engines>

 <nasal>
 
    <c172p>
      <file>Aircraft/c172p/Nasal/liveries.nas</file>
      <file>Aircraft/c172p/Nasal/walk.nas</file>
      <file>Aircraft/c172p/Nasal/immat.nas</file>
      <file>Aircraft/c172p/Nasal/doors.nas</file>
      <file>Aircraft/c172p/Nasal/light.nas</file>
      <file>Aircraft/c172p/Nasal/tanks.nas</file>
      <file>Aircraft/c172p/Nasal/kma20.nas</file>
      <file>Aircraft/c172p/Nasal/ki266.nas</file>
      <script><![CDATA[
        ki266.new(0);
        aircraft.data.add( "engines/engine[0]/egt-bug-norm" );
      ]]></script>
    </c172p>

  <electrical>
   <file>Aircraft/c172p/Nasal/c172-electrical.nas</file>
  </electrical>
  <kap140>
   <file>Aircraft/Generic/kap140.nas</file>
   <!-- We can set some variables that might be
        aircraft specific. We must do it after the file
        to override the ones that are in the .nas file.-->
   <script><![CDATA[
                    headingNeedleDeflection = "/instrumentation/nav/heading-needle-deflection";
                    gsNeedleDeflection = "/instrumentation/nav/gs-needle-deflection-norm";
                    staticPressure = "systems/static/pressure-inhg";
    ]]>
   </script>
  </kap140>
  <kr87>
    <file>Aircraft/c172p/Nasal/kr87.nas</file>
  </kr87>
 </nasal>
 <payload>
  <weight>
   <name type="string">Pilot</name>
   <weight-lb alias="/fdm/jsbsim/inertia/pointmass-weight-lbs[0]"/>
   <arm-in alias="/fdm/jsbsim/inertia/pointmass-location-X-inches[0]"/>
   <min-lb type="double">0.0</min-lb>
   <max-lb type="double">300.0</max-lb>
  </weight>
  <weight>
   <name type="string">Co-Pilot</name>
   <weight-lb alias="/fdm/jsbsim/inertia/pointmass-weight-lbs[1]"/>
   <arm-in alias="/fdm/jsbsim/inertia/pointmass-location-X-inches[0]"/>
   <min-lb type="double">0.0</min-lb>
   <max-lb type="double">300.0</max-lb>
  </weight>
  <weight>
   <name type="string">Left Passenger</name>
   <weight-lb alias="/fdm/jsbsim/inertia/pointmass-weight-lbs[2]"/>
   <arm-in alias="/fdm/jsbsim/inertia/pointmass-location-X-inches[0]"/>
   <min-lb type="double">0.0</min-lb>
   <max-lb type="double">300.0</max-lb>
  </weight>
  <weight>
   <name type="string">Right Passenger</name>
   <weight-lb alias="/fdm/jsbsim/inertia/pointmass-weight-lbs[3]"/>
   <arm-in alias="/fdm/jsbsim/inertia/pointmass-location-X-inches[0]"/>
   <min-lb type="double">0.0</min-lb>
   <max-lb type="double">300.0</max-lb>
  </weight>
  <weight>
   <name type="string">Baggage</name>
   <weight-lb alias="/fdm/jsbsim/inertia/pointmass-weight-lbs[4]"/>
   <arm-in alias="/fdm/jsbsim/inertia/pointmass-location-X-inches[0]"/>
   <min-lb type="double">0.0</min-lb>
   <max-lb type="double">150.0</max-lb> <!-- WARNING: Max baggage "by the book" is 120lbs or less! -->
  </weight>
 </payload>

 <limits>
  <mass-and-balance>
   <maximum-ramp-mass-lbs>2407</maximum-ramp-mass-lbs>
   <maximum-takeoff-mass-lbs>2400</maximum-takeoff-mass-lbs>
   <maximum-landing-mass-lbs>2400</maximum-landing-mass-lbs>
   <cg>
    <dimension type="string">in</dimension>
    <limit>
     <entry>
      <position type="double">35.0</position>
      <mass-lbs type="double">1450</mass-lbs>
     </entry>
     <entry>
      <position type="double">35.0</position>
      <mass-lbs type="double">1950</mass-lbs>
     </entry>
     <entry>
      <position type="double">41</position>
      <mass-lbs type="double">2550</mass-lbs>
     </entry>
     <entry>
      <position type="double">47.2</position>
      <mass-lbs type="double">2550</mass-lbs>
     </entry>
     <entry>
      <position type="double">47.2</position>
      <mass-lbs type="double">1450</mass-lbs>
     </entry>
    </limit>
   </cg>
  </mass-and-balance>
 </limits>

 <input>
  <keyboard>
   <key n="119">
    <name>w</name>
     <desc>Walk forward toward view</desc>
     <repeatable>true</repeatable>
     <binding>
      <command>nasal</command>
      <script>walk.walk_about(0.1)</script>
     </binding>
   </key>
   <key n="87">
    <name>W</name>
    <desc>Walk backward from view</desc>
    <repeatable>true</repeatable>
    <binding>
     <command>nasal</command>
     <script>walk.walk_about(-0.1)</script>
    </binding>
   </key>
   <key n="76">
    <name>L</name>
    <desc>Decrease Panel lighting</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>controls/lighting/instruments-norm</property>
     <step>-0.1</step>
     <min>0</min>
     <max>1.0</max>
     <wrap>0</wrap>
    </binding>
   </key>
   <key n="108">
    <name>l</name>
    <desc>Increase Panel lighting</desc>
    <repeatable type="bool">true</repeatable>
    <binding>
     <command>property-adjust</command>
     <property>controls/lighting/instruments-norm</property>
     <step>0.1</step>
     <min>0</min>
     <max>1.0</max>
     <wrap>0</wrap>
    </binding>
   </key>
   <key n="115">
   <name>s</name>
   <desc>Toggle Starter Switch</desc>
   <binding>
    <command>property-assign</command>
    <property>/controls/switches/starter</property>
    <value >1</value>
   </binding>
   <mod-up>
    <binding>
     <command>property-assign</command>
     <property>/controls/switches/starter</property>
     <value>0</value>
    </binding>
   </mod-up>
  </key>
  </keyboard>
 </input>

</PropertyList>
murderbybox
 
Posts: 109
Joined: Mon Aug 10, 2015 5:50 pm
Location: ESNO
Callsign: Padawan
OS: Windows 10

Re: C172 Walk feature

Postby ludomotico » Mon Dec 28, 2015 9:16 pm

If I recall correctly, you only have to change the line referenced by wkitty42 and that's it.

Then, there will be a new "Walker" menu. Press "switch walker outside" et voilà!

If you only do this, you'll notice you spawn at the aircraft center. That is, right in the middle of the engine. You can define the door at the same position as the new c172p does:

Code: Select all
            <map>
                <default_exit>
                    <x-offset-m type="float">-0.35</x-offset-m>
                    <y-offset-m type="float">-0.84</y-offset-m>
                </default_exit>
            </map>


Put this code inside the "model" section.

You can check how the new c172p defines the walker: https://github.com/Juanvvc/c172p-detail ... 2p-set.xml The new include is in line 19, and the exit is defined in line 222.
User avatar
ludomotico
 
Posts: 1269
Joined: Tue Apr 24, 2012 2:01 pm
Version: nightly
OS: Windows 10

Re: C172 Walk feature

Postby murderbybox » Mon Dec 28, 2015 9:30 pm

I.... i cant even, im an idiot, just look at my file i pasted, please just change whatever i shouldve changed in that, and paste it for me, please, im a retard :(
murderbybox
 
Posts: 109
Joined: Mon Aug 10, 2015 5:50 pm
Location: ESNO
Callsign: Padawan
OS: Windows 10

Re: C172 Walk feature  

Postby ludomotico » Mon Dec 28, 2015 9:52 pm

Please, try to be a bit more assertive. In you file, change the line:

Code: Select all
<PropertyList>


with

Code: Select all
<PropertyList include="Aircraft/Generic/Human/Include/walker-include.xml">
User avatar
ludomotico
 
Posts: 1269
Joined: Tue Apr 24, 2012 2:01 pm
Version: nightly
OS: Windows 10

Re: C172 Walk feature

Postby murderbybox » Mon Dec 28, 2015 9:59 pm

I did that, but it didnt change anything :(
EDIT 1: IT WORKED! THANK YOU!
murderbybox
 
Posts: 109
Joined: Mon Aug 10, 2015 5:50 pm
Location: ESNO
Callsign: Padawan
OS: Windows 10

Next

Return to Nasal

Who is online

Users browsing this forum: No registered users and 3 guests