Mostly Harmless
Legacy:Event Triggers
There is some low-level link between the key bindings and the UI events. For example, in User.ini, under [Engine.input], we have the following line:
Escape=SendEvent ShowMenus
This states that pressing escape will trigger ShowMenus. This relates to the following in U2Menus.ui
[Root] Class=MultiStateComponent State=NonMain State=Main Transition=ResetMenus,0,0,0,NULL Transition=ShowMenus,1,1,0,NULL TriggerEvent=0,0.0,CodeMonkey,UnPause TriggerEvent=1,0.0,CodeMonkey,Pause TriggerEvent=1,0.0,Event,MenuBackgroundBlurry.FadeOut TriggerEvent=1,0.0,Event,MainMenuBackgroundLarge.Grow TriggerEvent=1,0.0,Event,MainMenuBackgroundSmall.Show DrawOrder=99 Localize=true
The line:
Transition=ShowMenus,1,1,0,NULL
defines this particular event.
I tested this by creating a useless event, which does the same thing as notifying you of a new objective. In U2HUD.ui, this defines the ObjectiveNotify component:
[ObjectiveNotify] Class=MultiStateComponent State=NULL State=ObjectiveNotifyText Transition=NewObjective,1,0,4.0,ObjectiveNotifyText:NewObjective Transition=Honestly,1,0,4.0,ObjectiveNotifyText:Honestly Transition=ObjectiveCompleted,1,0,4.0,ObjectiveNotifyText:ObjectiveCompleted Transition=ObjectiveFailed,1,0,4.0,ObjectiveNotifyText:ObjectiveFailed TweenLocation=false TweenAlpha=true DrawOrder=1
I added the line in bold here. Then, I entered the corresponding keybinding in User.ini:
F3=SendEvent Honestly
Finally, in U2HUD.int, the text is defined:
[General] AutoTurret=Auto Turret RocketTurret=Rocket Turret FieldGenerator=Field Generator ProximitySensor=Proximity Sensor XMP_Unknown=Unknown Objectives=OBJECTIVES NewObjective=F4 - New Objective Honestly=Honestly! ObjectiveCompleted=F4 - Objective Completed ObjectiveFailed=F4 - Objective Failed EndGame_LoadMenu=Load menu EndGame_QuickLoad=Quick load EndGame_RestartLevel=Restart EndGame_Quit=QUIT Confirmation_Ok=Ok Confirmation_Cancel=Cancel Confirmation_QuickLoad=REALLY LOAD?
Thus, when I press F3 during the game, "Honestly!" appears in the bottom left corner of the screen.
Normally, Objective notify events will be triggered from UnrealScript - the U2GameInfo class, in function UpdateObjective()
switch(Status) { case OBJECTIVE_Incomplete: class'UIConsole'.static.SendEvent("NewObjective"); break; case OBJECTIVE_Completed: class'UIConsole'.static.SendEvent("ObjectiveCompleted"); break; case OBJECTIVE_Failed: class'UIConsole'.static.SendEvent("ObjectiveFailed"); break; }
This acheives exactly the same result, and the same native function must be called, if not from UnrealScript, in the first case I described.
MythOpus: I believe EventTriggers are only used in Unreal 2 am I right?