Looking for info on the NEXUS faction in the game? It's in the Warzone Encyclopaedia
NEXUS()
Owned by Aubergine
The API namespace for NEXUS, that doubles up as a function for triggering tasks.
Triggering Tasks
The NEXUS() function is used to trigger tasks, optionally passing in associated objects to be passed to the task processor.
Syntax
var didSomething = NEXUS(taskID [,obj [, etc...]]);
Parameters
Parameter | Mandataory | Type | Notes | NEXUS Version |
---|---|---|---|---|
taskID | String | The name of the task to trigger. | v0.1 and above | |
obj | Object | An object, usually a game object, associated with the 'taskID'. If you've installed a Suffix Subroutine that recognises the object, it will generate a suffix and add that to your 'taskID'. | v0.1 and above | |
etc... | Any | Optionally specify more parameters. Along with 'obj', the additional parameters will be passed in to the function specified in the action object associated with 'taskID'. | v0.1 and above |
Return value
Value | Type | Notes | NEXUS Version |
---|---|---|---|
true | Boolean | NEXUS found an action associated with the specified 'taskID' and has processed it successfully. | v0.1 and above |
false | Boolean | Dr. Reed is furious with your actions and has triggered The Collapse. You should prepare for nuclear winter, stock up on food and make your way calmly to the nearest underground bunker. Message ends. | v0.1 and above |
Example
// trigger a custom task NEXUS("tell.me.a.story"); // trigger task "tell.me.a.story" // a custom task with a droid you own var myDroid = enumDroid(me)[0]; // this assumes you have at least one droid // assuming you've installed the default suffix routine... NEXUS("do.something.with", myDroid); // trigger task key "do.something.with.My" // The suffix routine looks at myDroid, sees it belongs to you and adds the ".My" suffix // custom event using droid classification // requires a classify subroutine to be installed, let's assume default one is installed... // let's assume the myDroid is a truck you own... NEXUS("tickle"+NEXUS.classify(myDroid), myDroid); // trigger task "tickle.droid.truck.My"
Contents
Assimilate:
API Browser
Observe:
- NEXUS() — The API namespace for NEXUS, that doubles up as a function for triggering tasks.
- .infiltrate() — Infiltrates core systems so that NEXUS can absorb them.
- .suffix() — Determines the appropriate event key suffix based on the passed in object.
- .fn — Defines helper functions available to all NEXUS subroutines (and external scripts).
- .actions
- .classify() — Classifies an object using the installed taxonomy in order to derive an "Object Key".
- .default — Stores various defaults for NEXUS subroutines.