Timer Trigger: Difference between revisions

From FSDeveloper Wiki
Jump to navigationJump to search
(New page: A timer trigger fires when the given number of '''StopTime''' seconds has elapsed. The StartTime value is normally set to 0.0, so the timer starts when the mission is loaded. Setting the S...)
 
m (Replaced Applicable-FSVersion for MSFS with MSFS2020, added MSFS2024)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
A timer trigger fires when the given number of '''StopTime''' seconds has elapsed. The StartTime value is normally set to 0.0, so the timer starts when the mission is loaded. Setting the StopTime value to 5.0 (secs) will make '''actions are initiated by timer triggers when the stop time is reached''' - in 5 seconds from mission start.
[[Category:MSFS Mission Script]]


{{:Ambox-Content-WIP}}


StartTime - The time, in secs, when the timer is to start.
{{Infobox-Applicable-FSVersion
 
| MSFS2024 = unknown
StopTime - The time, in sec, when the timer is to stop, & fire any actions linked.  
| MSFS2020 = true
| FSXI = false
| P3D5 = false
| P3D4 = false
| P3D3 = false
| P3D2 = false
| P3D = false
| FSW = false
| FSXSE = true
| FSXA = true
| FSX = true
| FS2004 = false
| FS2002 = false
| XP11 = false
| XP10 = false
| XP9 = false
}}
A timer trigger is a very useful trigger that waits a specified number of seconds before executing actions. It is often used to start the first actions in the mission.


OnScreenTimer - Set to True if an onscreen timer is to be rendered.  
{{Infobox-MSFS-Script-Element
| category    = Triggers
| name        = TimerTrigger
| short-descr = When active, counts down a specified number of seconds before executing actions.
}}
!CurrentTime
|The time the timer is at, will change when the TimerTrigger is active.
|-
!StartTime
|Time that the Timer starts at when a [[Reset Timer Action|ResetTimerAction]] is executed.
|-
!StopTime
|Time at which the trigger fires.
{{Infobox-MSFS-Script-Element-End}}


OneShot - Set to True means the action should only be fired once.
Notes: only one onscreen timer is possible (so if a new one is opened, it will replace any existing one).


Actions - What actions to fire when the StopTime is reached.
== Possible uses ==
* Use a TimerTrigger with a StopTime of 0 to trigger the first actions of the mission.
* Give the player some time to react.


Activated - The timer trigger is active, not waiting for any other event.  
== Related ==
* You can use a [[Timer Adjust Action|TimerAdjustAction]] to change the '''CurrentTime''' by the amount specified in DeltaTime (positive or negative).
* You can use a [[Reset Timer Action|ResetTimerAction]] to reset the '''CurrentTime''' to the '''StartTime'''.
* You can also keep time with a [[MSFS Mission Script - Calculator|calculator]].


{{:Transclusion_MSFS_Mission_Script_-_Triggers}}


Notes: only one onscreen timer is possible (so if a new one is opened, it will replace any existing one). 


 
{{Template:Navbox-Mission-Creation-MSFS}}
Link a timer trigger and a dialog action by clicking on Property Set for the Actions property. This will bring up a list of items in the Elements box. Double click on an item in the Elements box to link the trigger and action. This will be shown both by a + sign appended to the name in the Elements box.

Latest revision as of 12:22, 25 May 2024


A timer trigger is a very useful trigger that waits a specified number of seconds before executing actions. It is often used to start the first actions in the mission.

TimerTrigger

When active, counts down a specified number of seconds before executing actions.


CurrentTime The time the timer is at, will change when the TimerTrigger is active.
StartTime Time that the Timer starts at when a ResetTimerAction is executed.
StopTime Time at which the trigger fires.

Notes: only one onscreen timer is possible (so if a new one is opened, it will replace any existing one).

Possible uses

  • Use a TimerTrigger with a StopTime of 0 to trigger the first actions of the mission.
  • Give the player some time to react.

Related

  • You can use a TimerAdjustAction to change the CurrentTime by the amount specified in DeltaTime (positive or negative).
  • You can use a ResetTimerAction to reset the CurrentTime to the StartTime.
  • You can also keep time with a calculator.


See MSFS Mission Script - Triggers for an overview of triggers and more info about triggers in general.


Pages relevant to mission creation for MSFS.

Mission structure

Flightplan
Weather definitions
Flight file
Mission script
Triggers
AirportLandingTrigger & AreaLandingTrigger · CounterTrigger · PropertyTrigger · ProximityTrigger · TimerTrigger
Actions
ObjectActivationAction · DialogAction · AdjustPayloadAction · ChangeAssistanceItemAction · FadeToColorAction · RandomAction · RequestTeleportAction · CountAction · ResetTimerAction · TimerAdjustAction · GoalResolutionAction & SubGoalResolutionAction · GrantRewardAction · PointOfInterestActivationAction · ActivateWaypointsAction · AITakeControlsAction · SendMessageToAIAction
Mission objects
Mission definition · Goal · LivingWorldExclusion · Camera
Calculator
Flow states
Events
Areas
Rectangle Area · Cylinder Area · Polygon Area · Corridor Area · InGameMarker
Library objects
Sim objects
RTC

Mission tools

MSFS Script Editor · BushTripInjector · BushMissionGen · MSFSLocalizer · SPB2XML · Little Navmap

Other

Example mission files
Porting FSX Missions to MSFS
Localisation
Click the links to access the topic pages (Default - Opens in same window).