Using listeners and signals with Nasal: Difference between revisions

Jump to navigation Jump to search
m
Use Nasal highlighter
m (Update forum links)
m (Use Nasal highlighter)
Line 222: Line 222:
There are several other options, such as 1) Run a second events system and add an additional parameter to Nasal's settimer allowing you to use this new events system. 2) Add in a signal that is fired each simulation step, probably right before the Autopilot system is run:
There are several other options, such as 1) Run a second events system and add an additional parameter to Nasal's settimer allowing you to use this new events system. 2) Add in a signal that is fired each simulation step, probably right before the Autopilot system is run:


<syntaxhighlight lang="php">
<syntaxhighlight lang="nasal">
setlistener("/sim/signals/fdm-update", func(n) {
setlistener("/sim/signals/fdm-update", func(n) {
       var dt = n.getValue();
       var dt = n.getValue();

Navigation menu