Stewart Andreason wrote:

>I see that after a File.RESET, the global variables (at nodes) get
>reinitialized to the values they are set to in the nasal file, but the nasal 
>(pseudo-global-to-the-one-file) variables do not.
>
>I would like to know how to reset the nasal variables.
>I have rounded them up in a function called start_up
>and tried adding start_up to the <nasal> section in the main-set.xml, but it 
>also is only run once.
>
>Is is there an easier way to check for when to call it without putting it in 
>one of the main loops?
>
>if (reinit_vars.getValue()) {
>  start_up();
>}
>
>Also, I find placing this at the top level in the nasal file isn't good enough.
>
>How is it that the global.node variables get reset, but my if statement does 
>not get evaluated more than once? It seems any functions running after the 
>Reset, must be already running with settimer hooks.
>
>Thanks,
>Stewart
>  
>
Check 
http://wiki.flightgear.org/flightgear_wiki/index.php?title=Nasal_scripting_language.
 
You'll want to have a listener on the reset signal

setlistener("/sim/signals/reinit", func {

        start_up();

});

HJ.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to