Looking for info on the NEXUS faction in the game? It's in the Warzone Encyclopaedia
.fn
Owned by Aubergine
Defines helper functions available to all NEXUS subroutines (and external scripts).
Syntax
// call a function called "myFunc" var returnValue = ("myFunc" in NEXUS) ? NEXUS.myFunc(params) : alternative; // if you're sure the function exists, simplify that to: var returnValue = NEXUS.myFunc(params); // add a new function to all instances of NEXUS NEXUS.fn.myFunc = someFunction; // add a new function to a specific instance of NEXUS myNEXUS.myFunc = someFunction;
Ready-made NEXUS.fn functions
You can install bundles of ready-made functions using Fn Subroutines.
Calling NEXUS.fn functions
The following memory banks can access 'NEXUS.fn
' via 'this
':
- Classify Subroutines
- Suffix Subroutines
- Locate Subroutines
- Process Subroutines
- Fn Subroutines
- Any other subroutine that is a direct method of
NEXUS
, eg.NEXUS.someFunction()
.
An example follows:
var returnValue = this.whatever(params);
For all other memory banks, and all external code, use the following:
var returnValue = NEXUS.whatever(params);
It's probably best to always use 'NEXUS' instead of 'this' because using 'NEXUS' makes code easier to understand.
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.