Board index FlightGear Development Aircraft

C172p nasal runtime error in Multiplayer

Questions and discussion about creating aircraft. Flight dynamics, 3d models, cockpits, systems, animation, textures.

C172p nasal runtime error in Multiplayer

Postby jsb » Wed Mar 22, 2017 10:03 pm

I just saw the following by chance as a C172 entered my area in MP:
Code: Select all
Nasal runtime error: nil used in numeric context
  at /fgdata/Nasal/bits.nas, line 8
  called from: /fgdata/Aircraft/c172p/Models/, line 36
  called from: /fgdata/Nasal/globals.nas, line 119
c172p livery update

A quick&dirty hack to avoid this is to edit /fgdata/Aircraft/c172p/Models/c172p.xml (find line 36 in the nasal block)
Guestimate: node.getValue does not return a number -> hack: add "or 0" to line so a NIL becomes a 0.
I leave it to the experts to decide a reasonable fallback value or track and fix the root cause of this problem :)
Code: Select all
            setlistener(pax_state_path, func (node) {
                var state = node.getValue() or 0;
                co_pilot.setBoolValue(bits.test(state, 0));
                left_passenger.setBoolValue(bits.test(state, 1));
                right_passenger.setBoolValue(bits.test(state, 2));
                pilot.setBoolValue(bits.test(state, 3));
            }, 1, 0);
Posts: 221
Joined: Sat Oct 25, 2014 8:17 pm
Location: Hamburg, Germany
Callsign: D-JSB
Version: next
OS: Win7/Linux

Re: C172p nasal runtime error in Multiplayer

Postby wlbragg » Sat Mar 25, 2017 4:05 pm

Thanks @jsb, this has been added to issues in the dev repo.
Kansas(2-27-15)/Ohio/Midwest scenery development.
KEQA (2-27-15), 3AU, KRCP Airport Layout
Intel i5 3570K AMDRX480
User avatar
Posts: 5194
Joined: Sat Aug 25, 2012 11:31 pm
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/AMDRX480

Return to Aircraft

Who is online

Users browsing this forum: YandexBot [Bot] and 4 guests