Board index FlightGear Development Nasal

Joystick xml: Can i include external nasalcode?

Nasal is the scripting language of FlightGear.

Joystick xml: Can i include external nasalcode?

Postby powoflight » Tue May 04, 2021 7:22 am

Is it possible to "include" external nasal in a joystick.xml?

Reason: I have 3 joysticks/Gamepads they are using a lot of the same nasalcode.

And if it is possible how can i include the nasalscripts from /home/xxx/.fgfs/Nasal/xxx.nas
powoflight
 
Posts: 212
Joined: Fri Mar 25, 2016 11:04 am
Location: LOWW
Callsign: OE-POW
Version: 2020.4
OS: win7 Ubuntu 18.04

Re: Joystick xml: Can i include external nasalcode?

Postby wlbragg » Tue May 04, 2021 7:19 pm

Did you try using the nasal tag, say at the beginning of the joystick.xml file.

I'm on my cell phone at the moment so I don't remember the exact syntax, something like.

<nasal>

</nasal>

Search wiki for embedded nasal. Or look at any set.xml for the syntax to call a nasal file and try that. I suppose that is closer to what your asking for.

I don't know for sure if either method is supported.
Kansas and Ohio/Midwest scenery development.
KEQA, 3AU, KRCP Airport Layout
Intel i7/GeForce RTX 2070/Max-Q
User avatar
wlbragg
 
Posts: 7586
Joined: Sun Aug 26, 2012 12:31 am
Location: Kansas (Tornado Alley), USA
Callsign: WC2020
Version: next
OS: Win10/Linux/RTX 2070

Re: Joystick xml: Can i include external nasalcode?

Postby Hooray » Tue May 04, 2021 7:41 pm

yes, you can.
See the io module/namespace for io.include or io.load_nasal respectively
Note that bindings are recompiled for each invocation (at least they used to, I am not really following FG development currently)
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Joystick xml: Can i include external nasalcode?

Postby powoflight » Wed May 05, 2021 7:07 am

@Hooray
io module/namespace : Looks like that is the solution.
powoflight
 
Posts: 212
Joined: Fri Mar 25, 2016 11:04 am
Location: LOWW
Callsign: OE-POW
Version: 2020.4
OS: win7 Ubuntu 18.04


Return to Nasal

Who is online

Users browsing this forum: No registered users and 1 guest