aircraft:tmd:events
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
aircraft:tmd:events [2019/07/20 15:30] – jh | aircraft:tmd:events [2019/07/20 16:04] – [event_swap] jh | ||
---|---|---|---|
Line 5: | Line 5: | ||
A very powerful tool in Aerofly FS 2 aircraft programming in the [[aircraft: | A very powerful tool in Aerofly FS 2 aircraft programming in the [[aircraft: | ||
- | Events are usually only triggered every once in a while and are certainly not intended for constant state logic. Inherently the event logic is state-less. Events cannot replace an underlying [[aircraft: | + | Events are usually only triggered every once in a while and are certainly not intended for constant state logic. Inherently the event logic is state-less. Events cannot replace an underlying [[aircraft: |
> None of the event objects have an '' | > None of the event objects have an '' | ||
Line 54: | Line 54: | ||
< | < | ||
< | < | ||
+ | > | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
> | > | ||
</ | </ | ||
Line 86: | Line 91: | ||
==== event_linear ==== | ==== event_linear ==== | ||
+ | |||
+ | The event_linear changes the value carried by the event and then triggers a list of '' | ||
+ | The new value is simply: '' | ||
< | < | ||
Line 95: | Line 103: | ||
==== event_value ==== | ==== event_value ==== | ||
+ | |||
+ | The event_value overwrites the value carried by the event chain and uses the value from the '' | ||
+ | |||
+ | This is used to set a '' | ||
< | < | ||
Line 102: | Line 114: | ||
</ | </ | ||
- | ===== Basic Events ===== | ||
- | ==== DEV0 ==== | + | ===== Event Logic ===== |
- | The do-nothing placeholder is triggered with '' | + | Depending on the value carried by the event or other values read in decisions can be made and whole decision trees can be set-up. |
- | + | ||
- | < | + | |
- | > | + | |
- | </ | + | |
- | + | ||
- | ==== event_sound ==== | + | |
- | + | ||
- | Normally an event_sound object is used to generate a switch or button sound. Using the trigger function (in this case SwitchSound.Trigger) causes the event_sound to briefly output 1.0 to the sound section of the [[aircraft: | + | |
- | + | ||
- | < | + | |
- | > | + | |
- | </ | + | |
- | + | ||
- | ==== event_pulse ==== | + | |
- | + | ||
- | When the pulse is triggered (function '' | + | |
- | + | ||
- | < | + | |
- | < | + | |
- | > | + | |
- | </ | + | |
- | + | ||
- | ==== Variables ==== | + | |
- | + | ||
- | The variable class isn't an event class as such, it cannot trigger any further events. But events can manipulate the value of a '' | + | |
- | + | ||
- | Available functions are: | + | |
- | * Variable.Set - Changes the value of the variable to the value carried by the event (Value = event_value) | + | |
- | * Variable.Step - The value is increased | + | |
- | * Variable.Reset - The value is set to 0.0 (Value = 0.0) | + | |
- | + | ||
- | < | + | |
- | < | + | |
- | > | + | |
- | </ | + | |
- | + | ||
- | The value of the variable is available to other tmd objects as '' | + | |
- | + | ||
- | ===== Event Value Checks ===== | + | |
- | + | ||
- | Depending on the value carried by the event decisions can be made. | + | |
==== event_sequence ==== | ==== event_sequence ==== | ||
Line 159: | Line 129: | ||
==== event_demultiplexer ==== | ==== event_demultiplexer ==== | ||
+ | |||
+ | This is like a switch case with discrete input taken from the tmd. | ||
+ | |||
+ | The '' | ||
+ | |||
+ | > If InputSelect == 0.0 -> trigger event at index 0 (first in the list), if InputSelect == 1.0 -> trigger event at index 1 (triggers second in the list), etc. | ||
< | < | ||
Line 168: | Line 144: | ||
==== event_select ==== | ==== event_select ==== | ||
- | When triggered the event_select checks the value of the event call and casts it into an integer. Depending on the integer it selects one of the events from the '' | + | This is like a switch case with discrete input taken from the value of the event itself. |
+ | |||
+ | When triggered the event_select checks the value of the event call and casts it into an integer. Depending on the integer it selects one of the events from the '' | ||
This is useful to have when there is a row of buttons, e.g. like a bezel select on an multifunction display and there is only one message name to be used. With an input_event you can receive that message and then call this event_select to do something specific based on the value of the original button message. | This is useful to have when there is a row of buttons, e.g. like a bezel select on an multifunction display and there is only one message name to be used. With an input_event you can receive that message and then call this event_select to do something specific based on the value of the original button message. | ||
Line 185: | Line 163: | ||
==== event_range ==== | ==== event_range ==== | ||
- | When the event range is triggered it checks the value of the event call against the range and triggers either the list of events when inside or outside of the range. E.g. a button could generate a message with value 1.0 which is received by an input_event and then the input_event triggers this event_range. Depending on what the button value was the event_range does one thing within a set range but does something different when the value is outside that range. | + | When the event_range |
< | < | ||
Line 194: | Line 172: | ||
</ | </ | ||
- | ===== Other Event Objects ===== | ||
+ | ===== Event Functions ===== | ||
+ | |||
+ | The following objects allow for different outcomes of a triggered event. | ||
+ | After the execution of a chain of events usually either nothing happens, one or more value are changed or a pulse or timer is triggerd. | ||
+ | |||
+ | ==== DEV0 ==== | ||
+ | |||
+ | The do-nothing placeholder is triggered with '' | ||
+ | |||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ==== Variables ==== | ||
+ | |||
+ | The variable class isn't an event class as such, it cannot trigger any further events. But events can manipulate the value of a '' | ||
+ | |||
+ | Available functions are: | ||
+ | * Variable.Set - Changes the value of the variable to the value carried by the event (Value = event_value) | ||
+ | * Variable.Step - The value is increased or decreased by the value carried by the event (Value += event_value) | ||
+ | * Variable.Reset - The value is set to 0.0 (Value = 0.0) | ||
+ | |||
+ | > Events are not limited to the variable class. Many, in fact almost all of the [[aircraft: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | The value of the variable is available to other tmd objects as '' | ||
+ | |||
+ | |||
+ | ==== event_sound ==== | ||
+ | |||
+ | Normally an event_sound object is used to generate a switch or button sound. Using the trigger function (in this case SwitchSound.Trigger) causes the event_sound to briefly output 1.0 to the sound section of the [[aircraft: | ||
+ | |||
+ | < | ||
+ | > | ||
+ | </ | ||
+ | |||
+ | ==== event_pulse ==== | ||
+ | |||
+ | When the pulse is triggered (function '' | ||
+ | |||
+ | < | ||
+ | < | ||
+ | > | ||
+ | </ | ||
==== event_timeout ==== | ==== event_timeout ==== | ||
+ | The timeout is an object like a countdown, several things can be fired here: '' | ||
+ | to start/ | ||
+ | |||
+ | '' | ||
+ | |||
+ | When the timer has reached zero the list of '' | ||
+ | |||
+ | > The event delay could theoretically restart itself causing a periodic check, but this should be avoided if possible as there are better ways to catch changes in a system state, e.g. the '' | ||
+ | |||
< | < | ||
- | < | + | < |
< | < | ||
> | > | ||
Line 206: | Line 240: | ||
==== event_repeat ==== | ==== event_repeat ==== | ||
+ | |||
+ | Constantly fires an event as long as the input condition is non-zero. When the input is above zero the '' | ||
+ | |||
+ | '' | ||
+ | |||
+ | > It is not intended to trigger a long chain of events, just to fluidly move an input back and forth like the directional gyro adjustment for example. | ||
< | < | ||
Line 217: | Line 257: | ||
==== event_swap ==== | ==== event_swap ==== | ||
+ | |||
+ | This can swap two values within the tmd, e.g. two variables or a variable and an '' | ||
+ | |||
+ | > The '' | ||
< | < | ||
Line 225: | Line 269: | ||
> | > | ||
</ | </ | ||
- |
aircraft/tmd/events.txt · Last modified: 2022/07/19 21:07 by jh