Nuclide
Software Development Kit for id Tech
|
#include "../shared/fteextensions.qc"
#include "../shared/global.h"
#include "../shared/math.h"
#include "../shared/math_vector.h"
Go to the source code of this file.
Macros | |
#define | QWSSQC |
#define | entity_def(x, ...) const string x[] = { __VA_ARGS__ } |
#define | thread(x) if (fork()) { x; abort(); } |
Calls a function (with parameters) in a new thread. More... | |
Functions | |
entity | spawnClass (string className, vector desiredPos) |
Spawns an entity of a specific class. More... | |
void | sendInput (entity target, string inputName, string dataString, entity activator) |
Sends an input (See NSIO::Input) to an entity. More... | |
void | radiusDamage (vector position, float radius, int maxDamage, int minDamage, optional entity attacker) |
Does damage to all entities within a specified radius with a linear falloff. More... | |
bool | isAI (entity entityToCheck) |
Returns true/false depending on if the entity is an AI character. More... | |
bool | isAlive (entity entityToCheck) |
Returns true/false depending on if the entity is alive. More... | |
bool | isGodMode (entity entityToCheck) |
Returns true/false depending on if the entity is in "god" mode. More... | |
bool | isPlayer (entity entityToCheck) |
Returns true/false depending on if the entity is a player. More... | |
bool | isSentient (entity entityToCheck) |
Returns true/false depending on if the entity is either a player, or AI character. More... | |
#define entity_def | ( | x, | |
... | |||
) | const string x[] = { __VA_ARGS__ } |
#define QWSSQC |
#define thread | ( | x | ) | if (fork()) { x; abort(); } |
Calls a function (with parameters) in a new thread.
Returns true/false depending on if the entity is an AI character.
entityToCheck | specifies the entity to check. |
Returns true/false depending on if the entity is alive.
entityToCheck | specifies the entity to check. |
Returns true/false depending on if the entity is in "god" mode.
entityToCheck | specifies the entity to check. |
Returns true/false depending on if the entity is a player.
entityToCheck | specifies the entity to check. |
Returns true/false depending on if the entity is either a player, or AI character.
entityToCheck | specifies the entity to check. |
void radiusDamage | ( | vector | position, |
float | radius, | ||
int | maxDamage, | ||
int | minDamage, | ||
optional entity | attacker | ||
) |
Does damage to all entities within a specified radius with a linear falloff.
position | specifies the position at which the damage event occurs. |
radius | specifies the radius in game units. |
maxDamage | the maximum amount of damage this event can do. |
minDamage | the damage done to the entities on the outer-most rim of the radius. |
attacker | (optional) the source of the attack, defaults to world |
Sends an input (See NSIO::Input) to an entity.
While you're able to manipulate entities in most ways using bare MapC, you might want to change Nuclide specific attributes of them as well. This can only be done using the I/O system.
For the variety of inputs an entity supports, please look at the respective entity-specific documentation.
target | is the entity which will receive the input |
inputName | is the name of the input. E.g. "SetOrigin" |
dataString | contains parameters for the input. E.g. "0 0 0" |
activator | references which entity is "responsible" for triggering this input. |
Spawns an entity of a specific class.
This is the primary, encouraged method of spawning entities in MapC. If you don't spawn an entity class using this, it will not respond to sendInput().
If a specified class does not exist, it will create an info_notnull type entity, but with the new, desired classname.
The only time when this function returns NULL is if the server is unable to allocated any more entities.
className | is the type of class to be instantiated. |
desiredPos | is the world position at which the new entity will be placed. |