Sending this to the list to make others aware of the problem and
a possible solution:

As has been mentioned a few times already, not all fgfs installations
work exactly the same way. There are factors that can cause differences
in initialization order (OS & file system dependent reading order of
files in $FG_ROOT/Nasal/) and initialization timing (probably caused
by which subsystems are activated, such as scenarios/AI/...).

So it can happen that an aircraft works on some installations, but
not on others. After today's commits to the pa24-250 I got this:

  Nasal runtime error: nil used in numeric context
    at /home/m/fgfs/Base.local/Aircraft/pa24-250/pa24-electrical.nas, line 284
    called from: /home/m/fgfs/Base.local/Aircraft/pa24-250/pa24-electrical.nas, 
line 163

It turned out that the /gear/gear/wow values were read *before* the
FDM had set them. This broke the whole electrical system, and the 
aircraft couldn't be started. I fixed that in my version by letting
the initialization function be called after the FDM was up, not at
the earliest possible moment:


diff -u -p -r1.6 pa24-electrical.nas
--- pa24-electrical.nas 25 Nov 2006 09:47:44 -0000      1.6
+++ pa24-electrical.nas 25 Nov 2006 10:49:31 -0000
@@ -549,4 +549,4 @@ avionics_bus_2 = func() {

 # Setup a timer based call to initialized the electrical system as
 # soon as possible.
-settimer(init_electrical, 0);
+setlistener("/sim/signals/fdm-initialized", init_electrical);


My Sea-Vixen is still broken ... same cause ...   :-/

m.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to