On 02/11/2010 04:11 PM, Csaba Halász wrote: > On Thu, Feb 11, 2010 at 10:59 PM, John Denker <j...@av8n.com> wrote: >> On my machine I observe that the various scripts in >> the Nasal/ directory get loaded in some hard-to-predict >> order. >> >> That means that if you write a script called foo.nas, >> it's hard to know whether it will get processed before >> or after math.nas and/or props.nas. >> >> So the question is, what to do if foo.nas wants to make >> use of the features provided by the other scripts? >> >> I know about the trick of using settimer(stuff, 0). > > The usual trick is to attach a listener to /sim/signals/nasal-dir-initialized.
That is similar to the settimer trick. Either one will bisect the problem. That is, if you have simple pairwise interactions, you can split each pair and thereby control the ordering. But what if the interactions are more complicated, e.g. a depends on b which depends on c which depends on d........? How hard would it be to handle the general case? There are standard techniques ....... > Also, you can load nasal modules dynamically, such as: > > if (!contains(globals, "MPCarriersNW")) { > io.load_nasal(getprop("/sim/fg-root") ~ > "/Aircraft/MPCarrier/Systems/mp-network.nas", > "MPCarriersNW"); That's a powerful procedure, but it only works _after_ io.nas has been loaded ... so AFAICT it doesn't really answer the question I was asking. ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel