Contents

Creating a VGUI Task List

A task list for the player might be useful for your mod. This tutorial shows how to implement a simple task list that can display from 1-4 tasks, each with individual text and priority level. Priority and status is indicated by text color, with low and medium priority tasks shown in yellow, and high priority tasks shown in red. Tasks that have been completed are shown in green. A new companion entity called an "env_hudtasklist" allows map I/O to add and remove tasks, set text and change priority levels.

Using the new Task List

Add a new tasklist entity to a test map. You can set it's initial set of tasks and priorities if you'd like. You can also have other entities directly set task text and priorities via entity outputs.

Improvements and Brainstorms

There is a lot that could be done to improve on this task list.

Visually it's pretty simple, and there is definitely room for improvement to it's look.

The display of task urgency plus and task state transitions (fading when removed, flashing when new) could be improved or modified. Make the text of new tasks "slide in" from the right?

The current implementation also only allows for 4 tasks. Obviously one might want to add more.

Another option might be to allow the task list to only be displayed when a key is held down. Examining the code for the scoreboard would be a good start, since it draws the scoreboard only when the (default) Tab key is held down.

It's also not very good that the colors, fonts and other text is all hardwired into the code. It would be great to put that out into a .res file, plus localize the text!

Allow for a "percent done" to be displayed for each task

Allow a task to be shown as "active" - meaning you are actively working on that task

Allow NPCs to be "active" in a task

Show number of NPCs active on task

Port to multiplayer and have "team" task status and "individual" task status

Show number of players on team tasks active on task

Some kind of symbol next to tasks active and tasks completed. Checkbox anyone?