Nuclide
Software Development Kit for id Tech
|
MapC/Shared Game-Logic API. 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 | entityDamage (entity targetEnt, entity inflictingEnt, entity attackingEnt, string damageDef, string weaponDef, vector damageOrigin, vector damageDir, vector hitLocation) |
Applies damage to a given entity. More... | |
void | radiusDamage (vector damageCenter, float damageRange, int damageMin, int damageMax, entity attackingEnt) |
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... | |
bool | isBot (entity entityToCheck) |
Returns true/false depending on if the entity is a bot. More... | |
string | timeToString (int realTime, int zoneType, string formatString) |
Returns the current time. More... | |
MapC/Shared Game-Logic API.
APIs used by MapC progs and the server progs exclusively.
void entityDamage | ( | entity | targetEnt, |
entity | inflictingEnt, | ||
entity | attackingEnt, | ||
string | damageDef, | ||
string | weaponDef, | ||
vector | damageOrigin, | ||
vector | damageDir, | ||
vector | hitLocation | ||
) |
Applies damage to a given entity.
Requires the use of damageDef/entityDef since we're run out of parameters in QuakeC.
targetEnt | is the entity receiving the damage. |
inflictingEnt | is the entity causing the damage (e.g. a projectile, rocket) |
attackingEnt | is the entity owning up to the damage. |
damageDef | is the damageDef containing all the info, including damage points |
weaponDef | is (if not "") the name of the weapon causing the damage. |
damageOrigin | is the location where the damage comes from. |
damageDir | is the direction the damage is coming from. |
hitLocation | is the final hit location, where the damage is applied. |
bool isAI | ( | entity | entityToCheck | ) |
Returns true/false depending on if the entity is an AI character.
entityToCheck | specifies the entity to check. |
bool isAlive | ( | entity | entityToCheck | ) |
Returns true/false depending on if the entity is alive.
entityToCheck | specifies the entity to check. |
bool isBot | ( | entity | entityToCheck | ) |
Returns true/false depending on if the entity is a bot.
entityToCheck | specifies the entity to check. |
bool isGodMode | ( | entity | entityToCheck | ) |
Returns true/false depending on if the entity is in "god" mode.
entityToCheck | specifies the entity to check. |
bool isPlayer | ( | entity | entityToCheck | ) |
Returns true/false depending on if the entity is a player.
entityToCheck | specifies the entity to check. |
bool isSentient | ( | entity | entityToCheck | ) |
Returns true/false depending on if the entity is either a player, or AI character.
entityToCheck | specifies the entity to check. |
void radiusDamage | ( | vector | damageCenter, |
float | damageRange, | ||
int | damageMin, | ||
int | damageMax, | ||
entity | attackingEnt | ||
) |
Does damage to all entities within a specified radius with a linear falloff.
If a negative damageMax value is supplied, then no collision checks will be performed. So radiusDamage calls will not be obstructed by level or entity geometry.
damageCenter | is the location of the center, at which the wave originates. |
damageRange | is the radius (in game units) of the wave. |
damageMax | is the maximum damage that can be done by this wave. |
damageMin | is the minimum amount of damage done, at the very edge. |
attackingEnt | is the entity owning up to the damage. |
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. |
entity spawnClass | ( | string | className, |
vector | desiredPos | ||
) |
Spawns an entity of a specific class.
Returns a new entity.
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. |
Returns the current time.
realTime | specifies the time in seconds since 01/01/1970. |
zoneType | specifies the time zone to use. 0 = UTC, 1 = Local. |
formatString | is a C-language, strftime styled string setting the output format |