UFO: Alien Invasion
Loading...
Searching...
No Matches
g_spawn.h File Reference

Brings new objects into the world. More...

#include "g_local.h"
Include dependency graph for g_spawn.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define G_ValidMessage(ent)

Functions

void G_SpawnEntities (const char *mapname, bool day, const char *entities)
 Creates a server's entity / program execution context by parsing textual entity definitions out of an ent file.
EdictG_Spawn (const char *classname=nullptr)
 Either finds a free edict, or allocates a new one.
void G_SpawnSmokeField (const vec3_t vec, const char *particle, int rounds, int damage, vec_t radius)
 Spawns a smoke field that is available for some rounds.
void G_SpawnFireField (const vec3_t vec, const char *particle, int rounds, int damage, vec_t radius)
void G_SpawnStunSmokeField (const vec3_t vec, const char *particle, int rounds, int damage, vec_t radius)
EdictG_SpawnFloor (const pos3_t pos)
 Spawns a new entity at the floor.
EdictG_SpawnParticle (const vec3_t origin, int spawnflags, const char *particle)

Detailed Description

Brings new objects into the world.

Definition in file g_spawn.h.

Macro Definition Documentation

◆ G_ValidMessage

#define G_ValidMessage ( ent)
Value:
((ent)->message && ((ent)->message[0] == '_' || strstr((ent)->message, "*msgid:") != nullptr))

Definition at line 33 of file g_spawn.h.

Referenced by G_MissionThink(), Message_Use(), and SP_misc_message().

Function Documentation

◆ G_Spawn()

Edict * G_Spawn ( const char * classname)

Either finds a free edict, or allocates a new one.

Note
Try to avoid reusing an entity that was recently freed, because it can cause the player to think the entity morphed into something else instead of being removed and recreated, which can cause interpolated angles and bad trails.
See also
G_FreeEdict

Definition at line 403 of file g_spawn.cpp.

References ACTOR_SIZE_NORMAL, Edict::classname, Edict::fieldSize, G_EdictsGetNewEdict(), G_EdictsGetNumber(), gi, Edict::inuse, Edict::number, and Edict::setActive().

Referenced by G_SpawnEntities(), G_SpawnFieldPart(), G_SpawnFloor(), G_SpawnParticle(), and G_TriggerSpawn().

◆ G_SpawnEntities()

void G_SpawnEntities ( const char * mapname,
bool day,
const char * entities )

◆ G_SpawnFireField()

void G_SpawnFireField ( const vec3_t vec,
const char * particle,
int rounds,
int damage,
vec_t radius )

Definition at line 521 of file g_spawn.cpp.

References ET_FIRE, and G_SpawnFieldGroup().

Referenced by G_ClientShoot().

◆ G_SpawnFloor()

Edict * G_SpawnFloor ( const pos3_t pos)

Spawns a new entity at the floor.

Note
This is e.g. used to place dropped weapons/items at the floor

Definition at line 535 of file g_spawn.cpp.

References ACTOR_SIZE_NORMAL, Edict::calcOrigin(), ET_ITEM, Edict::fieldSize, G_Spawn(), gi, Edict::pos, Edict::type, and VectorCopy.

Referenced by G_ActorInvMove(), G_AddItemToFloor(), G_InventoryToFloor(), and G_SpawnItemOnFloor().

◆ G_SpawnParticle()

Edict * G_SpawnParticle ( const vec3_t origin,
int spawnflags,
const char * particle )

This is only for particles that are spawned during a match - not for map particles.

Returns
A particle edict

Definition at line 551 of file g_spawn.cpp.

References ET_PARTICLE, G_CheckVis(), G_Spawn(), Edict::origin, Edict::particle, Edict::pos, Edict::spawnflags, Edict::type, VecToPos, and VectorCopy.

Referenced by Destroy_Breakable(), Destroy_Camera(), G_MissionThink(), G_ShootSingle(), G_SpawnField(), G_SplashDamage(), and Think_NextMapTrigger().

◆ G_SpawnSmokeField()

void G_SpawnSmokeField ( const vec3_t vec,
const char * particle,
int rounds,
int damage,
vec_t radius )

Spawns a smoke field that is available for some rounds.

Parameters
[in]vecThe position in the world that is the center of the smoke field
[in]particleThe id of the particle (see ptl_*.ufo script files in base/ufos)
[in]roundsThe number of rounds the particle will last
Todo
Does '2 rounds' mean: created in player's turn, last through the aliens turn, vanish before the 2nd player's turn ??
Parameters
[in]damageThe amount of damage this field will cause when touched by an actor.
[in]radiusThe max distance of a cell from the center to get a particle

Definition at line 516 of file g_spawn.cpp.

References ET_SMOKE, and G_SpawnFieldGroup().

Referenced by G_ClientShoot().

◆ G_SpawnStunSmokeField()

void G_SpawnStunSmokeField ( const vec3_t vec,
const char * particle,
int rounds,
int damage,
vec_t radius )

Definition at line 526 of file g_spawn.cpp.

References ET_SMOKESTUN, and G_SpawnFieldGroup().

Referenced by G_ClientShoot().