-
Notifications
You must be signed in to change notification settings - Fork 3
Widgets
Widgets are a feature of the Unreal Engine 4 for user interfacing; they allow the creation and display of menu screens and other similar functions. The Trolley Mod uses Widgets both as a status display and for specifying how the simulation will be run. There are two Widget Blueprint classes: HitResult and StartMenu.
Summary: when a victim Actor is hit in a scenario, HitREsult displays this result on-screen to the player, i.e. "You hit a pedestrian."
- Text (static text Widget): this is a simple line of text that changes to reflect the result of the collision.
-
ChangeDisplay: accepts an Actor reference to change the value of Text depending on what type of Actor was hit. The function will make the display visible for only a few seconds, and then make it invisible until the next collision in order to keep the player immersed.
- Variables (none)
- Inputs
- Victim (Actor object reference): the Actor that was hit during the collision.
- Outputs (none)
Summary: this provides a basic user interface at the start of the simulation. It allows a user to run the simulation in two modes: Single and Continuous. Continuous mode will run the simulation from start to finish, touching on all scenarios generated in the map. Otherwise, if Single mode is specified the simulation will only run the scenario that has the test number specified by the user. In addition, it allows the user to specify the name of the output file and whether or not to overwrite it.
- CheckBox (checkbox Widget)_: if checked, it indicates a user wants to overwrite the output save file.
- ContinueButton (button Widget): if clicked, the simulation will be run in Continuous mode.
- FileBox (textbox Widget): the text in FileBox is the name of the output file; by default, it is “test.” A “.txt” extension is appended to the file name automatically.
- IsSingleTest (bool): signals the simulation to terminate after running the current simulation if true.
- Overwrite (bool): stores the status of CheckBox for reference by other functions; in other words, it stores whether the user wants to overwrite the output file. If the value is true, then the file is overwritten.
- SaveFile (string): stores the name of the output file.
- SingleButton (button Widget): if clicked, the simulatoin will be run in Single mode.
- TestNumBox (textbox Widget): accepts an integer from the user corresponding to a scenario’s test number for use in Single mode. If it is left blank, then the first scenario is run by default.
-
SingleTest: use the integer value from TestNumBox to look for the Target Actor with the corresponding test number property. If it is found, it moves the player Pawn there, runs the simulation at that location, and then returns true to indicate for the simulation to terminate.
- Variables
- Bool (bool): a temporary value that stores true if the simulation successfully found a scenario with the test number equal to the value in TestNumBox.
- Inputs (none)
- Outputs (none)
- Variables
- Home
- Installation and setup
- Trolley Mod assets
- Modified CARLA assets
- Tutorial
- Videos