Check out our discord at https://discord.gg/3u69jMa 

Triggers and ScriptedTriggers: Difference between revisions

From SWRC Wiki
Jump to navigation Jump to search
No edit summary
 
(11 intermediate revisions by the same user not shown)
Line 114: Line 114:
| TT_SquadMemberProximity || Trigger is activated by squad member
| TT_SquadMemberProximity || Trigger is activated by squad member
|}
|}


== Actions ==
== Actions ==
Line 120: Line 121:
! Action !! Description
! Action !! Description
|-
|-
| AddAmmo || X
| AddAmmo || Adds a specified amount of ammo to selected weapon
|-
|-
| AnimateVisorFX || X
| AnimateVisorFX || X
|-
|-
| AttachToGunship || X
| AttachToGunship || Attach an actor's bone to gunship actor (used by briefing levels)
|-
|-
| AttachToTurret || X
| AttachToTurret || Attach a bot/AIController to specified turret
|-
|-
| BlinkHUDGrenade || X
| BlinkHUDGrenade || Flash the grenade icons on the HUD (used by first two levels)
|-
|-
| BlinkHUDHealth || X
| BlinkHUDHealth || Flash the health bar on the HUD (used by first two levels)
|-
|-
| BlinkHUDShields || X
| BlinkHUDShields || Flash the shield bar on the HUD (used by first two levels)
|-
|-
| BlinkHUDSquad || X
| BlinkHUDSquad || Flash the squad icons on the HUD (used by first two levels)
|-
|-
| BlinkHUDSquadCommandPrompt || X
| BlinkHUDSquadCommandPrompt || X
|-
|-
| Briefing || X
| Briefing || Makes the player frozen und locked to certain view angle
|-
|-
| ChangeLevel || X
| ChangeLevel || Let game/client travel to specified URL/level
|-
|-
| ChangeScript || X
| ChangeScript || X
|-
|-
| ChangeSquadMember || X
| ChangeSquadMember || Adds or removes member from player squad
|-
| ChangeSquadStance || Change squad stance to a different formation/type
|-
|-
| ChangeSquadStance || X
| ChangeWeapon || Change player weapon to specified one
|-
|-
| ChangeZoneAudio || X
| ChangeZoneAudio || Change audio class of zones referenced by specified tag
|-
|-
| ConsoleCommand || X
| ConsoleCommand || Execute a console command
|-
|-
| Crouch || X
| Crouch || Makes actor linked to scripted action crouch
|-
|-
| DamageInstigator || X
| DamageInstigator || Pawn linked to scripted action takes specified amount and type of damage
|-
|-
| DestroyActor || X
| DestroyActor || Destroy all actors marked by tag
|-
|-
| DestroyPawn || X
| DestroyPawn || Destroy pawn linked to scripted action
|-
|-
| DisplayCriticalMessage || X
| DisplayCriticalMessage || Display a specified message to top center of screen
|-
|-
| DisplayMessage || X
| DisplayMessage || Same as DisplayCriticalMessage
|-
|-
| EnableAIState || X
| EnableAIState || X
Line 180: Line 183:
| FadeView || X
| FadeView || X
|-
|-
| FailMission || X
| FailMission || Makes screen fade white and kill the player
|-
|-
| FlickerActor || X
| FlickerActor || X
Line 194: Line 197:
| GotoAction || X
| GotoAction || X
|-
|-
| GotoLabel || X
| GotoLabel || Jump to specific label name
|-
|-
| GotoState || X
| GotoState || Set the state of certain actor(s) referenced by tags
|-
|-
| HurtActor || X
| HurtActor || All actors referenced by specified tag takes n amount of damage from specified type and additional parameters
|-
|-
| IfCondition || X
| IfCondition || X
Line 206: Line 209:
| Killinstigator || X
| Killinstigator || X
|-
|-
| Label || X
| Label || Creates a label with specified name
|-
|-
| MakeInvulnerable || X
| MakeInvulnerable || Makes actor(s)/prop(s) invulnerable specified by tag
|-
|-
| MoverToKeyframe || X
| MoverToKeyframe || Move an mover actor to specified keyframe
|-
|-
| MoveToPlayer || X
| MoveToPlayer || X
Line 226: Line 229:
| PlayMovie || X
| PlayMovie || X
|-
|-
| PlayMusic || X
| PlayMusic || Play a certain music track
|-
|-
| PlayPropAnim || X
| PlayPropAnim || X
|-
|-
| PlaySound || X
| PlaySound || Play a certain sound effect
|-
|-
| PlaySoundCue || X
| PlaySoundCue || Play a certain sound cue
|-
|-
| ResetFactory || X
| ResetFactory || Reset specified factories remaining number of spawns
|-
|-
| Revive || X
| Revive || Revive a certain pawn (intended for player and squad members)
|-
|-
| ScreenFade || X
| ScreenFade || Makes the screen fade in a certain color
|-
|-
| SetBattleEngineParams || X
| SetBattleEngineParams || X
Line 248: Line 251:
| SetCanCancelMarker || X
| SetCanCancelMarker || X
|-
|-
| SetCannotDie || X
| SetCannotDie || Sets the property bCannotDie of a specified pawn tag to true or false
|-
|-
| SetCollision || X
| SetCollision || Sets various collision properties of actor(s) with specified tag
|-
|-
| SetHidden || X
| SetHidden || Hide/unhide actor(s) with specified tag
|-
|-
| SetImuseState || X
| SetImuseState || X
Line 258: Line 261:
| SetPawnIdle || X
| SetPawnIdle || X
|-
|-
| SetPhysics || X
| SetPhysics || Set a specific physics to actor(s) specified by tag
|-
|-
| SetScriptPriority || X
| SetScriptPriority || X
Line 290: Line 293:
| ShowVisor || X
| ShowVisor || X
|-
|-
| SpawnActor || X
| SpawnActor || Spawn a certain actor
|-
|-
| SpawnStatusEffect || X
| SpawnStatusEffect || X
Line 300: Line 303:
| SuggestEnemy || X
| SuggestEnemy || X
|-
|-
| TeleportToPoint || X
| TeleportToPoint || Teleport specified actor by tag to specified destination location using tag
|-
|-
| TriggerEvent || X
| TriggerEvent || Trigger a certain event name
|-
|-
| TurnTowardPlayer || X
| TurnTowardPlayer || Makes the actor linked to the scripted action rotate towards player
|-
|-
| UnforceState || X
| UnforceState || X
|-
|-
| WaitForAnimEnd || X
| WaitForAnimEnd || Wait for animation on specified channel to end
|-
|-
| WaitForEvent || X
| WaitForEvent || Wait for a certain event to trigger to start the action flow
|-
|-
| WaitForPlayer || X
| WaitForPlayer || Wait until player gets in distance of pawn linked with scripted action
|-
|-
| WaitForRandomTimer || X
| WaitForRandomTimer || Wait for random amount of seconds in between Max and Min properties
|-
|-
| WaitForTimer || X
| WaitForTimer || Wait for n seconds before continuing the action flow
|}
|}

Latest revision as of 21:29, 3 August 2024

Setup

The purpose of a Trigger is to let some action happen when it gets triggered. (captain obvious)

So what we need for our map, is a Trigger, which will be activated/triggered when the player walks in and a ScriptedTrigger to make the action happen.


Place the trigger on your map where it should get triggered.

Open up the properties of the trigger and change the colission radius width and height to fit your map/room. Remember the action will be triggered when the player touches/walks in the radius of that Trigger.


While having the properties window open for the Trigger, head to the Events tab and enter an event name. This example will use the event name "tutorial".


Now when the player walks into the trigger radius, an event with the name "tutorial" will trigger. To let the actual action happen, we need a ScriptedTrigger. So open up the actor window and navigate to Actor -> AIScript -> ScriptedSequence -> ScriptedTrigger and place it next to the normal trigger.

To keep the map nice and clean, it's recommended to put the Trigger and ScriptedTrigger right next to each other so it won't be a mess when you place lots of them.

Open properties window and go to the AIScript category. Click on the plus icon in the Actions section. You are now able to to add a new action by clicking on the "Add" button on the right border of the window.


After adding a new action, we have to select a specific one which is called "ACTION_WaitForEvent". So open up the drop down menu by clicking on ACTION_AddAmmo and select WaitForEvent. (Right on the bottom) After that, click on "New". We tell the action chain to wait for a certain event to trigger.


For ExternalEvent, add the event name of the Trigger which is "tutorial" in this case. The ScriptedTrigger waits until an event with this exact name is getting triggered.


To sum up everything so far, we created a trigger with a specific event name. It gets triggered when the player steps into the radius. The ScriptedTrigger has an action called "WaitForEvent", which then gets activated when the trigger gets activated. The rest of the action gets handled by the ScriptedTrigger.


So we have a ScriptedTrigger ready to do some action, the actual process of the actions is the same now. You minimize the first Actions tab "[0]" by clicking on the minus and click on "Add" to add a new tab for the actions.

For a list of detailed actions, see below. For this tutorial we will be using PlaySound action.


To add the actual sound, go to the sound browser and select a sound you want to use. Go back to the ScriptedTrigger, click in the Sound field and click on "Use" button on right side of the properties window. The ScriptedTrigger adds the sound automatically to the field.

This "PlaySound" action got some additional parameters, for example Volume and bWaitForFinish. While Volume is self explaining, bWaitForFinish is being used to halt the action flow until the sound finished playing, so setting this value to true will wait until the sound is done playing and afterwards continue with the action flow.


Trigger Behaviour

A Trigger can activate one or more ScriptedTriggers at the same time if the event name is the same.

One or more Triggers can activate one ScriptedTrigger when the event name is the same.

                 |------- ScriptedTrigger0
Trigger0 --------|
                 |------- ScriptedTrigger1



Trigger0 --------|
                 |------- ScriptedTrigger0
Trigger1 --------|


Trigger Properties

The trigger provides some additional customizable properties which are very handy.

Property Description
bInitiallyActive Whether the trigger is active or not. Can be toggled via scripted actions.
bTriggerOnceOnly Whether the trigger should trigger once or multiple times
Message A message to display when it gets triggered
ReTriggerDelay Delay in seconds before a retrigger can happen if bTriggerOnceOnly is set to false
TriggerType What can trigger it


TriggerType

Type Behaviour
TT_PlayerProximity Trigger is activated by player proximity
TT_PawnProximity Trigger is activated by any pawn's proximity
TT_ClassProximity Trigger is activated by actor of ClassProximityType only
TT_AnyProximity Trigger is activated by any actor in proximity
TT_Shoot Trigger is activated by player shooting it
TT_HumanPlayerProximity Trigger is activated by human player (not bot)
TT_Use Trigger is activated manually by player pressing use key ("F" by default)
TT_SquadMemberProximity Trigger is activated by squad member


Actions

Action Description
AddAmmo Adds a specified amount of ammo to selected weapon
AnimateVisorFX X
AttachToGunship Attach an actor's bone to gunship actor (used by briefing levels)
AttachToTurret Attach a bot/AIController to specified turret
BlinkHUDGrenade Flash the grenade icons on the HUD (used by first two levels)
BlinkHUDHealth Flash the health bar on the HUD (used by first two levels)
BlinkHUDShields Flash the shield bar on the HUD (used by first two levels)
BlinkHUDSquad Flash the squad icons on the HUD (used by first two levels)
BlinkHUDSquadCommandPrompt X
Briefing Makes the player frozen und locked to certain view angle
ChangeLevel Let game/client travel to specified URL/level
ChangeScript X
ChangeSquadMember Adds or removes member from player squad
ChangeSquadStance Change squad stance to a different formation/type
ChangeWeapon Change player weapon to specified one
ChangeZoneAudio Change audio class of zones referenced by specified tag
ConsoleCommand Execute a console command
Crouch Makes actor linked to scripted action crouch
DamageInstigator Pawn linked to scripted action takes specified amount and type of damage
DestroyActor Destroy all actors marked by tag
DestroyPawn Destroy pawn linked to scripted action
DisplayCriticalMessage Display a specified message to top center of screen
DisplayMessage Same as DisplayCriticalMessage
EnableAIState X
EnableAIVoice X
EnableBattleEngine X
EnableBlockedComputations X
EnableNavPtSpecial X
EnableSecurePosition X
EndSection X
FadeView X
FailMission Makes screen fade white and kill the player
FlickerActor X
ForceBattleMusic X
ForceState X
ForceVictoryFlourish X
GenerateStimulus X
GotoAction X
GotoLabel Jump to specific label name
GotoState Set the state of certain actor(s) referenced by tags
HurtActor All actors referenced by specified tag takes n amount of damage from specified type and additional parameters
IfCondition X
IfRandomPct X
Killinstigator X
Label Creates a label with specified name
MakeInvulnerable Makes actor(s)/prop(s) invulnerable specified by tag
MoverToKeyframe Move an mover actor to specified keyframe
MoveToPlayer X
MoveToPoint X
ObjectiveUpdate X
PlayAmbientSound X
PlayAnim X
PlayLocalSound X
PlayMovie X
PlayMusic Play a certain music track
PlayPropAnim X
PlaySound Play a certain sound effect
PlaySoundCue Play a certain sound cue
ResetFactory Reset specified factories remaining number of spawns
Revive Revive a certain pawn (intended for player and squad members)
ScreenFade Makes the screen fade in a certain color
SetBattleEngineParams X
SetBattleMusicMulti X
SetBlocked X
SetCanCancelMarker X
SetCannotDie Sets the property bCannotDie of a specified pawn tag to true or false
SetCollision Sets various collision properties of actor(s) with specified tag
SetHidden Hide/unhide actor(s) with specified tag
SetImuseState X
SetPawnIdle X
SetPhysics Set a specific physics to actor(s) specified by tag
SetScriptPriority X
SetSightRadius X
SetTeamIndex X
SetThreat X
SetTurretUsable X
SetViewTarget X
ShakeView X
ShootTarget X
ShowActorObjectiveTracker X
ShowDebriefingScreen X
ShowMarker X
ShowMenuScreen X
ShowPrompt X
ShowTitleCardScreen X
ShowVisor X
SpawnActor Spawn a certain actor
SpawnStatusEffect X
StopFactorySpawning X
StopShooting X
SuggestEnemy X
TeleportToPoint Teleport specified actor by tag to specified destination location using tag
TriggerEvent Trigger a certain event name
TurnTowardPlayer Makes the actor linked to the scripted action rotate towards player
UnforceState X
WaitForAnimEnd Wait for animation on specified channel to end
WaitForEvent Wait for a certain event to trigger to start the action flow
WaitForPlayer Wait until player gets in distance of pawn linked with scripted action
WaitForRandomTimer Wait for random amount of seconds in between Max and Min properties
WaitForTimer Wait for n seconds before continuing the action flow