This AI is still in early stages of development.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Process instances are functions which you can run to, uhm..., run them...

 

Syntax

// Preferred method (for code clarity):
// retrieve "foo" then run it
Processes("foo")(runData, ignoreQueueSize);
 
// Exactly the same as doing this:
Processes("foo").run(runData, ignoreQueueSize);
 
// Alternate method (for code brevity):
// run a "foo" via it's global function
foo(runData, ignoreQueueSize);
 
// Exactly the same as:
foo.run(runData, ignoreQueueSize);
 
// ...all four methods do exactly the same thing, they are just different syntaxes.

Parameters

ParameterTypeMandatoryNotesPulse Version
runDataVariant(error)

Optionally pass in a value or an object that will be exposed to Tasks, and some events, as the "runData" parameter. See Notes section below for additional information.

Defaults to an empty object.

0.1
ignoreQueueSizeBoolean(error)

If set to true, warnings about excessive run queue size will be suppressed. This is useful when you might be using a game event to run a process in which case several process runs might be issued in short succession within the same game tick.

Defaults to false.

0.1

Return value

ValueTypeNotesProcess Version
<instance>Process Instance

The process instance is returned, so you can chain more instance methods, eg:

Processes("foo")(...).addTask(...);
0.1

Notes

Each time a new instance run is started, the runData parameter is pushed in to a stack so that each run can be given its applicable runData. When the current run finishes, its runData is removed from the stack and the next run starts.

If a trigger has more than PROCESS_MAX_QUEUE runs in its queue, warning messages will be shown to indicate that developer attention is likely required (basically the process instance is becoming overloaded). If you expect to be issuing multiple runs on an instance in short succession, for example because a game event is triggering it, set the ignoreQueueSize parameter to true to avoid such warnings.

Availability

Requires:

  • Warzone 3.1 or above
  • Process 0.1 or above

 

  • No labels