diff --git a/code/game/g_breakable.c b/code/game/g_breakable.c index d189ec5..22f77a6 100644 --- a/code/game/g_breakable.c +++ b/code/game/g_breakable.c @@ -497,6 +497,8 @@ void SP_misc_model_breakable( gentity_t *ent ) // // AMMO plugin functions // +// Remove this? No purpose in RPG-X other than displaying something fixed... +// // -------------------------------------------------------------------- void ammo_use( gentity_t *self, gentity_t *other, gentity_t *activator); diff --git a/code/game/g_client.c b/code/game/g_client.c index 43d2ec1..9a523c3 100644 --- a/code/game/g_client.c +++ b/code/game/g_client.c @@ -53,7 +53,7 @@ void G_InitTransport( int clientNum, vec3_t origin, vec3_t angles ) { potential spawning position for deathmatch games. -----SPAWNFLAGS----- -1: INITIAL - Preferred spawn for the first spawn of a clientwhen entering a match. +1: INITIAL - Preferred spawn for the first spawn of a client when entering a match. -----KEYS----- "target" - entities with matching targetname will be fired if someone spawns here. @@ -82,27 +82,6 @@ void SP_info_player_deathmatch( gentity_t *ent ) { trap_LinkEntity(ent); } -/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 32) INITIAL ------DESCRIPTION----- -Merely a fancy name for info_player_deathmatch. -On spawn will reset classname sppropriately and respawn itself. - ------SPAWNFLAGS----- -1: INITIAL - Preferred spawn for the first spawn of a clientwhen entering a match. - ------KEYS----- -"target" - entities with matching targetname will be fired if someone spawns here. -"nobots" - if 1 will prevent bots from using this spot. -"nohumans" - if 1 will prevent non-bots from using this spot. -*/ -/** -* Spawn function for player start spawnpoint which actually the same as deatchmatch spawnpoint -*/ -void SP_info_player_start(gentity_t *ent) { - ent->classname = G_NewString("info_player_deathmatch"); - SP_info_player_deathmatch( ent ); -} - /*QUAKED info_player_intermission (1 0 1) (-16 -16 -24) (16 16 32) -----DESCRIPTION----- The intermission will be viewed from this point. diff --git a/code/game/g_forcefield2.c b/code/game/g_forcefield2.c deleted file mode 100644 index 7cdfcce..0000000 --- a/code/game/g_forcefield2.c +++ /dev/null @@ -1,161 +0,0 @@ -#include "g_local.h" - -extern void InitMover( gentity_t *ent ); - -extern gentity_t *G_TestEntityPosition( gentity_t *ent ); -void func_forcefield2_use (gentity_t *self, gentity_t *other, gentity_t *activator); -void func_forcefield2_wait_return_solid( gentity_t *self ) -{ - //once a frame, see if it's clear. - self->clipmask = CONTENTS_BODY; - if ( !(self->spawnflags&16) || G_TestEntityPosition( self ) == NULL ) - { - trap_SetBrushModel( self, self->model ); - InitMover( self ); - VectorCopy( self->s.origin, self->s.pos.trBase ); - VectorCopy( self->s.origin, self->r.currentOrigin ); - self->r.svFlags &= ~SVF_NOCLIENT; - self->s.eFlags &= ~EF_NODRAW; - self->use = func_forcefield2_use; - self->clipmask = 0; - /* - if ( self->s.eFlags & EF_ANIM_ONCE ) - {//Start our anim - self->s.frame = 0; - } - */ - if ( !(self->spawnflags&1) ) - {//START_OFF doesn't effect area portals - trap_AdjustAreaPortalState( self, qfalse ); - } - } - else - { - self->clipmask = 0; - self->think = func_forcefield2_wait_return_solid; - self->nextthink = level.time + FRAMETIME; - } -} - -void func_forcefield2_think( gentity_t *self ) -{ - if ( self->spawnflags & 8 ) - { - //self->r.svFlags |= SVF_PLAYER_USABLE; //Replace the usable flag - self->use = func_forcefield2_use; - self->think = 0/*NULL*/; - self->nextthink = -1; - } -} - -void func_forcefield2_use (gentity_t *self, gentity_t *other, gentity_t *activator) -{//Toggle on and off - - if ( !self->count ) - {//become solid again - self->count = 1; - func_forcefield2_wait_return_solid( self ); - } - else - { - self->s.solid = 0; - self->r.contents = 0; - self->clipmask = 0; - self->r.svFlags |= SVF_NOCLIENT; - self->s.eFlags |= EF_NODRAW; - self->count = 0; - - if(self->target && self->target[0]) - { - G_UseTargets(self, activator); - } - self->think = 0/*NULL*/; - self->nextthink = -1; - if ( !(self->spawnflags&1) ) - {//START_OFF doesn't effect area portals - trap_AdjustAreaPortalState( self, qtrue ); - } - } -} - -void func_forcefield2_pain(gentity_t *self, gentity_t *attacker, int damage) -{ - self->use( self, attacker, attacker ); -} - -void func_forcefield2_die(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod) -{ - self->takedamage = qfalse; - self->use( self, inflictor, attacker ); -} - -/*QUAKED func_forcefield2 (0 .5 .8) ? STARTOFF AUTOANIM X ALWAYS_ON NOBLOCKCHECK X X X ------DESCRIPTION----- -DO NOT USE! This is basically the original Game forcefield with some tweaks and not much different than a func_usable. -It just sits here in case you encounter it one day. - -A bmodel that can be used directly by the player's "activate" button - ------SPAWNFLAGS----- -1: START_OFF - the forcefield will not be there -2: AUTOANIM - If useing an md3, it will animate -4: X - Unused? -8: ALWAYS_ON - Doesn't toggle on and off when used, just fires target -16: NOBLOCKCHECK - Will NOT turn on while something is inside it unless this is checked -32: X - Unused? -64: X - Unused? -128: X - Unused? - ------KEYS----- -"targetname" - When used, will toggle on and off -"target" - Will fire this target every time it is toggled OFF -"model2" - .md3 model to also draw -"color" - constantLight color -"light" - constantLight radius -"wait" - amount of time before the object is usable again (only valid with ALWAYS_ON flag) -"health" - if it has health, it will be used whenever shot at/killed - if you want it to only be used once this way, set health to 1 -*/ - -void SP_func_forcefield2( gentity_t *self ) -{ - trap_SetBrushModel( self, self->model ); - InitMover( self ); - VectorCopy( self->s.origin, self->s.pos.trBase ); - VectorCopy( self->s.origin, self->r.currentOrigin ); - - self->count = 1; - if (self->spawnflags & 1) - { - self->s.solid = 0; - self->r.contents = 0; - self->clipmask = 0; - self->r.svFlags |= SVF_NOCLIENT; - self->s.eFlags |= EF_NODRAW; - self->count = 0; - } - - if (self->spawnflags & 2) - { - self->s.eFlags |= EF_ANIM_ALLFAST; - } - - /* - if (self->spawnflags & 4) - {//FIXME: need to be able to do change to something when it's done? Or not be usable until it's done? - self->s.eFlags |= EF_ANIM_ONCE; - } - */ - - self->use = func_forcefield2_use; - - if ( self->health ) - { - self->takedamage = qtrue; - self->die = func_forcefield2_die; - self->pain = func_forcefield2_pain; - } - - trap_LinkEntity (self); - - self->team = "3"; -} diff --git a/code/game/g_items.c b/code/game/g_items.c index 2ec2d53..1fe0ce5 100644 --- a/code/game/g_items.c +++ b/code/game/g_items.c @@ -215,19 +215,6 @@ void Padd_Remove( gentity_t *key ) } } - -/*QUAKED item_botroam (.5 .3 .7) (-16 -16 -24) (16 16 0) ------DESCRIPTION----- -Bots in MP will go to these spots when there's nothing else to get - helps them patrol. -No use in RPG-X. - ------SPAWNFLAGS----- -none - ------KEYS----- -none -*/ - // For more than four players, adjust the respawn times, up to 1/4. int adjustRespawnTime(float respawnTime) { diff --git a/code/game/g_misc.c b/code/game/g_misc.c index 711ebac..8edd287 100644 --- a/code/game/g_misc.c +++ b/code/game/g_misc.c @@ -6,20 +6,43 @@ /*QUAKED func_group (0 0 0) ? +-----DESCRIPTION----- Used to group brushes together just for editor convenience. They are turned into normal brushes by the utilities. + +-----SPAWNFLAGS----- +none + +-----KEYS----- +q3map2: +"_lightmapscale" - set a diffrent lightmapscale for this func group only */ /*QUAKED info_camp (0 0.5 0) (-4 -4 -4) (4 4 4) -Used as a positional target for calculations in the utilities (spotlights, etc), but removed during gameplay. +-----DESCRIPTION----- +Used as a positional target for calculations in the compiler/utilities (spotlights, etc), but removed during gameplay. + +-----SAPWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. */ +// Lol, this is contradictory, should free but instead sets origin... Description sais removed so maybe merge with info_null. void SP_info_camp( gentity_t *self ) { G_SetOrigin( self, self->s.origin ); } /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4) -Used as a positional target for calculations in the utilities (spotlights, etc), but removed during gameplay. +-----DESCRIPTION----- +Used as a positional target for calculations in the compiler/utilities (spotlights, etc), but removed during gameplay. + +-----SAPWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. */ void SP_info_null( gentity_t *self ) { G_FreeEntity( self ); @@ -27,23 +50,73 @@ void SP_info_null( gentity_t *self ) { /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) +-----DESCRIPTION----- Used as a positional target for in-game calculation, like jumppad targets. target_position does the same thing + +-----SPAWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. +*/ + +//these share the spawnfunction with info_notnull + +/*QUAKED misc_teleporter_dest (1 0 0) (-32 -32 -24) (32 32 -16) +-----DESCRIPTION----- +Merely a fancy name for info_notnull. +was originally used for teleporters but became redundant. + +-----SPAWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. */ void SP_info_notnull( gentity_t *self ){ if(!Q_stricmp(self->classname, "ref_tag") && !rpg_allowspmaps.integer) G_FreeEntity(self); + + if(strcmp(self->classname, "info_notnull")) { + self->classname = G_NewString("info_notnull"); + } G_SetOrigin( self, self->s.origin ); } -/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) linear noIncidence -Non-displayed light. -"light" overrides the default 300 intensity. -'Linear' checkbox gives linear falloff instead of inverse square -'noIncidence' checkbox makes lighting smoother -Lights pointed at a target will be spotlights. -"radius" overrides the default 64 unit radius of a spotlight at the target point. +/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) LINEAR NO_INCIDENCE X X NO_GRID NORMALIZED_COLOR FORCE_DISTANCE_ATTENUATION +-----DESCRIPTION----- +Light source for the compiler. Will be removed ingame. +Lights pointed at a target (info_null) will be spotlights. + +-----SPAWNFLAGS----- +1: LINEAR - checkbox gives linear falloff instead of inverse square +2: NO_INCIDENCE - checkbox makes lighting smoother +4: X - Unknown. Usage not recomended. +8: X - Unknown. Usage not recomended. + +q3map2: +16: NO_GRID - light does not affect the grid +32: NORMALIZED_COLOR - light color gets normalized by the compiler +64: FORCE_DISTANCE_ATTENUATION - distance attenuation is enforced + +-----KEYS----- +"light" - overrides the default 300 intensity. +"radius" - overrides the default 64 unit radius of a spotlight at the target point. +"_color" - light color + +q3map2: +"_style" - light style number +"fade" - Fade factor of light attenuation of linear lights. (Linear lights vanish at light/(fade * 8000). +"_anglescale" - scales angle attenuation +"scale" - intensity multiplier +"_samples" - number of samples to use to get soft shadows from a light +"_deviance" - position deviance of the samples of a regular light +"_filterradius" - filter radius for this light +"_sun" - if 1, this light is an infinite sun light +"_flareshader" - shader for a flare surface generated by this light +"_flare" - when set, this light is a flare without a specified shader */ void SP_light( gentity_t *self ) { G_FreeEntity( self ); @@ -223,22 +296,31 @@ void TeleportPlayer( gentity_t *player, vec3_t origin, vec3_t angles, tpType_t t } } - -/*QUAKED misc_teleporter_dest (1 0 0) (-32 -32 -24) (32 32 -16) -Point teleporters at these. -Now that we don't have teleport destination pads, this is just -an info_notnull -*/ -void SP_misc_teleporter_dest( gentity_t *ent ) { -} - - //=========================================================== /*QUAKED misc_model (1 0 0) (-16 -16 -16) (16 16 16) CAST_SHADOWS CLIP_MODEL FORCE_META -"model" arbitrary .md3 file to display +-----DESCRIPTION----- +Will just spawn and display it's model. +Can be hooked up with a brushmodel-entity to move relative to. -spawnflags only work when compiled with q3map2 +-----SPAWNFLAGS----- +q3map2: +1: CAST_SHADOWS - Model will cast shadows. +2: CLIP_MODEL - Model will be clipped so noone can pass trough. +4: FORCE_META - will enforce a meta-compile for .bsp-build even if the compiler wasn't told to do so. + +-----KEYS----- +"model" - arbitrary .md3 file to display +"target" - brushmodel-entity to attach to + +q3map2: +"_castShadows" OR "_cs" sets whether the entity casts shadows +"_receiveShadows" OR "_rs" sets whether the entity receives shadows +"modelscale" scaling factor for the model to include +"modelscale_vec" non-uniform scaling vector for the model to include +"model2" path name of second model to load +"_frame" frame of model to load +"_frame2" frame of second model to load */ void SP_misc_model( gentity_t *ent ) { @@ -304,12 +386,6 @@ void cycleCamera( gentity_t *self ) //Uh oh! Not targeted at any ents! Or reached end of list? Which is it? //for now assume reached end of list and are cycling owner = G_Find( owner, FOFS(targetname), self->target ); - if ( owner == NULL ) - {//still didn't find one - DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] Couldn't find target for misc_portal_surface\n" );); - G_FreeEntity( self ); - return; - } } setCamera( self, owner->s.number ); @@ -317,82 +393,131 @@ void cycleCamera( gentity_t *self ) if ( self->think == cycleCamera ) { if ( owner->wait > 0 ) - { self->nextthink = level.time + owner->wait; - } - else - { + else if ( self->wait > 0 ) self->nextthink = level.time + self->wait; - } + else + self->nextthink = -1; //no auto cycle } } void misc_portal_use( gentity_t *self, gentity_t *other, gentity_t *activator ) { - cycleCamera( self ); + if(!Q_stricmp(self->swapname, activator->target) && self->wait > 0) { //failsafe in case something slipped up, I'm too tired to be sure ^^ + if(self->nextthink) + self->nextthink = -1; + else + self->nextthink = level.time + self->wait; + }else{ + cycleCamera( self ); + } } void locateCamera( gentity_t *ent ) { gentity_t *owner = NULL; owner = G_Find( NULL, FOFS(targetname), ent->target ); - if ( owner == NULL ) - { - DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] Couldn't find target for misc_partal_surface\n" );); + + if(!owner){ + DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] Couldn't find target for misc_partal_surface, removing surface so you'll note.\n" );); G_FreeEntity( ent ); return; } - - setCamera( ent, owner->s.number ); - if ( G_Find( owner, FOFS(targetname), ent->target) != NULL ) - {//targeted at more than one thing - ent->think = cycleCamera; - if ( owner->wait > 0 ) - { - ent->nextthink = level.time + owner->wait; - } - else - { - ent->nextthink = level.time + ent->wait; + //let's see if we need cyceling of some sort. Basic requirement: Do we have another camera connected? + if( G_Find( owner, FOFS(targetname), ent->target)){ + //we do, so do we need to set up for manual cycle or pause? + if( ent->targetname || (ent->swapname && ent->wait > 0)) + ent->use = misc_portal_use; //there's one of either. Which one will be determined in usefunction. + + //to set up the autocycle we need wait set on either surface or camera. + if(ent->wait > 0 || owner->wait > 0){ + if(ent->wait == -1 && owner->wait > 0){ //we need to make sure every camera has an individual wait + while((owner = G_Find( owner, FOFS(targetname), ent->target)) != NULL){ + if(owner->wait == -1){ + DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] One of the tragetet misc_portal_cameras does not have an individual wait. Adapting wait of the first camera found as a default.\n" );); + owner = G_Find( NULL, FOFS(targetname), ent->target); + ent->wait = owner->wait; //a camera failed so make sure to have the wait of the first camera ported over to the surface as failsafe + break; + } + } + } + //make sure we got the right camera at this point + owner = G_Find( NULL, FOFS(targetname), ent->target); + + ent->think = cycleCamera; + if ( owner->wait > 0 ) + ent->nextthink = level.time + owner->wait; + else if ( ent->wait > 0 ) + ent->nextthink = level.time + ent->wait; + else + ent->nextthink = -1; //no auto cycle } } + setCamera( ent, owner->s.number ); } /*QUAKED misc_portal_surface (0 0 1) (-8 -8 -8) (8 8 8) +-----DESCRIPTION----- The portal surface nearest this entity will show a view from the targeted misc_portal_camera, or a mirror view if untargeted. This must be within 64 world units of the surface! -targetname - When used, cycles to the next misc_portal_camera it's targeted -wait - makes it auto-cycle between all cameras it's pointed at at intevervals of specified number of seconds. +-----SPAWNFLAGS----- +none - cameras will be cycled through in the order they were created on the map. +-----KEYS----- +"target" - misc_portal_camera's to target +"targetname" - When used, cycles to the next misc_portal_camera it's targeted +"wait" - makes it auto-cycle between all cameras it's pointed at at intevervals of specified number of seconds. Default = -1 = don't autocycle + cameras will be cycled through in the order they were created on the map. + if this and the first camera are -1 there will be no autocycle. + if this is -1 but the first camera is positive the wait will be adapted as a faulsafe measure should one of the later cameras lack an individual wait. +"swapname" - will pause/unpause the autocycle. The next cycle will happen aufer "wait" seconds, so wait is required for this. + requires SELF/NO_ACRIVATOR + +-----USAGE----- +Autocycle or manual Cycle usually only makes sence for a survaliance-station or security. +For a viewscreen or a communications channel make the brush having the portal-texture a func_usable and treat is as described on that entity for VFX-Entities. */ void SP_misc_portal_surface(gentity_t *ent) { + VectorClear( ent->r.mins ); VectorClear( ent->r.maxs ); trap_LinkEntity (ent); ent->r.svFlags = SVF_PORTAL; ent->s.eType = ET_PORTAL; - ent->wait *= 1000; + if(ent->wait > 0) + ent->wait *= 1000; + else + ent->wait = -1; if ( !ent->target ) { - VectorCopy( ent->s.origin, ent->s.origin2 ); + VectorCopy( ent->s.origin, ent->s.origin2 ); //mirror } else { ent->think = locateCamera; - ent->nextthink = level.time + 100; - if ( ent->targetname ) - { - ent->use = misc_portal_use; + ent->nextthink = level.time + 500; //give cameras time to spawn + if(ent->targetname && ent->swapname && ent->wait == -1){ + DEVELOPER(G_Printf(S_COLOR_YELLOW "[Entity-Error] Both swapname and wait need to be present on a misc_model_surface to potentionally turn it's autocycle off. NULLing swapname.\n" );); + ent->swapname = G_NewString("NULL"); //Failsafe: We'll have the usefunction, however we can not use it for pausing as we did not have wait on ent. Set swapname to NULL so we can use wait as a potential failsafe should one of the cameras lack an individual wait. } } } -/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) slowrotate fastrotate -The target for a misc_portal_surface. You can set either angles or target another entity (NOT an info_null) to determine the direction of view. -"roll" an angle modifier to orient the camera around the target vector; +/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) SLOWROTATE FASTROTATE +-----DESCRIPTION----- +The target for a misc_portal_surface. +You can set either angles or target another entity (NOT an info_null or similar) to determine the direction of view. + +-----SPAWNFLAGS----- +1: SLOWROTATE - slowly rotates around it's axis of view +2: FASTROTATE - quickly rotates around it's axis of view + +-----KEYS----- +"targetname" - have misc_portal_surface target this +"roll" - an angle modifier to orient the camera around the target vector. Default is 0. +"wait" - delay for autocycle misc_portal_surface. Will overwrite theirs. Default is -1 = use surface-value. */ void SP_misc_portal_camera(gentity_t *ent) { float roll; @@ -404,7 +529,10 @@ void SP_misc_portal_camera(gentity_t *ent) { G_SpawnFloat( "roll", "0", &roll ); ent->s.clientNum = roll/360.0 * 256; - ent->wait *= 1000; + if(ent->wait > 0) + ent->wait *= 1000; + else + ent->wait = -1; } /* diff --git a/code/game/g_roff.c b/code/game/g_roff.c deleted file mode 100644 index 40a9ef1..0000000 --- a/code/game/g_roff.c +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (C) 2000 Raven Software -// -// g_roff.c -- The main code behind setting up -// and managing 'ROFF' code in EF - -#include "g_local.h" -#include "g_roff.h" -// The list of precached ROFFs -roff_list_t roffs[MAX_ROFFS]; -int num_roffs = 0; -#define ROFF_DIR "maps/roffs" - -//extern void Q3_TaskIDComplete( gentity_t *ent, taskID_t taskType ); - - -//------------------------------------------------------- -// G_LoadRoff -// -// Does the fun work of loading and caching a roff file -// If the file is already cached, it just returns an -// ID to the cached file. -// -// TiM: Modded it so it conforms to ANSI C parameters -//------------------------------------------------------- - -int G_LoadRoff( const char *fileName ) -{ - char file[MAX_QPATH]; - byte data[2*1024*1024]; - int len, i, roff_id = 0; - fileHandle_t f; - roff_hdr_t *header; - move_rotate_t *mem; - move_rotate_t *roff_data; - - // Before even bothering with all of this, make sure we have a place to store it. - if ( num_roffs >= MAX_ROFFS ) - { - G_Printf( S_COLOR_RED "MAX_ROFFS count exceeded. Skipping load of .ROF '%s'\n", fileName ); - return roff_id; - } - - // The actual path - sprintf( file, "%s/%s.rof", ROFF_DIR, fileName ); - - // See if I'm already precached - for ( i = 0; i < num_roffs; i++ ) - { - if ( Q_stricmp( file, roffs[i].fileName ) == 0 ) - { - // Good, just return me...avoid zero index - return i + 1; - } - } - -#ifdef _DEBUG - Com_Printf( S_COLOR_GREEN"Caching ROF: '%s'\n", file ); -#endif - - // Read the file in one fell swoop - len = trap_FS_FOpenFile( fileName, &f, FS_READ ); - - if ( len <= 0 ) - { - G_Printf( S_COLOR_RED "Could not open .ROF file '%s'\n", fileName ); - return roff_id; - } - - trap_FS_Read( &data, len, f ); - data[len+1] = '\0'; - - // Now let's check the header info... - header = (roff_hdr_t *)((byte *)data); - - // ..and make sure it's reasonably valid - if ( strncmp( header->sHeader, "ROFF", 4 ) !=0 || header->lVersion != ROFF_VERSION || header->fCount <= 0 ) - { - G_Printf( S_COLOR_RED "Bad header data in .ROF file '%s'\n", fileName ); - } - else - { - // Cool, the file seems to be valid - int count = (int)header->fCount; - - // Ask the game to give us some memory to store this pooch - mem = roffs[num_roffs].data = (move_rotate_t *) G_Alloc( count * sizeof( move_rotate_t ) ); - - if ( mem ) - { - // The allocation worked, so stash this stuff off so we can reference the data later if needed - roffs[num_roffs].fileName = G_NewString( file ); - roffs[num_roffs].frames = count; - - // Step past the header to get to the goods - roff_data = ( move_rotate_t *)&header[1]; - - // Copy all of the goods into our ROFF cache - for ( i = 0; i < count; i++, roff_data++, mem++ ) - { - // Copy just the delta position and orientation which can be applied to anything at a later point - VectorCopy( roff_data->origin_delta, mem->origin_delta ); - VectorCopy( roff_data->rotate_delta, mem->rotate_delta ); - } - - // Done loading this roff, so save off an id to it..increment first to avoid zero index - roff_id = ++num_roffs; - } - } - - trap_FS_FCloseFile( f ); - - return roff_id; -} - - -//------------------------------------------------------- -// G_Roff -// -// Handles applying the roff data to the specified ent -//------------------------------------------------------- - -void G_Roff( gentity_t *ent ) -{ - int roff_id = G_LoadRoff( ent->roff ); - - if ( !roff_id ) - { - // Couldn't cache this rof - return; - } - - // The ID is one higher than the array index - move_rotate_t *roff = &roffs[roff_id - 1].data[ent->roff_ctr]; - int frames = roffs[roff_id - 1].frames; - -#ifdef _DEBUG - Com_Printf( S_COLOR_GREEN"ROFF dat: o:<%.2f %.2f %.2f> a:<%.2f %.2f %.2f>\n", - roff->origin_delta[0], roff->origin_delta[1], roff->origin_delta[2], - roff->rotate_delta[0], roff->rotate_delta[1], roff->rotate_delta[2] ); -#endif - - // Set up the angle interpolation - //------------------------------------- - VectorScale( roff->rotate_delta, ROFF_SAMPLE_RATE, ent->s.apos.trDelta ); - VectorCopy( ent->pos2, ent->s.apos.trBase ); - ent->s.apos.trTime = level.time; - ent->s.apos.trType = TR_LINEAR; - - // Store what the next apos->trBase should be - VectorAdd( ent->pos2, roff->rotate_delta, ent->pos2 ); - - - // Set up the origin interpolation - //------------------------------------- - VectorScale( roff->origin_delta, ROFF_SAMPLE_RATE, ent->s.pos.trDelta ); - VectorCopy( ent->pos1, ent->s.pos.trBase ); - ent->s.pos.trTime = level.time; - ent->s.pos.trType = TR_LINEAR; - - // Store what the next apos->trBase should be - VectorAdd( ent->pos1, roff->origin_delta, ent->pos1 ); - - // See if the ROFF playback is done - //------------------------------------- - if ( ++ent->roff_ctr >= frames ) - { - // We are done, so let me think no more, then tell the task that we're done. - ent->next_roff_time = 0; - - // Stop any rotation or movement. - VectorClear( ent->s.pos.trDelta ); - VectorClear( ent->s.apos.trDelta ); - - return; - } - - // Lock me to a 10hz update rate - ent->next_roff_time = level.time + 100; -} - -/*QUAKED func_roff_mover (0 .5 .8) ? START_ON LOOP ------DESCRIPTION----- -Loads all of the movement data from an external ROFF file and applies -it to this entity, creating much more fluid motion. - -DISCONTINUED: Use Lua mover instead. - ------SPAWNFLAGS----- -1: START_ON - will start to move at spawn -2: LOOP - will loop it's mition - ------KEYS----- -"model2" .md3 model to also draw -"angle" determines the opening direction -"target" once the animation ends, these targetted entities will be triggered -"wait" from activation, how many seconds to wait before moving -"endwait" from the end of the animation, how many seconds to wait b4 firing its targets -"color" constantLight color -"light" constantLight radius -"noise" looping sound file that plays as it animates. -*/ -void SP_func_roff_mover ( gentity_t *ent ) -{ - ent->think = G_Roff; - -} \ No newline at end of file diff --git a/code/game/g_spawn.c b/code/game/g_spawn.c index db394fc..d537f86 100644 --- a/code/game/g_spawn.c +++ b/code/game/g_spawn.c @@ -118,7 +118,6 @@ typedef struct { void (*spawn)(gentity_t *ent); } spawn_t; -void SP_info_player_start (gentity_t *ent); void SP_info_player_deathmatch (gentity_t *ent); void SP_info_player_intermission (gentity_t *ent); void SP_info_firstplace(gentity_t *ent); @@ -190,7 +189,6 @@ void SP_info_notnull (gentity_t *self); void SP_info_camp (gentity_t *self); void SP_path_corner (gentity_t *self); -void SP_misc_teleporter_dest (gentity_t *self); void SP_misc_model(gentity_t *ent); void SP_misc_model_breakable(gentity_t *ent); void SP_misc_portal_camera(gentity_t *ent); @@ -254,52 +252,52 @@ void SP_cinematic_camera(gentity_t *ent); spawn_t spawns[] = { // info entities don't do anything at all, but provide positional // information for things controlled by other processes - {"info_player_start", SP_info_player_start}, + {"info_player_start", SP_info_player_deathmatch}, - {"NPC_BioHulk", SP_info_player_start}, - {"NPC_starfleet", SP_info_player_start}, - {"NPC_starfleet_random", SP_info_player_start}, - {"NPC_Tuvok", SP_info_player_start}, - {"NPC_Kim", SP_info_player_start}, - {"NPC_Doctor", SP_info_player_start}, - {"NPC_Paris", SP_info_player_start}, - {"NPC_Torres", SP_info_player_start}, - {"NPC_Janeway", SP_info_player_start}, - {"NPC_Seven", SP_info_player_start}, - {"NPC_Chakotay", SP_info_player_start}, - {"NPC_Neelix", SP_info_player_start}, - {"NPC_Vorik", SP_info_player_start}, - {"NPC_Foster", SP_info_player_start}, - {"NPC_Munro", SP_info_player_start}, - {"NPC_MunroScav", SP_info_player_start}, - {"NPC_Telsia", SP_info_player_start}, - {"NPC_Biessman", SP_info_player_start}, - {"NPC_Chang", SP_info_player_start}, - {"NPC_Chell", SP_info_player_start}, - {"NPC_Jurot", SP_info_player_start}, - {"NPC_borg", SP_info_player_start}, - {"NPC_klingon", SP_info_player_start}, - {"NPC_Malon", SP_info_player_start}, - {"NPC_Hirogen", SP_info_player_start}, - {"NPC_Hirogen_Alpha", SP_info_player_start}, - {"NPC_Imperial", SP_info_player_start}, - {"NPC_Imperial_Blue", SP_info_player_start}, - {"NPC_Imperial_Gold", SP_info_player_start}, - {"NPC_Imperial_Raider", SP_info_player_start}, - {"NPC_Stasis", SP_info_player_start}, - {"NPC_Species8472", SP_info_player_start}, - {"NPC_Reaver", SP_info_player_start}, - {"NPC_ReaverGuard", SP_info_player_start}, - {"NPC_Avatar", SP_info_player_start}, - {"NPC_Vohrsoth", SP_info_player_start}, - {"NPC_Desperado", SP_info_player_start}, - {"NPC_Paladin", SP_info_player_start}, - {"NPC_ChaoticaGuard", SP_info_player_start}, - {"NPC_Chaotica", SP_info_player_start}, - {"NPC_CaptainProton", SP_info_player_start}, - {"NPC_SatansRobot", SP_info_player_start}, - {"NPC_Buster", SP_info_player_start}, - {"NPC_Goodheart", SP_info_player_start}, + {"NPC_BioHulk", SP_info_player_deathmatch}, + {"NPC_starfleet", SP_info_player_deathmatch}, + {"NPC_starfleet_random", SP_info_player_deathmatch}, + {"NPC_Tuvok", SP_info_player_deathmatch}, + {"NPC_Kim", SP_info_player_deathmatch}, + {"NPC_Doctor", SP_info_player_deathmatch}, + {"NPC_Paris", SP_info_player_deathmatch}, + {"NPC_Torres", SP_info_player_deathmatch}, + {"NPC_Janeway", SP_info_player_deathmatch}, + {"NPC_Seven", SP_info_player_deathmatch}, + {"NPC_Chakotay", SP_info_player_deathmatch}, + {"NPC_Neelix", SP_info_player_deathmatch}, + {"NPC_Vorik", SP_info_player_deathmatch}, + {"NPC_Foster", SP_info_player_deathmatch}, + {"NPC_Munro", SP_info_player_deathmatch}, + {"NPC_MunroScav", SP_info_player_deathmatch}, + {"NPC_Telsia", SP_info_player_deathmatch}, + {"NPC_Biessman", SP_info_player_deathmatch}, + {"NPC_Chang", SP_info_player_deathmatch}, + {"NPC_Chell", SP_info_player_deathmatch}, + {"NPC_Jurot", SP_info_player_deathmatch}, + {"NPC_borg", SP_info_player_deathmatch}, + {"NPC_klingon", SP_info_player_deathmatch}, + {"NPC_Malon", SP_info_player_deathmatch}, + {"NPC_Hirogen", SP_info_player_deathmatch}, + {"NPC_Hirogen_Alpha", SP_info_player_deathmatch}, + {"NPC_Imperial", SP_info_player_deathmatch}, + {"NPC_Imperial_Blue", SP_info_player_deathmatch}, + {"NPC_Imperial_Gold", SP_info_player_deathmatch}, + {"NPC_Imperial_Raider", SP_info_player_deathmatch}, + {"NPC_Stasis", SP_info_player_deathmatch}, + {"NPC_Species8472", SP_info_player_deathmatch}, + {"NPC_Reaver", SP_info_player_deathmatch}, + {"NPC_ReaverGuard", SP_info_player_deathmatch}, + {"NPC_Avatar", SP_info_player_deathmatch}, + {"NPC_Vohrsoth", SP_info_player_deathmatch}, + {"NPC_Desperado", SP_info_player_deathmatch}, + {"NPC_Paladin", SP_info_player_deathmatch}, + {"NPC_ChaoticaGuard", SP_info_player_deathmatch}, + {"NPC_Chaotica", SP_info_player_deathmatch}, + {"NPC_CaptainProton", SP_info_player_deathmatch}, + {"NPC_SatansRobot", SP_info_player_deathmatch}, + {"NPC_Buster", SP_info_player_deathmatch}, + {"NPC_Goodheart", SP_info_player_deathmatch}, {"info_player_deathmatch", SP_info_player_deathmatch}, {"info_player_intermission", SP_info_player_intermission}, @@ -375,7 +373,7 @@ spawn_t spawns[] = { {"light", SP_light}, {"path_corner", SP_path_corner}, - {"misc_teleporter_dest", SP_misc_teleporter_dest}, + {"misc_teleporter_dest", SP_info_notnull}, {"misc_model", SP_misc_model}, {"misc_model_breakable", SP_misc_model_breakable}, {"misc_portal_surface", SP_misc_portal_surface}, diff --git a/code/game/g_trigger.c b/code/game/g_trigger.c index 3b3474d..9652902 100644 --- a/code/game/g_trigger.c +++ b/code/game/g_trigger.c @@ -137,8 +137,6 @@ void Touch_Multi( gentity_t *self, gentity_t *other, trace_t *trace ) { /*QUAKED trigger_multiple (.5 .5 .5) ? RED_OK BLUE_OK TEAM_ONLY -----DESCRIPTION----- Variable sized repeatable trigger. Must be targeted at one or more entities. -so, the basic time between firing is a random time between -(wait - random) and (wait + random) -----SPAWNFLAGS----- 1: RED_OK - People on the red team can fire this trigger @@ -148,6 +146,8 @@ so, the basic time between firing is a random time between -----KEYS----- "wait" - Seconds between triggerings, 0.5 default, -1 = one time only. "random" - wait variance, default is 0 +so, the basic time between firing is a random time between +(wait - random) and (wait + random) */ /** * \brief Spawn function of trigger_multiple. @@ -1071,7 +1071,7 @@ This can be used in three ways: -----KEYS----- The damage the radiation does is calculated from these two values: -"dmg" damage(default 1) +"damage" damage(default 1) "wait" wait(seconds, default 10) Forumla is: dps = dmg / wait diff --git a/code/game/g_usable.c b/code/game/g_usable.c index 640f3c7..ec404e6 100644 --- a/code/game/g_usable.c +++ b/code/game/g_usable.c @@ -217,6 +217,22 @@ q3map2: "_castShadows" OR "_cs" sets whether the entity casts shadows "_receiveShadows" OR "_rs" sets whether the entity receives shadows +-----USAGE----- +As stated in the description there are 2 ways to use this kind of entity: As a trigger/activator or as Visual effect. +It is possible to do both, however giving an entity only one of the functions usually gives the mapper less of a headace. +Instead use the usable as VFx only and forward any command trough a target_relay. + +For trigger-usables you need the following keys: +"target" - what stuff to fire +"wait" - how long to wait before fire again +"spawnflags" - ALWAYS_ON (8) is required. You may also be interested in ADMIN_ONLY (256) NO_ACTIATOR (512) and DEACTIVATED (2048) +"message" or "messageNum" - display a string if scanned by a tricorder + +For VFX-usables these keys might be interesting: +"targetname" - turns visible/invisible when fired +"team" - set 2 as this will disallow clients from accidently using this +"spawnflags" - Interesting here are START_OFF (1), NOBLOCKCHECK (16) and NO_AREAPORTAL (1024) + -----LUA----- Sounds for consoles: One of the advantages with luaUse-functions is that you can play sounds on the usable you're using this comes in very handy if you'd like to for example play a sound on the turbolift-usable: @@ -235,10 +251,10 @@ Also if you have a (morer or less) generic console that you want to fire generic function consolesounds(ent, other, activator) i = qmath.irandom(1, ); if i == 1 then - sound.PlaySound(ent, , 0); + sound.PlaySound(ent, , 0); end if i == n then - sound.PlaySound(ent, , 0); + sound.PlaySound(ent, , 0); end end */ diff --git a/rpg-x_entities.def b/rpg-x_entities.def index 6c296b5..deccb17 100644 --- a/rpg-x_entities.def +++ b/rpg-x_entities.def @@ -1,218 +1,19 @@ //files that hold this stuff in game. Please update them as required: -//g_breakable.c - func_breakable, misc_model_breakable, misc_ammo_station, target_repair; -//g_cinamatic.c - cinematic_camera; -//g_client.c - info_player_deathmatch, info_player_start, info_player_intermission; -//g_forcefield2.c - func_forcefield2; +//g_breakable.c - func_breakable, misc_model_breakable, misc_ammo_station*, target_repair; +//g_cinamatic.c - cinematic_camera**; +//g_client.c - info_player_deathmatch[info_player_start, team_CTF_redplayer, team_CTF_blueplayer, team_CTF_redspawn, team_CTF_bluespawn], info_player_intermission; //g_fx.c -//g_items.c - item_botroam; //g_misc.c //g_mover.c -//g_roff.c - func_roff_mover; //g_spawn.c - worldspawn; //g_target.c -//g_team.c - team_CTF_redplayer, team_CTF_blueplayer, team_CTF_redspawn, team_CTF_bluespawn; //g_trigger.c - trigger_multiple, trigger_always, trigger_push, target_push, trigger_teleport, trigger_hurt, func_timer, trigger_transporter, trigger_radiation; //g_turrets.c - misc_turret, misc_laser_arm; -//g_ui.c - ui_transporter, ui_holodeck; +//g_ui.c - ui_transporter, ui_msd, ui_holodeck; //g_usable.c - func_usable; -/*QUAKED item_***** ( 0 0 0 ) (-16 -16 -16) (16 16 16) suspended -DO NOT USE THIS CLASS, IT JUST HOLDS GENERAL INFORMATION. -The suspended flag will allow items to hang in the air, otherwise they are dropped to the next surface. - -If an item is the target of another entity, it will not spawn in until fired. - -An item fires all of its targets when it is picked up. If the toucher can't carry it, the targets won't be fired. - -"notfree" if set to 1, don't spawn in free for all games -"notteam" if set to 1, don't spawn in team games -"notsingle" if set to 1, don't spawn in single player games -"wait" override the default wait before respawning. -1 = never respawn automatically, which can be used with targeted spawning. -"random" random number of plus or minus seconds varied from the respawn time -"count" override quantity or duration on most items. -*/ - - -/*QUAKED weapon_phaser (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_compressionrifle (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_null_hand (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - -/*QUAKED weapon_tricorder (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - -/*QUAKED weapon_padd (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - -/*QUAKED weapon_coffee (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_disruptor (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - -/*QUAKED weapon_medkit (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_voyager_hypo (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_grenadelauncher (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_tr116 (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_quantumburst (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_dermal_regen (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - -/*QUAKED weapon_toolkit (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - -/*QUAKED weapon_hyperspanner (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED ammo_compressionrifle (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -32 ammo for the compression rifle -*/ - - -/*QUAKED ammo_imod (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -15 ammo for the I-MOD -*/ - - -/*QUAKED ammo_scavenger (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -30 ammo for the scavenger rifle -*/ - - -/*QUAKED ammo_stasis (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -15 ammo for the stasis weapon -*/ - - -/*QUAKED ammo_grenades (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -10 ammo for the grenade launcher -*/ - - -/*QUAKED ammo_tetriondisruptor (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -40 ammo for the tetrYon disruptor -*/ - - -/*QUAKED ammo_quantumburst (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -6 ammo for the quantum burst weapon -*/ - - -/*QUAKED ammo_dreadnought (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -40 ammo for the dreadnought/arc welder -*/ - - -/*QUAKED item_armor_shard (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -5 points of shields -*/ - - -/*QUAKED item_armor_combat (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -50 points of shields -*/ - - -/*QUAKED item_armor_body (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -100 points of shields -*/ - - -/*QUAKED item_hypo_small (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -5 points of health, max of 200 -*/ - - -/*QUAKED item_hypo (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -25 points of health, max of 100 -*/ - - -/*QUAKED holdable_transporter (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -pick it up and it stays in your inventory until used, at which time you drop it in front of you and it still -kind of resides in your inventory. when you use it _again_ it activates and anyone can walk through the transporter. -*/ - - -/*QUAKED holdable_medkit (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -pick it up and it stays in your inventory until used, at which time it sets your health to 100 -*/ - -/*QUAKED item_haste (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -for 30 seconds you run at %150 of your normal speed and your firing delays are 3/4 as long -*/ - - -/*QUAKED item_invis (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -20 seconds of invisibility -*/ - - -/*QUAKED item_flight (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -30 seconds of flight -*/ - - -/*QUAKED team_CTF_redflag (1 0 0) (-24 -24 -16) (24 24 32) -Only in CTF games -*/ - - -/*QUAKED team_CTF_blueflag (0 0 1) (-24 -24 -16) (24 24 32) -Only in CTF games -*/ - - -/*QUAKED holdable_detpack (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -BLAMMO! -*/ - - -/*QUAKED holdable_shield (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -About 25 seconds or 250 hit points of a portashield. -*/ - - -/*QUAKED Holographic_decoy (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -About 1 minute of a holographic decoy. -*/ - - -/*QUAKED weapon_voyager_hypo (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_borg_assimilator (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - - -/*QUAKED weapon_borg_weapon (.3 .3 1) (-16 -16 -16) (16 16 16) suspended -*/ - +// *might be removed +// **Description needs to be worked on /*QUAKED misc_model_breakable (1 0 0) (-16 -16 -16) (16 16 16) SOLID AUTOANIMATE DEADSOLID NO_DMODEL INVINCIBLE X X X REPAIRABLE X -----DESCRIPTION----- @@ -300,7 +101,7 @@ none potential spawning position for deathmatch games. -----SPAWNFLAGS----- -1: INITIAL - Preferred spawn for the first spawn of a clientwhen entering a match. +1: INITIAL - Preferred spawn for the first spawn of a client when entering a match. -----KEYS----- "target" - entities with matching targetname will be fired if someone spawns here. @@ -312,10 +113,10 @@ potential spawning position for deathmatch games. /*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 32) INITIAL -----DESCRIPTION----- Merely a fancy name for info_player_deathmatch. -On spawn will reset classname sppropriately and respawn itself. +On spawn will reset classname appropriately and respawn itself. -----SPAWNFLAGS----- -1: INITIAL - Preferred spawn for the first spawn of a clientwhen entering a match. +1: INITIAL - Preferred spawn for the first spawn of a client when entering a match. -----KEYS----- "target" - entities with matching targetname will be fired if someone spawns here. @@ -352,84 +153,139 @@ none /*QUAKED info_camp (0 0.5 0) (-4 -4 -4) (4 4 4) -Used as a positional target for calculations in the utilities (spotlights, etc), but removed during gameplay. +-----DESCRIPTION----- +Used as a positional target for calculations in the compiler/utilities (spotlights, etc), but removed during gameplay. + +-----SAPWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. */ /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4) -Used as a positional target for calculations in the utilities (spotlights, etc), but removed during gameplay. +-----DESCRIPTION----- +Used as a positional target for calculations in the compiler/utilities (spotlights, etc), but removed during gameplay. + +-----SAPWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. */ /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4) +-----DESCRIPTION----- Used as a positional target for in-game calculation, like jumppad targets. target_position does the same thing + +-----SPAWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. */ -/*QUAKED lightJunior (0 1 0) (-8 -8 -8) (8 8 8) linear noIncidence x x x normalized_color force_distance_attenuation -Non-displayed light. This type of light only affects the light grid (Entity lighting only no world lighting). -'Linear' checkbox gives linear falloff instead of inverse square -'noIncidence' checkbox makes lighting smoother -Lights pointed at a target will be spotlights. -"light" overrides the default 300 intensity. -"radius" overrides the default 64 unit radius of a spotlight at the target point. -"_color" light color +/*QUAKED lightJunior (0 1 0) (-8 -8 -8) (8 8 8) LINEAR NO_INCIDENCE X X X NORMALIZED_COLOR FORCE_DISTANCE_ATTENUATION +-----DESCRIPTION----- +Light source for the compiler. Will be removed ingame. +This type of light only affects the light grid (Entity lighting only no world lighting). + +-----SPAWNFLAGS----- +1: LINEAR - checkbox gives linear falloff instead of inverse square +2: NO_INCIDENCE - checkbox makes lighting smoother +4: X - Unknown. Usage not recomended. +8: X - Unknown. Usage not recomended. +16: X - Unknown. Usage not recomended. q3map2: -'normalized_color' light color gets normalized by the compiler -'force_distance_attenuation' distance attenuation is enforced -"_style" light style number -"fade" Fade factor of light attenuation of linear lights. (Linear lights vanish at light/(fade * 8000). -"_anglescale" scales angle attenuation -"scale" intensity multiplier -"_samples" number of samples to use to get soft shadows from a light -"_deviance" position deviance of the samples of a regular light -"_filterradius" filter radius for this light -"_sun" if 1, this light is an infinite sun light +32: NORMALIZED_COLOR - light color gets normalized by the compiler +64: FORCE_DISTANCE_ATTENUATION - distance attenuation is enforced + +-----KEYS----- +"light" - overrides the default 300 intensity. +"radius" - overrides the default 64 unit radius of a spotlight at the target point. +"_color" - light color + +q3map2: +"_style" - light style number +"fade" - Fade factor of light attenuation of linear lights. (Linear lights vanish at light/(fade * 8000). +"_anglescale" - scales angle attenuation +"scale" - intensity multiplier +"_samples" - number of samples to use to get soft shadows from a light +"_deviance" - position deviance of the samples of a regular light +"_filterradius" - filter radius for this light +"_sun" - if 1, this light is an infinite sun light */ -/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) linear noIncidence x x noGrid normalized_color force_distance_attenuation -Non-displayed light. -'Linear' checkbox gives linear falloff instead of inverse square -'noIncidence' checkbox makes lighting smoother -Lights pointed at a target will be spotlights. -"light" overrides the default 300 intensity. -"radius" overrides the default 64 unit radius of a spotlight at the target point. -"_color" light color +/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) LINEAR NO_INCIDENCE X X NO_GRID NORMALIZED_COLOR FORCE_DISTANCE_ATTENUATION +-----DESCRIPTION----- +Light source for the compiler. Will be removed ingame. +Lights pointed at a target (info_null) will be spotlights. + +-----SPAWNFLAGS----- +1: LINEAR - checkbox gives linear falloff instead of inverse square +2: NO_INCIDENCE - checkbox makes lighting smoother +4: X - Unknown. Usage not recomended. +8: X - Unknown. Usage not recomended. q3map2: -'normalized_color' light color gets normalized by the compiler -'force_distance_attenuation' distance attenuation is enforced -'noGrid' light does not affect the grid -"_style" light style number -"fade" Fade factor of light attenuation of linear lights. (Linear lights vanish at light/(fade * 8000). -"_anglescale" scales angle attenuation -"scale" intensity multiplier -"_samples" number of samples to use to get soft shadows from a light -"_deviance" position deviance of the samples of a regular light -"_filterradius" filter radius for this light -"_sun" if 1, this light is an infinite sun light -"_flareshader" shader for a flare surface generated by this light -"_flare" when set, this light is a flare without a specified shader +16: NO_GRID - light does not affect the grid +32: NORMALIZED_COLOR - light color gets normalized by the compiler +64: FORCE_DISTANCE_ATTENUATION - distance attenuation is enforced + +-----KEYS----- +"light" - overrides the default 300 intensity. +"radius" - overrides the default 64 unit radius of a spotlight at the target point. +"_color" - light color + +q3map2: +"_style" - light style number +"fade" - Fade factor of light attenuation of linear lights. (Linear lights vanish at light/(fade * 8000). +"_anglescale" - scales angle attenuation +"scale" - intensity multiplier +"_samples" - number of samples to use to get soft shadows from a light +"_deviance" - position deviance of the samples of a regular light +"_filterradius" - filter radius for this light +"_sun" - if 1, this light is an infinite sun light +"_flareshader" - shader for a flare surface generated by this light +"_flare" - when set, this light is a flare without a specified shader */ /*QUAKED misc_teleporter_dest (1 0 0) (-32 -32 -24) (32 32 -16) -Point teleporters at these. -Now that we don't have teleport destination pads, this is just -an info_notnull +-----DESCRIPTION----- +Merely a fancy name for info_notnull. +was originally used for teleporters but became redundant. + +-----SPAWNFLAGS----- +none + +-----KEYS----- +"targetname" - have whatever is required point at this. */ /*QUAKED misc_model (1 0 0) (-16 -16 -16) (16 16 16) CAST_SHADOWS CLIP_MODEL FORCE_META -"model" arbitrary .md3 file to display +-----DESCRIPTION----- +Will just spawn and display it's model. +Can be hooked up with a brushmodel-entity to move relative to. + +-----SPAWNFLAGS----- +q3map2: +1: CAST_SHADOWS - Model will cast shadows. +2: CLIP_MODEL - Model will be clipped so noone can pass trough. +4: FORCE_META - will enforce a meta-compile for .bsp-build even if the compiler wasn't told to do so. + +-----KEYS----- +"model" - arbitrary .md3 file to display +"target" - brushmodel-entity to attach to q3map2: -'CAST_SHADOWS' model is used in light compile stage for shadow calculation -'CLIP_MODEL' enable collision for this model -'FORCE_META' model is included in meta stage of bsp "_castShadows" OR "_cs" sets whether the entity casts shadows "_receiveShadows" OR "_rs" sets whether the entity receives shadows "modelscale" scaling factor for the model to include @@ -441,22 +297,43 @@ q3map2: /*QUAKED misc_portal_surface (0 0 1) (-8 -8 -8) (8 8 8) +-----DESCRIPTION----- The portal surface nearest this entity will show a view from the targeted misc_portal_camera, or a mirror view if untargeted. This must be within 64 world units of the surface! -targetname - When used, cycles to the next misc_portal_camera it's targeted -wait - makes it auto-cycle between all cameras it's pointed at at intevervals of specified number of seconds. +-----SPAWNFLAGS----- +none - cameras will be cycled through in the order they were created on the map. +-----KEYS----- +"target" - misc_portal_camera's to target +"targetname" - When used, cycles to the next misc_portal_camera it's targeted +"wait" - makes it auto-cycle between all cameras it's pointed at at intevervals of specified number of seconds. Default = -1 = don't autocycle + cameras will be cycled through in the order they were created on the map. + if this and the first camera are -1 there will be no autocycle. + if this is -1 but the first camera is positive the wait will be adapted as a faulsafe measure should one of the later cameras lack an individual wait. +"swapname" - will pause/unpause the autocycle. The next cycle will happen aufer "wait" seconds, so wait is required for this. + requires SELF/NO_ACRIVATOR + +-----USAGE----- +Autocycle or manual Cycle usually only makes sence for a survaliance-station or security. +For a viewscreen or a communications channel make the brush having the portal-texture a func_usable and treat is as described on that entity for VFX-Entities. */ +/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) SLOWROTATE FASTROTATE +-----DESCRIPTION----- +The target for a misc_portal_surface. +You can set either angles or target another entity (NOT an info_null or similar) to determine the direction of view. -/*QUAKED misc_portal_camera (0 0 1) (-8 -8 -8) (8 8 8) slowrotate fastrotate -The target for a misc_portal_surface. You can set either angles or target another entity (NOT an info_null) to determine the direction of view. -"roll" an angle modifier to orient the camera around the target vector; +-----SPAWNFLAGS----- +1: SLOWROTATE - slowly rotates around it's axis of view +2: FASTROTATE - quickly rotates around it's axis of view + +-----KEYS----- +"targetname" - have misc_portal_surface target this +"roll" - an angle modifier to orient the camera around the target vector. Default is 0. +"wait" - delay for autocycle misc_portal_surface. Will overwrite theirs. Default is -1 = use surface-value. */ - /*QUAKED shooter_rocket (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" the number of degrees of deviance from the taget. (1.0 default) @@ -565,7 +442,7 @@ none /*QUAKED target_delay (1 0 0) (-8 -8 -8) (8 8 8) SELF -----DESCRIPTION----- -When used fires it'd target after a delay of 'wait' seconds +When used fires it's target after a delay of 'wait' seconds -----SPAWNFLAGS----- 1: SELF - use the entity as activator instead of it's own activator when using it's targets (use this flag for targets that are target_boolean, targer_alert, and target_warp) @@ -696,56 +573,59 @@ NOTE: the objective with the lowest "count" will be considered the current objec */ -/*QUAKED team_CTF_redplayer (1 0 0) (-16 -16 -16) (16 16 32) BORGQUEEN +/*QUAKED team_CTF_redplayer (1 0 0) (-16 -16 -16) (16 16 32) INITIAL -----DESCRIPTION----- -Only in CTF games. Red players spawn here at game start. -This is not used in RPG-X. +Merely a fancy name for info_player_deathmatch. -----SPAWNFLAGS----- -1: BORGQUEEN - The player that is the Borg Queen will spawn here +1: INITIAL - Preferred spawn for the first spawn of a client when entering a match. -----KEYS----- -none +"target" - entities with matching targetname will be fired if someone spawns here. +"nobots" - if 1 will prevent bots from using this spot. +"nohumans" - if 1 will prevent non-bots from using this spot. */ -/*QUAKED team_CTF_blueplayer (0 0 1) (-16 -16 -16) (16 16 32) BORGQUEEN +/*QUAKED team_CTF_blueplayer (0 0 1) (-16 -16 -16) (16 16 32) INITIAL -----DESCRIPTION----- -Only in CTF games. Blue players spawn here at game start. -This is not used in RPG-X. +Merely a fancy name for info_player_deathmatch. -----SPAWNFLAGS----- -1: BORGQUEEN - The player that is the Borg Queen will spawn here +1: INITIAL - Preferred spawn for the first spawn of a client when entering a match. -----KEYS----- -none +"target" - entities with matching targetname will be fired if someone spawns here. +"nobots" - if 1 will prevent bots from using this spot. +"nohumans" - if 1 will prevent non-bots from using this spot. */ -/*QUAKED team_CTF_redspawn (1 0 0) (-16 -16 -24) (16 16 32) STARTOFF +/*QUAKED team_CTF_redspawn (1 0 0) (-16 -16 -24) (16 16 32) INITIAL -----DESCRIPTION----- -potential spawning position for red team in CTF games, AFTER game start -Targets will be fired when someone spawns in on them. -This is not used in RPG-X. +Merely a fancy name for info_player_deathmatch. -----SPAWNFLAGS----- -STARTOFF - won't be considered as a spawn point until used +1: INITIAL - Preferred spawn for the first spawn of a client when entering a match. -----KEYS----- -targetname - when used, toggles between active and incative spawn point +"target" - entities with matching targetname will be fired if someone spawns here. +"nobots" - if 1 will prevent bots from using this spot. +"nohumans" - if 1 will prevent non-bots from using this spot. */ -/*QUAKED team_CTF_bluespawn (0 0 1) (-16 -16 -24) (16 16 32) STARTOFF +/*QUAKED team_CTF_bluespawn (0 0 1) (-16 -16 -24) (16 16 32) INITIAL -----DESCRIPTION----- -potential spawning position for blue team in CTF games, AFTER game start -Targets will be fired when someone spawns in on them. +Merely a fancy name for info_player_deathmatch. -----SPAWNFLAGS----- -STARTOFF - won't be considered as a spawn point until used +1: INITIAL - Preferred spawn for the first spawn of a client when entering a match. -----KEYS----- -targetname - when used, toggles between active and incative spawn point +"target" - entities with matching targetname will be fired if someone spawns here. +"nobots" - if 1 will prevent bots from using this spot. +"nohumans" - if 1 will prevent non-bots from using this spot. */ @@ -1372,6 +1252,22 @@ q3map2: "_castShadows" OR "_cs" sets whether the entity casts shadows "_receiveShadows" OR "_rs" sets whether the entity receives shadows +-----USAGE----- +As stated in the description there are 2 ways to use this kind of entity: As a trigger/activator or as Visual effect. +It is possible to do both, however giving an entity only one of the functions usually gives the mapper less of a headace. +Instead use the usable as VFx only and forward any command trough a target_relay. + +For trigger-usables you need the following keys: +"target" - what stuff to fire +"wait" - how long to wait before fire again +"spawnflags" - ALWAYS_ON (8) is required. You may also be interested in ADMIN_ONLY (256) NO_ACTIATOR (512) and DEACTIVATED (2048) +"message" or "messageNum" - display a string if scanned by a tricorder + +For VFX-usables these keys might be interesting: +"targetname" - turns visible/invisible when fired +"team" - set 2 as this will disallow clients from accidently using this +"spawnflags" - Interesting here are START_OFF (1), NOBLOCKCHECK (16) and NO_AREAPORTAL (1024) + -----LUA----- Sounds for consoles: One of the advantages with luaUse-functions is that you can play sounds on the usable you're using this comes in very handy if you'd like to for example play a sound on the turbolift-usable: @@ -1390,10 +1286,10 @@ Also if you have a (morer or less) generic console that you want to fire generic function consolesounds(ent, other, activator) i = qmath.irandom(1, ); if i == 1 then - sound.PlaySound(ent, , 0); + sound.PlaySound(ent, , 0); end if i == n then - sound.PlaySound(ent, , 0); + sound.PlaySound(ent, , 0); end end */ @@ -1742,6 +1638,18 @@ Opens the transporter UI. "target" - trigger_transporter to use with this ui_transporter */ +/*QUAKED ui_msd (.5 .5 .5) ? DISABLED +-----DESCRIPTION----- +Opens a Master Systems Display. It will display data grabbed from a target_shiphealth. + +-----SPAWNFLAGS----- +1: DISABLED - Entity is disabled at spawn + +-----KEYS----- +"swapname" - enables/disables entity(NO_ACTIVATOR/SELF flag must be checked for any entity using this) +"target" - target_shiphealth to draw info from +*/ + /*QUAKED target_shaderremap (1 0 0) (-8 -8 -8) (8 8 8) This will remap the shader "falsename" with shader "truename" and vice versa. It will save you some vfx-usables. @@ -1893,28 +1801,6 @@ falsename: redname for target_alert This is a safezone for the self destruct sequence. */ -/*QUAKED func_roff_mover (0 .5 .8) ? START_ON LOOP ------DESCRIPTION----- -Loads all of the movement data from an external ROFF file and applies -it to this entity, creating much more fluid motion. - -DISCONTINUED: Use Lua mover instead. - ------SPAWNFLAGS----- -1: START_ON - will start to move at spawn -2: LOOP - will loop it's mition - ------KEYS----- -"model2" .md3 model to also draw -"angle" determines the opening direction -"target" once the animation ends, these targetted entities will be triggered -"wait" from activation, how many seconds to wait before moving -"endwait" from the end of the animation, how many seconds to wait b4 firing its targets -"color" constantLight color -"light" constantLight radius -"noise" looping sound file that plays as it animates. -*/ - /*QUAKED cinematic_camera (0 0.5 0) (-4 -4 -4) (4 4 4) -----DESCRIPTION----- Camera for cinematic. Normally spawn by Lua script. @@ -1927,31 +1813,4 @@ none -----LUA----- To be written later. -*/ - -/*QUAKED func_forcefield2 (0 .5 .8) ? STARTOFF AUTOANIM X ALWAYS_ON NOBLOCKCHECK X X X ------DESCRIPTION----- -DO NOT USE! This is basically the original Game forcefield with some tweaks and not much different than a func_usable. -It just sits here in case you encounter it one day. - -A bmodel that can be used directly by the player's "activate" button - ------SPAWNFLAGS----- -1: START_OFF - the forcefield will not be there -2: AUTOANIM - If useing an md3, it will animate -4: X - Unused? -8: ALWAYS_ON - Doesn't toggle on and off when used, just fires target -16: NOBLOCKCHECK - Will NOT turn on while something is inside it unless this is checked -32: X - Unused? -64: X - Unused? -128: X - Unused? - ------KEYS----- -"targetname" - When used, will toggle on and off -"target" - Will fire this target every time it is toggled OFF -"model2" - .md3 model to also draw -"color" - constantLight color -"light" - constantLight radius -"wait" - amount of time before the object is usable again (only valid with ALWAYS_ON flag) -"health" - if it has health, it will be used whenever shot at/killed - if you want it to only be used once this way, set health to 1 */ \ No newline at end of file