Board index FlightGear Development Aircraft Systems

Need help: ATR72-500 Announcement System  Topic is solved

Modeling aircraft systems, like electrical stuff, hydraulics, pneumatics? Feel free to ask support.

Need help: ATR72-500 Announcement System

Postby flycanarias » Wed Apr 12, 2017 1:00 pm

Hello guys, I need a little bit of support.
I try to implement a cabin announcement system for the Omega ATR72.
I followed the steps in this wiki article http://wiki.flightgear.org/Howto:Add_ca ... ouncements
Now I have the following issue: The announcements are available from the dropdown menu in the menu bar, but the dialog doesn't show up.
The console prints the following:

Nasal parse errror: parse error in /sim/menubar/default/menu[100]/item[5]/binding, line 3


I know that this is the problem, but I can't figure out where the mistake is. I modified the parse_dat.nas file, but I removed my change to it during troubleshooting, which had no effect, neither positive or negative.

So I would be really glad if anyone of you could tell me in which file my mistake is located, and hopefully I'm able to fix it soon.

Best regards,

flycanarias

P.S.: This is my first "development" project, so I am really just trying out and learning.
Canary Islands Custom Scenery
Improvement of the AI Traffic for the Canary Islands Region
RoutePlans for the Eastern Atlantic (Azores, Madeira, Cap Verde, Canaries)
About to open a Binter Canarias VA
flycanarias
 
Posts: 285
Joined: Fri Jun 10, 2016 4:29 pm
Location: EDDF, EDDC, GCFV

Re: Need help: ATR72-500 Announcement System

Postby Octal450 » Wed Apr 12, 2017 1:01 pm

Hi there!
Its great your getting into development!

Can you paste in your binding for that menu item? That is where the error is.

Kind regards,
Josh
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Need help: ATR72-500 Announcement System

Postby flycanarias » Wed Apr 12, 2017 1:21 pm

Thank you for your help !!

This is the item binding I created. I have inserted it into the ATR72-common.xml

Code: Select all
<item>
      <label>Announcements</label>
      <binding>
         <command>nasal</command>
         <script>
                        var mal =
gui.Dialog.new("/sim/gui/dialogs/announcements/dialog", "Aircraft/ATR72/Systems/announcements-dlg.xml“); mal.open();
</script>
   </binding>
</item>


If you find the mistake, feel free to correct that piece of code.

Thanks,

flycanarias


P.S.: I hope to get more skillful soon, and develop some things further, especially on the ATR72.
Last edited by Gijs on Wed Apr 12, 2017 1:28 pm, edited 1 time in total.
Reason: Use [code] tags on code
Canary Islands Custom Scenery
Improvement of the AI Traffic for the Canary Islands Region
RoutePlans for the Eastern Atlantic (Azores, Madeira, Cap Verde, Canaries)
About to open a Binter Canarias VA
flycanarias
 
Posts: 285
Joined: Fri Jun 10, 2016 4:29 pm
Location: EDDF, EDDC, GCFV

Re: Need help: ATR72-500 Announcement System  

Postby Gijs » Wed Apr 12, 2017 1:28 pm

There seems to be a bogus " character after .xml (hint, when using [ code] tags on the forum this clearly shows, as you can see in your edited post). Try this
Code: Select all
<item>
  <label>Announcements</label>
  <binding>
    <command>nasal</command>
    <script>
      var mal =
gui.Dialog.new("/sim/gui/dialogs/announcements/dialog", "Aircraft/ATR72/Systems/announcements-dlg.xml");
      mal.open();
    </script>
  </binding>
</item>
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9544
Joined: Tue Jul 03, 2007 3:55 pm
Location: Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Need help: ATR72-500 Announcement System

Postby Octal450 » Wed Apr 12, 2017 3:32 pm

Yup: Not sure why there were 2 different types of quotes, make sure you have the correct " character, with 2 vertical lines. This should be working.
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Need help: ATR72-500 Announcement System

Postby sanhozay » Wed Apr 12, 2017 4:34 pm

If you move announcements-dlg.xml to Aircraft/ATR72/gui/dialogs/announcements-dlg.xml, you should be able to use the "dialog-show" fgcommand, which is somewhat neater:

Code: Select all
<item>
  <label>Announcements</label>
  <binding>
    <command>dialog-show</command>
    <dialog-name>announcements-dlg</dialog-name>
  </binding>
</item>
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 12:57 pm
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Need help: ATR72-500 Announcement System

Postby flycanarias » Wed Apr 12, 2017 10:19 pm

Thank you, it worked. I'll fix some minor bugs and then I think I'll publish it...
Canary Islands Custom Scenery
Improvement of the AI Traffic for the Canary Islands Region
RoutePlans for the Eastern Atlantic (Azores, Madeira, Cap Verde, Canaries)
About to open a Binter Canarias VA
flycanarias
 
Posts: 285
Joined: Fri Jun 10, 2016 4:29 pm
Location: EDDF, EDDC, GCFV

Re: Need help: ATR72-500 Announcement System

Postby Octal450 » Thu Apr 13, 2017 3:35 am

Nice!
Skillset: JSBsim Flight Dynamics, Systems, Canvas, Autoflight/Control, Instrumentation, Animations
Aircraft: A320-family, MD-11, MD-80, Contribs in a few others

Octal450's GitHub|Launcher Catalog
|Airbus Dev Discord|Octal450 Hangar Dev Discord
User avatar
Octal450
 
Posts: 5583
Joined: Tue Oct 06, 2015 1:51 pm
Location: Huntsville, AL
Callsign: WTF411
Version: next
OS: Windows 11

Re: Need help: ATR72-500 Announcement System

Postby flycanarias » Sat Apr 15, 2017 1:49 pm

I will try to implement the announcement feature for the CRJ - family, and the 757 if I find the time.
Canary Islands Custom Scenery
Improvement of the AI Traffic for the Canary Islands Region
RoutePlans for the Eastern Atlantic (Azores, Madeira, Cap Verde, Canaries)
About to open a Binter Canarias VA
flycanarias
 
Posts: 285
Joined: Fri Jun 10, 2016 4:29 pm
Location: EDDF, EDDC, GCFV


Return to Systems

Who is online

Users browsing this forum: No registered users and 1 guest