Difference between revisions of "Mission Task Events"

From Bit Phoenix Software
Jump to navigation Jump to search
(Created page with "In The Peacenet, the mission system allows ''mission tasks'' to receive signals from the game when various events occur in-game. This includes programs opening or closing...")
(No difference)

Revision as of 16:31, 31 March 2019

In The Peacenet, the mission system allows mission tasks to receive signals from the game when various events occur in-game. This includes programs opening or closing, systems being hacked, files being written, and more.

This article documents this mission task event system and how it works.

Event structure

Events come into the mission system with a name and an event argument map. The name is a simple FString (String in Blueprint), and the argument map is a TMap<FString, FString> (Map of Strings to Strings in Blueprint). This allows the event system to receive completely arbitrary signals from the game without needing to care

  • where they came from
  • what gameplay mechanic they belong to

& what they are

before your specific Mission Task gets ahold of the signal.

Sending a signal

If you'd like to send a signal to the mission system, you will need a pointer to the Peacenet World State Actor. This can be retrieved using the GetPeacenet() methods of a User Context, System Context, Window Object, Program Object, Terminal Command Object, or any other object that is attached to the Peacenet world.

With this pointer, simply call SendGameEvent("Event Name", { { "Argument 1", "Value 1" }, { "Argument 2", "Value 2" } }). The game will automatically dispatch the event for you if a mission is in progress. Calls to this function will be ignored when the player is in free roam.

Receiving a signal

Inside a Mission Task Object, you can receive a signal from the game in both C++ and Blueprint.

C++

In your header file, add:

protected:
    virtual void NativeEvent(FString EventName, TMap<FString, FString> InEventArgs) override;

to override the event handling function of MissionTask.

In the source file, add:

void UMyMissionTask::NativeEvent(FString EventName, TMap<FString, FString> InEventArgs)
{
    // foo
}

to handle the event. You can check the event name and arguments against this page's reference of common events.

Common events

None yet.