codemp/game/g_ICARUScb.c File Reference

#include "q_shared.h"
#include "bg_public.h"
#include "b_local.h"
#include "../icarus/Q3_Interface.h"
#include "../icarus/Q3_Registers.h"
#include "g_nav.h"
#include "../namespace_begin.h"
#include "../namespace_end.h"
#include "../icarus/interpreter.h"

Go to the source code of this file.

Enumerations

enum  {
  TK_EOF = -1, TK_UNDEFINED, TK_COMMENT, TK_EOL,
  TK_CHAR, TK_STRING, TK_INT, TK_INTEGER = TK_INT,
  TK_FLOAT, TK_IDENTIFIER, TK_USERDEF
}

Functions

qboolean BG_SabersOff (playerState_t *ps)
void Q3_TaskIDClear (int *taskID)
void G_DebugPrint (int level, const char *format,...)
int Q3_PlaySound (int taskID, int entID, const char *name, const char *channel)
void Q3_Play (int taskID, int entID, const char *type, const char *name)
void anglerCallback (gentity_t *ent)
void MatchTeam (gentity_t *teamLeader, int moverState, int time)
void Blocked_Mover (gentity_t *ent, gentity_t *other)
void moverCallback (gentity_t *ent)
void moveAndRotateCallback (gentity_t *ent)
void Q3_Lerp2Start (int entID, int taskID, float duration)
void Q3_Lerp2End (int entID, int taskID, float duration)
void InitMoverTrData (gentity_t *ent)
void Q3_Lerp2Pos (int taskID, int entID, vec3_t origin, vec3_t angles, float duration)
void Q3_Lerp2Angles (int taskID, int entID, vec3_t angles, float duration)
int Q3_GetTag (int entID, const char *name, int lookup, vec3_t info)
void Q3_Use (int entID, const char *target)
void Q3_Kill (int entID, const char *name)
void Q3_RemoveEnt (gentity_t *victim)
void Q3_Remove (int entID, const char *name)
int Q3_GetFloat (int entID, int type, const char *name, float *value)
int Q3_GetVector (int entID, int type, const char *name, vec3_t value)
int Q3_GetString (int entID, int type, const char *name, char **value)
qboolean SpotWouldTelefrag2 (gentity_t *mover, vec3_t dest)
void MoveOwner (gentity_t *self)
void Q3_Lerp2Origin (int taskID, int entID, vec3_t origin, float duration)
void Q3_SetLoopSound (int entID, const char *name)
void Q3_SetICARUSFreeze (int entID, const char *name, qboolean freeze)
void Q3_SetViewEntity (int entID, const char *name)
void ChangeWeapon (gentity_t *ent, int newWeapon)
void Q3_SetParm (int entID, int parmNum, const char *parmValue)
void SolidifyOwner (gentity_t *self)
void UnLockDoors (gentity_t *const ent)
void LockDoors (gentity_t *const ent)
qboolean Q3_Set (int taskID, int entID, const char *type_name, const char *data)

Variables

stringID_table_t WPTable []
stringID_table_t BSTable []
stringID_table_t animTable [MAX_ANIMATIONS+1]
stringID_table_t setTable []
char cinematicSkipScript [1024]
qboolean player_locked = qfalse
vec4_t textcolor_caption
vec4_t textcolor_center
vec4_t textcolor_scroll


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
TK_EOF 
TK_UNDEFINED 
TK_COMMENT 
TK_EOL 
TK_CHAR 
TK_STRING 
TK_INT 
TK_INTEGER 
TK_FLOAT 
TK_IDENTIFIER 
TK_USERDEF 

Definition at line 31 of file g_ICARUScb.c.

00032 {
00033         TK_EOF = -1,
00034         TK_UNDEFINED,
00035         TK_COMMENT,
00036         TK_EOL,
00037         TK_CHAR,
00038         TK_STRING,
00039         TK_INT,
00040         TK_INTEGER = TK_INT,
00041         TK_FLOAT,
00042         TK_IDENTIFIER,
00043         TK_USERDEF,
00044 };


Function Documentation

void anglerCallback gentity_t ent  ) 
 

Definition at line 569 of file g_ICARUScb.c.

References anglerCallback(), entityState_s::apos, entityShared_t::currentAngles, gentity_t, level, gentity_s::r, gentity_s::reached, gentity_s::s, gentity_s::think, TID_ANGLE_FACE, level_locals_t::time, TR_STATIONARY, trap_ICARUS_TaskIDComplete(), trap_LinkEntity(), trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trDuration, trajectory_t::trTime, trajectory_t::trType, VectorClear, VectorCopy, and VectorMA.

Referenced by anglerCallback(), moveAndRotateCallback(), and Q3_Lerp2Angles().

00570 {
00571         //Complete the task
00572         trap_ICARUS_TaskIDComplete( ent, TID_ANGLE_FACE );
00573 
00574         //Set the currentAngles, clear all movement
00575         VectorMA( ent->s.apos.trBase, (ent->s.apos.trDuration*0.001f), ent->s.apos.trDelta, ent->r.currentAngles );
00576         VectorCopy( ent->r.currentAngles, ent->s.apos.trBase );
00577         VectorClear( ent->s.apos.trDelta );
00578         ent->s.apos.trDuration = 1;
00579         ent->s.apos.trType = TR_STATIONARY;
00580         ent->s.apos.trTime = level.time;
00581 
00582         //Stop thinking
00583         ent->reached = 0;
00584         if ( ent->think == anglerCallback )
00585         {
00586                 ent->think = 0;
00587         }
00588 
00589         //link
00590         trap_LinkEntity( ent );
00591 }

qboolean BG_SabersOff playerState_t ps  ) 
 

Definition at line 201 of file bg_pmove.c.

00202 {
00203         if ( !ps->saberHolstered )
00204         {
00205                 return qfalse;
00206         }
00207         if ( ps->fd.saberAnimLevelBase == SS_DUAL
00208                 || ps->fd.saberAnimLevelBase == SS_STAFF )
00209         {
00210                 if ( ps->saberHolstered < 2 )
00211                 {
00212                         return qfalse;
00213                 }
00214         }
00215         return qtrue;
00216 }

void Blocked_Mover gentity_t ent,
gentity_t other
 

Definition at line 635 of file g_ICARUScb.c.

References gentity_s::client, entityShared_t::contents, CONTENTS_CORPSE, gentity_s::damage, ET_ITEM, entityState_s::eType, G_Damage(), G_FreeEntity(), gentity_t, gentity_s::health, gentity_s::message, MOD_CRUSH, NULL, entityState_s::number, gentity_s::r, and gentity_s::s.

Referenced by moverCallback(), Q3_Lerp2End(), Q3_Lerp2Origin(), Q3_Lerp2Pos(), and Q3_Lerp2Start().

00636 {
00637         // remove anything other than a client -- no longer the case
00638 
00639         // don't remove security keys or goodie keys
00640         if ( (other->s.eType == ET_ITEM) )
00641         {
00642                 // should we be doing anything special if a key blocks it... move it somehow..?
00643         }
00644         // if your not a client, or your a dead client remove yourself...
00645         else if ( other->s.number && (!other->client || (other->client && other->health <= 0 && other->r.contents == CONTENTS_CORPSE && !other->message)) )
00646         {
00647                 //if ( !other->taskManager || !other->taskManager->IsRunning() )
00648                 {
00649                         // if an item or weapon can we do a little explosion..?
00650                         G_FreeEntity( other );
00651                         return;
00652                 }
00653         }
00654 
00655         if ( ent->damage ) {
00656                 G_Damage( other, ent, ent, NULL, NULL, ent->damage, 0, MOD_CRUSH );
00657         }
00658 }

void ChangeWeapon gentity_t ent,
int  newWeapon
 

void G_DebugPrint int  level,
const char *  format,
... 
 

Definition at line 275 of file g_ICARUScb.c.

References Com_Printf(), g_developer, g_entities, vmCvar_t::integer, level, MAX_GENTITIES, S_COLOR_BLUE, S_COLOR_GREEN, S_COLOR_RED, S_COLOR_YELLOW, sscanf(), va_end, va_list, va_start, vsprintf(), WL_DEBUG, WL_ERROR, WL_VERBOSE, and WL_WARNING.

Referenced by G_ActivateBehavior(), NPC_Begin(), Q3_GetFloat(), Q3_GetString(), Q3_GetVector(), Q3_Kill(), Q3_Lerp2Angles(), Q3_Lerp2End(), Q3_Lerp2Origin(), Q3_Lerp2Pos(), Q3_Lerp2Start(), Q3_Remove(), Q3_RemoveEnt(), Q3_Set(), Q3_SetICARUSFreeze(), Q3_SetLoopSound(), Q3_SetParm(), Q3_SetViewEntity(), Q3_Use(), and target_counter_use().

00276 {
00277         va_list         argptr;
00278         char            text[1024];
00279 
00280         //Don't print messages they don't want to see
00281         //if ( g_ICARUSDebug->integer < level )
00282         if (g_developer.integer != 2)
00283                 return;
00284 
00285         va_start (argptr, format);
00286         vsprintf (text, format, argptr);
00287         va_end (argptr);
00288 
00289         //Add the color formatting
00290         switch ( level )
00291         {
00292                 case WL_ERROR:
00293                         Com_Printf ( S_COLOR_RED"ERROR: %s", text );
00294                         break;
00295                 
00296                 case WL_WARNING:
00297                         Com_Printf ( S_COLOR_YELLOW"WARNING: %s", text );
00298                         break;
00299                 
00300                 case WL_DEBUG:
00301                         {
00302                                 int             entNum;
00303                                 char    *buffer;
00304 
00305                                 sscanf( text, "%d", &entNum );
00306 
00307                                 //if ( ( ICARUS_entFilter >= 0 ) && ( ICARUS_entFilter != entNum ) )
00308                                 //      return;
00309 
00310                                 buffer = (char *) text;
00311                                 buffer += 5;
00312 
00313                                 if ( ( entNum < 0 ) || ( entNum > MAX_GENTITIES ) )
00314                                         entNum = 0;
00315 
00316                                 Com_Printf ( S_COLOR_BLUE"DEBUG: %s(%d): %s\n", g_entities[entNum].script_targetname, entNum, buffer );
00317                                 break;
00318                         }
00319                 default:
00320                 case WL_VERBOSE:
00321                         Com_Printf ( S_COLOR_GREEN"INFO: %s", text );
00322                         break;
00323         }
00324 }

void InitMoverTrData gentity_t ent  ) 
 

Definition at line 903 of file g_mover.c.

References gentity_t, entityState_s::pos, gentity_s::pos1, gentity_s::pos2, gentity_s::s, gentity_s::speed, TR_STATIONARY, trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trDuration, trajectory_t::trType, vec3_t, VectorCopy, VectorScale, and VectorSubtract.

Referenced by InitMover(), Q3_Lerp2Origin(), and Q3_Lerp2Pos().

00904 {
00905         vec3_t          move;
00906         float           distance;
00907 
00908         ent->s.pos.trType = TR_STATIONARY;
00909         VectorCopy( ent->pos1, ent->s.pos.trBase );
00910 
00911         // calculate time to reach second position from speed
00912         VectorSubtract( ent->pos2, ent->pos1, move );
00913         distance = VectorLength( move );
00914         if ( ! ent->speed ) 
00915         {
00916                 ent->speed = 100;
00917         }
00918         VectorScale( move, ent->speed, ent->s.pos.trDelta );
00919         ent->s.pos.trDuration = distance * 1000 / ent->speed;
00920         if ( ent->s.pos.trDuration <= 0 ) 
00921         {
00922                 ent->s.pos.trDuration = 1;
00923         }
00924 }

void LockDoors gentity_t *const  ent  ) 
 

Definition at line 836 of file g_mover.c.

References entityState_s::frame, gentity_t, MOVER_LOCKED, gentity_s::s, gentity_s::spawnflags, and gentity_s::teamchain.

Referenced by Q3_Set().

00837 {
00838         //noise?
00839         //go through and lock the door and all the slaves
00840         gentity_t       *slave = ent;
00841         do 
00842         {
00843                 slave->spawnflags |= MOVER_LOCKED;
00844                 slave->s.frame = 0;//first stage of anim
00845                 slave = slave->teamchain;
00846         } while  ( slave );
00847 }

void MatchTeam gentity_t teamLeader,
int  moverState,
int  time
 

Definition at line 590 of file g_mover.c.

References gentity_t, moverState_t, SetMoverState(), and gentity_s::teamchain.

00590                                                                   {
00591         gentity_t               *slave;
00592 
00593         for ( slave = teamLeader ; slave ; slave = slave->teamchain ) {
00594                 SetMoverState( slave, (moverState_t) moverState, time );
00595         }
00596 }

void moveAndRotateCallback gentity_t ent  ) 
 

Definition at line 667 of file g_ICARUScb.c.

References anglerCallback(), gentity_t, and moverCallback().

Referenced by Q3_Lerp2Pos().

00668 {
00669         //stop turning
00670         anglerCallback( ent );
00671         //stop moving
00672         moverCallback( ent );
00673 }

void MoveOwner gentity_t self  ) 
 

Definition at line 1865 of file g_ICARUScb.c.

References entityShared_t::currentOrigin, FRAMETIME, g_entities, G_FreeEntity(), G_SetOrigin(), gentity_t, gentity_s::inuse, level, MoveOwner(), gentity_s::nextthink, entityShared_t::ownerNum, gentity_s::r, SpotWouldTelefrag2(), gentity_s::think, TID_MOVE_NAV, level_locals_t::time, and trap_ICARUS_TaskIDComplete().

Referenced by MoveOwner().

01866 {
01867         gentity_t *owner = &g_entities[self->r.ownerNum];
01868 
01869         self->nextthink = level.time + FRAMETIME;
01870         self->think = G_FreeEntity;
01871 
01872         if ( !owner || !owner->inuse )
01873         {
01874                 return;
01875         }
01876 
01877         if ( SpotWouldTelefrag2( owner, self->r.currentOrigin ) )
01878         {
01879                 self->think = MoveOwner;
01880         }
01881         else
01882         {
01883                 G_SetOrigin( owner, self->r.currentOrigin );
01884                 trap_ICARUS_TaskIDComplete( owner, TID_MOVE_NAV );
01885         }
01886 }

void moverCallback gentity_t ent  ) 
 

Definition at line 603 of file g_ICARUScb.c.

References gentity_s::blocked, Blocked_Mover(), BMS_END, G_PlayDoorSound(), gentity_t, level, entityState_s::loopIsSoundset, entityState_s::loopSound, MatchTeam(), MOVER_1TO2, MOVER_2TO1, MOVER_POS1, MOVER_POS2, gentity_s::moverState, qfalse, gentity_s::s, TID_MOVE_NAV, level_locals_t::time, and trap_ICARUS_TaskIDComplete().

Referenced by moveAndRotateCallback(), Q3_Lerp2End(), Q3_Lerp2Origin(), Q3_Lerp2Pos(), and Q3_Lerp2Start().

00604 {       //complete the task
00605         trap_ICARUS_TaskIDComplete( ent, TID_MOVE_NAV );
00606         
00607         // play sound
00608         ent->s.loopSound = 0;//stop looping sound
00609         ent->s.loopIsSoundset = qfalse;
00610         G_PlayDoorSound( ent, BMS_END );//play end sound
00611 
00612         if ( ent->moverState == MOVER_1TO2 ) 
00613         {//reached open
00614                 // reached pos2
00615                 MatchTeam( ent, MOVER_POS2, level.time );
00616                 //SetMoverState( ent, MOVER_POS2, level.time );
00617         } 
00618         else if ( ent->moverState == MOVER_2TO1 ) 
00619         {//reached closed
00620                 MatchTeam( ent, MOVER_POS1, level.time );
00621                 //SetMoverState( ent, MOVER_POS1, level.time );
00622         }
00623 
00624         if ( ent->blocked == Blocked_Mover )
00625         {
00626                 ent->blocked = 0;
00627         }
00628 
00629 //      if ( !Q_stricmp( "misc_model_breakable", ent->classname ) && ent->physicsBounce )
00630 //      {//a gravity-affected model
00631 //              misc_model_breakable_gravity_init( ent, qfalse );
00632 //      }
00633 }

int Q3_GetFloat int  entID,
int  type,
const char *  name,
float *  value
 

Definition at line 1189 of file g_ICARUScb.c.

References atof(), gentity_s::classname, gentity_s::client, entityShared_t::contents, gentity_s::count, entityShared_t::currentOrigin, EF_NODRAW, entityState_s::eFlags, FL_GODMODE, FL_NO_KNOCKBACK, FL_NOTARGET, gentity_s::flags, G_DebugPrint(), g_entities, g_gravity, gentity_t, GetIDForString(), gentity_s::health, playerState_s::legsTimer, entityShared_t::mins, name, NULL, entityState_s::origin, parms_t::parm, gentity_s::parms, gclient_s::ps, gentity_s::r, gentity_s::s, SET_AGGRESSION, SET_AIM, SET_ALT_FIRE, SET_ANIM_HOLDTIME_BOTH, SET_ANIM_HOLDTIME_LOWER, SET_ANIM_HOLDTIME_UPPER, SET_ANIMFRAME, SET_ARMOR, SET_CAMERA_GROUP_Z_OFS, SET_CHASE_ENEMIES, SET_COUNT, SET_CROUCHED, SET_DELAYSCRIPTTIME, SET_DISABLE_SHADER_ANIM, SET_DISMEMBERABLE, SET_DONTFIRE, SET_DONTSHOOT, SET_DPITCH, SET_DYAW, SET_EARSHOT, SET_ENDFRAME, SET_FACE_MOVE_DIR, SET_FACEAUX, SET_FACEBLINK, SET_FACEBLINKFROWN, SET_FACEEYESCLOSED, SET_FACEEYESOPENED, SET_FACEFROWN, SET_FACENORMAL, SET_FOLLOWDIST, SET_FORCE_INVINCIBLE, SET_FORCED_MARCH, SET_FORWARDMOVE, SET_FRICTION, SET_GRAVITY, SET_GREET_ALLIES, SET_HEALTH, SET_HFOV, SET_IGNOREALERTS, SET_IGNOREENEMIES, SET_IGNOREPAIN, SET_INTERFACE, SET_INVINCIBLE, SET_INVISIBLE, SET_LOCK_PLAYER_WEAPONS, SET_LOCKED_ENEMY, SET_LOOK_FOR_ENEMIES, SET_LOOP_ANIM, SET_MISSIONSTATUSACTIVE, SET_MISSIONSTATUSTIME, SET_MORELIGHT, SET_NO_ACROBATICS, SET_NO_ALERT_TALK, SET_NO_COMBAT_TALK, SET_NO_FALLTODEATH, SET_NO_FORCE, SET_NO_IMPACT_DAMAGE, SET_NO_KNOCKBACK, SET_NO_RESPONSE, SET_NOAVOID, SET_NOTARGET, SET_PARM1, SET_PARM10, SET_PARM11, SET_PARM12, SET_PARM13, SET_PARM14, SET_PARM15, SET_PARM16, SET_PARM2, SET_PARM3, SET_PARM4, SET_PARM5, SET_PARM6, SET_PARM7, SET_PARM8, SET_PARM9, SET_PLAYER_LOCKED, SET_PLAYER_USABLE, SET_RIGHTMOVE, SET_RUNNING, SET_RUNSPEED, SET_SHADER_ANIM, SET_SHIELDS, SET_SHOOTDIST, SET_SHOT_SPACING, SET_SKILL, SET_SOLID, SET_STARTFRAME, SET_TIMESCALE, SET_TREASONED, SET_UNDYING, SET_USE_CP_NEAREST, SET_USE_SUBTITLES, SET_VAMPIRE, SET_VFOV, SET_VIDEO_FADE_IN, SET_VIDEO_FADE_OUT, SET_VIGILANCE, SET_VISRANGE, SET_WAIT, SET_WALKING, SET_WALKSPEED, SET_WIDTH, SET_XVELOCITY, SET_YAWSPEED, SET_YVELOCITY, SET_Z_OFFSET, SET_ZVELOCITY, setTable, STAT_ARMOR, playerState_s::stats, SVF_PLAYER_USABLE, entityShared_t::svFlags, gentity_s::targetname, playerState_s::torsoTimer, trap_ICARUS_GetFloatVariable(), trap_ICARUS_VariableDeclared(), vmCvar_t::value, playerState_s::velocity, gentity_s::wait, WL_ERROR, and WL_WARNING.

Referenced by vmMain().

01190 {
01191         gentity_t       *ent = &g_entities[entID];
01192         int toGet = 0;
01193 
01194         if ( !ent )
01195         {
01196                 return 0;
01197         }
01198 
01199         toGet = GetIDForString( setTable, name );       //FIXME: May want to make a "getTable" as well
01200         //FIXME: I'm getting really sick of these huge switch statements!
01201 
01202         //NOTENOTE: return true if the value was correctly obtained
01203         switch ( toGet )
01204         {
01205         case SET_PARM1:
01206         case SET_PARM2:
01207         case SET_PARM3:
01208         case SET_PARM4:
01209         case SET_PARM5:
01210         case SET_PARM6:
01211         case SET_PARM7:
01212         case SET_PARM8:
01213         case SET_PARM9:
01214         case SET_PARM10:
01215         case SET_PARM11:
01216         case SET_PARM12:
01217         case SET_PARM13:
01218         case SET_PARM14:
01219         case SET_PARM15:
01220         case SET_PARM16:
01221                 if (ent->parms == NULL)
01222                 {
01223                         G_DebugPrint( WL_ERROR, "GET_PARM: %s %s did not have any parms set!\n", ent->classname, ent->targetname );
01224                         return 0;       // would prefer qfalse, but I'm fitting in with what's here <sigh>
01225                 }
01226                 *value = atof( ent->parms->parm[toGet - SET_PARM1] );
01227                 break;
01228         
01229         case SET_COUNT:
01230                 *value = ent->count;
01231                 break;
01232 
01233         case SET_HEALTH:
01234                 *value = ent->health;
01235                 break;
01236 
01237         case SET_SKILL:
01238                 return 0;
01239                 break;
01240 
01241         case SET_XVELOCITY://## %f="0.0" # Velocity along X axis
01242                 if ( ent->client == NULL )
01243                 {
01244                         G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_XVELOCITY, %s not a client\n", ent->targetname );
01245                         return 0;
01246                 }
01247                 *value = ent->client->ps.velocity[0];
01248                 break;
01249 
01250         case SET_YVELOCITY://## %f="0.0" # Velocity along Y axis
01251                 if ( ent->client == NULL )
01252                 {
01253                         G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_YVELOCITY, %s not a client\n", ent->targetname );
01254                         return 0;
01255                 }
01256                 *value = ent->client->ps.velocity[1];
01257                 break;
01258 
01259         case SET_ZVELOCITY://## %f="0.0" # Velocity along Z axis
01260                 if ( ent->client == NULL )
01261                 {
01262                         G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_ZVELOCITY, %s not a client\n", ent->targetname );
01263                         return 0;
01264                 }
01265                 *value = ent->client->ps.velocity[2];
01266                 break;
01267 
01268         case SET_Z_OFFSET:
01269                 *value = ent->r.currentOrigin[2] - ent->s.origin[2];
01270                 break;
01271 
01272         case SET_DPITCH://## %f="0.0" # Pitch for NPC to turn to
01273                 return 0;
01274                 break;
01275 
01276         case SET_DYAW://## %f="0.0" # Yaw for NPC to turn to
01277                 return 0;
01278                 break;
01279 
01280         case SET_WIDTH://## %f="0.0" # Width of NPC bounding box
01281                 *value = ent->r.mins[0];
01282                 break;
01283         case SET_TIMESCALE://## %f="0.0" # Speed-up slow down game (0 - 1.0)
01284                 return 0;
01285                 break;
01286         case SET_CAMERA_GROUP_Z_OFS://## %s="NULL" # all ents with this cameraGroup will be focused on
01287                 return 0;
01288                 break;
01289 
01290         case SET_VISRANGE://## %f="0.0" # How far away NPC can see
01291                 return 0;
01292                 break;
01293 
01294         case SET_EARSHOT://## %f="0.0" # How far an NPC can hear
01295                 return 0;
01296                 break;
01297 
01298         case SET_VIGILANCE://## %f="0.0" # How often to look for enemies (0 - 1.0)
01299                 return 0;
01300                 break;
01301 
01302         case SET_GRAVITY://## %f="0.0" # Change this ent's gravity - 800 default
01303                 *value = g_gravity.value;
01304                 break;
01305 
01306         case SET_FACEEYESCLOSED:
01307         case SET_FACEEYESOPENED:
01308         case SET_FACEAUX:               //## %f="0.0" # Set face to Aux expression for number of seconds
01309         case SET_FACEBLINK:             //## %f="0.0" # Set face to Blink expression for number of seconds
01310         case SET_FACEBLINKFROWN:        //## %f="0.0" # Set face to Blinkfrown expression for number of seconds
01311         case SET_FACEFROWN:             //## %f="0.0" # Set face to Frown expression for number of seconds
01312         case SET_FACENORMAL:            //## %f="0.0" # Set face to Normal expression for number of seconds
01313                 G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_FACE___ not implemented\n" );
01314                 return 0;
01315                 break;
01316         case SET_WAIT:          //## %f="0.0" # Change an entity's wait field
01317                 *value = ent->wait;
01318                 break;
01319         case SET_FOLLOWDIST:            //## %f="0.0" # How far away to stay from leader in BS_FOLLOW_LEADER
01320                 return 0;
01321                 break;
01322         //# #sep ints
01323         case SET_ANIM_HOLDTIME_LOWER://## %d="0" # Hold lower anim for number of milliseconds
01324                 if ( ent->client == NULL )
01325                 {
01326                         G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_ANIM_HOLDTIME_LOWER, %s not a client\n", ent->targetname );
01327                         return 0;
01328                 }
01329                 *value = ent->client->ps.legsTimer;
01330                 break;
01331         case SET_ANIM_HOLDTIME_UPPER://## %d="0" # Hold upper anim for number of milliseconds
01332                 if ( ent->client == NULL )
01333                 {
01334                         G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_ANIM_HOLDTIME_UPPER, %s not a client\n", ent->targetname );
01335                         return 0;
01336                 }
01337                 *value = ent->client->ps.torsoTimer;
01338                 break;
01339         case SET_ANIM_HOLDTIME_BOTH://## %d="0" # Hold lower and upper anims for number of milliseconds
01340                 G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_ANIM_HOLDTIME_BOTH not implemented\n" );
01341                 return 0;
01342                 break;
01343         case SET_ARMOR://## %d="0" # Change armor
01344                 if ( ent->client == NULL )
01345                 {
01346                         G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_ARMOR, %s not a client\n", ent->targetname );
01347                         return 0;
01348                 }
01349                 *value = ent->client->ps.stats[STAT_ARMOR];
01350                 break;
01351         case SET_WALKSPEED://## %d="0" # Change walkSpeed
01352                 return 0;
01353                 break;
01354         case SET_RUNSPEED://## %d="0" # Change runSpeed
01355                 return 0;
01356                 break;
01357         case SET_YAWSPEED://## %d="0" # Change yawSpeed
01358                 return 0;
01359                 break;
01360         case SET_AGGRESSION://## %d="0" # Change aggression 1-5
01361                 return 0;
01362                 break;
01363         case SET_AIM://## %d="0" # Change aim 1-5
01364                 return 0;
01365                 break;
01366         case SET_FRICTION://## %d="0" # Change ent's friction - 6 default
01367                 return 0;
01368                 break;
01369         case SET_SHOOTDIST://## %d="0" # How far the ent can shoot - 0 uses weapon
01370                 return 0;
01371                 break;
01372         case SET_HFOV://## %d="0" # Horizontal field of view
01373                 return 0;
01374                 break;
01375         case SET_VFOV://## %d="0" # Vertical field of view
01376                 return 0;
01377                 break;
01378         case SET_DELAYSCRIPTTIME://## %d="0" # How many seconds to wait before running delayscript
01379                 return 0;
01380                 break;
01381         case SET_FORWARDMOVE://## %d="0" # NPC move forward -127(back) to 127
01382                 return 0;
01383                 break;
01384         case SET_RIGHTMOVE://## %d="0" # NPC move right -127(left) to 127
01385                 return 0;
01386                 break;
01387         case SET_STARTFRAME:    //## %d="0" # frame to start animation sequence on
01388                 return 0;
01389                 break;
01390         case SET_ENDFRAME:      //## %d="0" # frame to end animation sequence on
01391                 return 0;
01392                 break;
01393         case SET_ANIMFRAME:     //## %d="0" # of current frame
01394                 return 0;
01395                 break;
01396 
01397         case SET_SHOT_SPACING://## %d="1000" # Time between shots for an NPC - reset to defaults when changes weapon
01398                 return 0;
01399                 break;
01400         case SET_MISSIONSTATUSTIME://## %d="0" # Amount of time until Mission Status should be shown after death
01401                 return 0;
01402                 break;
01403         //# #sep booleans
01404         case SET_IGNOREPAIN://## %t="BOOL_TYPES" # Do not react to pain
01405                 return 0;
01406                 break;
01407         case SET_IGNOREENEMIES://## %t="BOOL_TYPES" # Do not acquire enemies
01408                 return 0;
01409                 break;
01410         case SET_IGNOREALERTS://## Do not get enemy set by allies in area(ambush)
01411                 return 0;
01412                 break;
01413         case SET_DONTSHOOT://## %t="BOOL_TYPES" # Others won't shoot you
01414                 return 0;
01415                 break;
01416         case SET_NOTARGET://## %t="BOOL_TYPES" # Others won't pick you as enemy
01417                 *value = (ent->flags&FL_NOTARGET);
01418                 break;
01419         case SET_DONTFIRE://## %t="BOOL_TYPES" # Don't fire your weapon
01420                 return 0;
01421                 break;
01422 
01423         case SET_LOCKED_ENEMY://## %t="BOOL_TYPES" # Keep current enemy until dead
01424                 return 0;
01425                 break;
01426         case SET_CROUCHED://## %t="BOOL_TYPES" # Force NPC to crouch
01427                 return 0;
01428                 break;
01429         case SET_WALKING://## %t="BOOL_TYPES" # Force NPC to move at walkSpeed
01430                 return 0;
01431                 break;
01432         case SET_RUNNING://## %t="BOOL_TYPES" # Force NPC to move at runSpeed
01433                 return 0;
01434                 break;
01435         case SET_CHASE_ENEMIES://## %t="BOOL_TYPES" # NPC will chase after enemies
01436                 return 0;
01437                 break;
01438         case SET_LOOK_FOR_ENEMIES://## %t="BOOL_TYPES" # NPC will be on the lookout for enemies
01439                 return 0;
01440                 break;
01441         case SET_FACE_MOVE_DIR://## %t="BOOL_TYPES" # NPC will face in the direction it's moving
01442                 return 0;
01443                 break;
01444         case SET_FORCED_MARCH://## %t="BOOL_TYPES" # Force NPC to move at runSpeed
01445                 return 0;
01446                 break;
01447         case SET_UNDYING://## %t="BOOL_TYPES" # Can take damage down to 1 but not die
01448                 return 0;
01449                 break;
01450         case SET_NOAVOID://## %t="BOOL_TYPES" # Will not avoid other NPCs or architecture
01451                 return 0;
01452                 break;
01453 
01454         case SET_SOLID://## %t="BOOL_TYPES" # Make yourself notsolid or solid
01455                 *value = ent->r.contents;
01456                 break;
01457         case SET_PLAYER_USABLE://## %t="BOOL_TYPES" # Can be activateby the player's "use" button
01458                 *value = (ent->r.svFlags&SVF_PLAYER_USABLE);
01459                 break;
01460         case SET_LOOP_ANIM://## %t="BOOL_TYPES" # For non-NPCs: loop your animation sequence
01461                 return 0;
01462                 break;
01463         case SET_INTERFACE://## %t="BOOL_TYPES" # Player interface on/off
01464                 G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_INTERFACE not implemented\n" );
01465                 return 0;
01466                 break;
01467         case SET_SHIELDS://## %t="BOOL_TYPES" # NPC has no shields (Borg do not adapt)
01468                 return 0;
01469                 break;
01470         case SET_INVISIBLE://## %t="BOOL_TYPES" # Makes an NPC not solid and not visible
01471                 *value = (ent->s.eFlags&EF_NODRAW);
01472                 break;
01473         case SET_VAMPIRE://## %t="BOOL_TYPES" # Makes an NPC not solid and not visible
01474                 return 0;
01475                 break;
01476         case SET_FORCE_INVINCIBLE://## %t="BOOL_TYPES" # Makes an NPC not solid and not visible
01477                 return 0;
01478                 break;
01479         case SET_GREET_ALLIES://## %t="BOOL_TYPES" # Makes an NPC greet teammates
01480                 return 0;
01481                 break;
01482         case SET_VIDEO_FADE_IN://## %t="BOOL_TYPES" # Makes video playback fade in
01483                 G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_VIDEO_FADE_IN not implemented\n" );
01484                 return 0;
01485                 break;
01486         case SET_VIDEO_FADE_OUT://## %t="BOOL_TYPES" # Makes video playback fade out
01487                 G_DebugPrint( WL_WARNING, "Q3_GetFloat: SET_VIDEO_FADE_OUT not implemented\n" );
01488                 return 0;
01489                 break;
01490         case SET_PLAYER_LOCKED://## %t="BOOL_TYPES" # Makes it so player cannot move
01491                 return 0;
01492                 break;
01493         case SET_LOCK_PLAYER_WEAPONS://## %t="BOOL_TYPES" # Makes it so player cannot switch weapons
01494                 return 0;
01495                 break;
01496         case SET_NO_IMPACT_DAMAGE://## %t="BOOL_TYPES" # Makes it so player cannot switch weapons
01497                 return 0;
01498                 break;
01499         case SET_NO_KNOCKBACK://## %t="BOOL_TYPES" # Stops this ent from taking knockback from weapons
01500                 *value = (ent->flags&FL_NO_KNOCKBACK);
01501                 break;
01502         case SET_ALT_FIRE://## %t="BOOL_TYPES" # Force NPC to use altfire when shooting
01503                 return 0;
01504                 break;
01505         case SET_NO_RESPONSE://## %t="BOOL_TYPES" # NPCs will do generic responses when this is on (usescripts override generic responses as well)
01506                 return 0;
01507                 break;
01508         case SET_INVINCIBLE://## %t="BOOL_TYPES" # Completely unkillable
01509                 *value = (ent->flags&FL_GODMODE);
01510                 break;
01511         case SET_MISSIONSTATUSACTIVE:   //# Turns on Mission Status Screen
01512                 return 0;
01513                 break;
01514         case SET_NO_COMBAT_TALK://## %t="BOOL_TYPES" # NPCs will not do their combat talking noises when this is on
01515                 return 0;
01516                 break;
01517         case SET_NO_ALERT_TALK://## %t="BOOL_TYPES" # NPCs will not do their combat talking noises when this is on
01518                 return 0;
01519                 break;
01520         case SET_USE_CP_NEAREST://## %t="BOOL_TYPES" # NPCs will use their closest combat points, not try and find ones next to the player, or flank player
01521                 return 0;
01522                 break;
01523         case SET_DISMEMBERABLE://## %t="BOOL_TYPES" # NPC will not be affected by force powers
01524                 return 0;
01525                 break;
01526         case SET_NO_FORCE:
01527                 return 0;
01528                 break;
01529         case SET_NO_ACROBATICS:
01530                 return 0;
01531                 break;
01532         case SET_USE_SUBTITLES:
01533                 return 0;
01534                 break;
01535         case SET_NO_FALLTODEATH://## %t="BOOL_TYPES" # NPC will not be affected by force powers
01536                 return 0;
01537                 break;
01538         case SET_MORELIGHT://## %t="BOOL_TYPES" # NPCs will use their closest combat points, not try and find ones next to the player, or flank player
01539                 return 0;
01540                 break;
01541         case SET_TREASONED://## %t="BOOL_TYPES" # Player has turned on his own- scripts will stop: NPCs will turn on him and level changes load the brig
01542                 return 0;
01543                 break;
01544         case SET_DISABLE_SHADER_ANIM:   //## %t="BOOL_TYPES" # Shaders won't animate
01545                 return 0;
01546                 break;
01547         case SET_SHADER_ANIM:   //## %t="BOOL_TYPES" # Shader will be under frame control
01548                 return 0;
01549                 break;
01550 
01551         default:
01552                 if ( trap_ICARUS_VariableDeclared( name ) != VTYPE_FLOAT )
01553                         return 0;
01554 
01555                 return trap_ICARUS_GetFloatVariable( name, value );
01556         }
01557 
01558         return 1;
01559 }

int Q3_GetString int  entID,
int  type,
const char *  name,
char **  value
 

Definition at line 1642 of file g_ICARUScb.c.

References gentity_s::behaviorSet, BSET_ANGER, BSET_ATTACK, BSET_AWAKE, BSET_BLOCKED, BSET_DEATH, BSET_DELAYED, BSET_FFDEATH, BSET_FFIRE, BSET_FLEE, BSET_LOSTENEMY, BSET_PAIN, BSET_SPAWN, BSET_USE, BSET_VICTORY, gentity_s::fullName, G_DebugPrint(), g_entities, gentity_t, GetIDForString(), name, parms_t::parm, gentity_s::parms, SET_ANGERSCRIPT, SET_ANIM_BOTH, SET_ATTACKSCRIPT, SET_AWAKESCRIPT, SET_BLOCKEDSCRIPT, SET_CAMERA_GROUP, SET_CAMERA_GROUP_TAG, SET_CAPTIONTEXTCOLOR, SET_CAPTURE, SET_CENTERTEXTCOLOR, SET_COPY_ORIGIN, SET_DEATHSCRIPT, SET_DEFEND_TARGET, SET_DELAYEDSCRIPT, SET_ENEMY, SET_FFDEATHSCRIPT, SET_FFIRESCRIPT, SET_FLEESCRIPT, SET_FULLNAME, SET_ITEM, SET_LCARSTEXT, SET_LEADER, SET_LOADGAME, SET_LOCATION, SET_LOCKYAW, SET_LOOK_TARGET, SET_LOSTENEMYSCRIPT, SET_MUSIC_STATE, SET_NAVGOAL, SET_PAINSCRIPT, SET_PAINTARGET, SET_PARM1, SET_PARM10, SET_PARM11, SET_PARM12, SET_PARM13, SET_PARM14, SET_PARM15, SET_PARM16, SET_PARM2, SET_PARM3, SET_PARM4, SET_PARM5, SET_PARM6, SET_PARM7, SET_PARM8, SET_PARM9, SET_REMOVE_TARGET, SET_SCROLLTEXT, SET_SCROLLTEXTCOLOR, SET_SPAWNSCRIPT, SET_TARGET, SET_TARGET2, SET_TARGETNAME, SET_USESCRIPT, SET_VICTORYSCRIPT, SET_VIDEO_PLAY, SET_VIEWENTITY, SET_VIEWTARGET, SET_WATCHTARGET, SET_WEAPON, setTable, gentity_s::target, gentity_s::targetname, trap_ICARUS_GetStringVariable(), trap_ICARUS_VariableDeclared(), and WL_WARNING.

Referenced by vmMain().

01643 {
01644         gentity_t       *ent = &g_entities[entID];
01645         int toGet = 0;
01646         if ( !ent )
01647         {
01648                 return 0;
01649         }
01650 
01651         toGet = GetIDForString( setTable, name );       //FIXME: May want to make a "getTable" as well
01652 
01653         switch ( toGet )
01654         {
01655         case SET_ANIM_BOTH:
01656                 *value = (char *) Q3_GetAnimBoth( ent );
01657 
01658                 if ( !value || !value[0] )
01659                         return 0;
01660 
01661                 break;
01662 
01663         case SET_PARM1:
01664         case SET_PARM2:
01665         case SET_PARM3:
01666         case SET_PARM4:
01667         case SET_PARM5:
01668         case SET_PARM6:
01669         case SET_PARM7:
01670         case SET_PARM8:
01671         case SET_PARM9:
01672         case SET_PARM10:
01673         case SET_PARM11:
01674         case SET_PARM12:
01675         case SET_PARM13:
01676         case SET_PARM14:
01677         case SET_PARM15:
01678         case SET_PARM16:
01679                 if ( ent->parms )
01680                 {
01681                         *value = (char *) ent->parms->parm[toGet - SET_PARM1];
01682                 }
01683                 else
01684                 {
01685                         G_DebugPrint( WL_WARNING, "Q3_GetString: invalid ent %s has no parms!\n", ent->targetname );
01686                         return 0;
01687                 }
01688                 break;
01689 
01690         case SET_TARGET:
01691                 *value = (char *) ent->target;
01692                 break;
01693 
01694         case SET_LOCATION:
01695                 return 0;
01696                 break;
01697 
01698         //# #sep Scripts and other file paths
01699         case SET_SPAWNSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when spawned //0 - do not change these, these are equal to BSET_SPAWN, etc
01700                 *value = ent->behaviorSet[BSET_SPAWN];
01701                 break;
01702         case SET_USESCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when used
01703                 *value = ent->behaviorSet[BSET_USE];
01704                 break;
01705         case SET_AWAKESCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when startled
01706                 *value = ent->behaviorSet[BSET_AWAKE];
01707                 break;
01708         case SET_ANGERSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script run when find an enemy for the first time
01709                 *value = ent->behaviorSet[BSET_ANGER];
01710                 break;
01711         case SET_ATTACKSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when you shoot
01712                 *value = ent->behaviorSet[BSET_ATTACK];
01713                 break;
01714         case SET_VICTORYSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when killed someone
01715                 *value = ent->behaviorSet[BSET_VICTORY];
01716                 break;
01717         case SET_LOSTENEMYSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when you can't find your enemy
01718                 *value = ent->behaviorSet[BSET_LOSTENEMY];
01719                 break;
01720         case SET_PAINSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when hit
01721                 *value = ent->behaviorSet[BSET_PAIN];
01722                 break;
01723         case SET_FLEESCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when hit and low health
01724                 *value = ent->behaviorSet[BSET_FLEE];
01725                 break;
01726         case SET_DEATHSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when killed
01727                 *value = ent->behaviorSet[BSET_DEATH];
01728                 break;
01729         case SET_DELAYEDSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run after a delay
01730                 *value = ent->behaviorSet[BSET_DELAYED];
01731                 break;
01732         case SET_BLOCKEDSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when blocked by teammate
01733                 *value = ent->behaviorSet[BSET_BLOCKED];
01734                 break;
01735         case SET_FFIRESCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when player has shot own team repeatedly
01736                 *value = ent->behaviorSet[BSET_FFIRE];
01737                 break;
01738         case SET_FFDEATHSCRIPT://## %s="NULL" !!"W:\game\base\scripts\!!#*.txt" # Script to run when player kills a teammate
01739                 *value = ent->behaviorSet[BSET_FFDEATH];
01740                 break;
01741 
01742         //# #sep Standard strings
01743         case SET_ENEMY://## %s="NULL" # Set enemy by targetname
01744                 return 0;
01745                 break;
01746         case SET_LEADER://## %s="NULL" # Set for BS_FOLLOW_LEADER
01747                 return 0;
01748                 break;
01749         case SET_CAPTURE://## %s="NULL" # Set captureGoal by targetname
01750                 return 0;
01751                 break;
01752 
01753         case SET_TARGETNAME://## %s="NULL" # Set/change your targetname
01754                 *value = ent->targetname;
01755                 break;
01756         case SET_PAINTARGET://## %s="NULL" # Set/change what to use when hit
01757                 return 0;
01758                 break;
01759         case SET_CAMERA_GROUP://## %s="NULL" # all ents with this cameraGroup will be focused on
01760                 return 0;
01761                 break;
01762         case SET_CAMERA_GROUP_TAG://## %s="NULL" # all ents with this cameraGroup will be focused on
01763                 return 0;
01764                 break;
01765         case SET_LOOK_TARGET://## %s="NULL" # object for NPC to look at
01766                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_LOOK_TARGET, NOT SUPPORTED IN MULTIPLAYER\n" );
01767                 break;
01768         case SET_TARGET2://## %s="NULL" # Set/change your target2: on NPC's: this fires when they're knocked out by the red hypo
01769                 return 0;
01770                 break;
01771 
01772         case SET_REMOVE_TARGET://## %s="NULL" # Target that is fired when someone completes the BS_REMOVE behaviorState
01773                 return 0;
01774                 break;
01775         case SET_WEAPON:
01776                 return 0;
01777                 break;
01778 
01779         case SET_ITEM:
01780                 return 0;
01781                 break;
01782         case SET_MUSIC_STATE:
01783                 return 0;
01784                 break;
01785         //The below cannot be gotten
01786         case SET_NAVGOAL://## %s="NULL" # *Move to this navgoal then continue script
01787                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_NAVGOAL not implemented\n" );
01788                 return 0;
01789                 break;
01790         case SET_VIEWTARGET://## %s="NULL" # Set angles toward ent by targetname
01791                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_VIEWTARGET not implemented\n" );
01792                 return 0;
01793                 break;
01794         case SET_WATCHTARGET://## %s="NULL" # Set angles toward ent by targetname
01795                 return 0;
01796                 break;
01797         case SET_VIEWENTITY:
01798                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_VIEWENTITY not implemented\n" );
01799                 return 0;
01800                 break;
01801         case SET_CAPTIONTEXTCOLOR:      //## %s=""  # Color of text RED:WHITE:BLUE: YELLOW
01802                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_CAPTIONTEXTCOLOR not implemented\n" );
01803                 return 0;
01804                 break;
01805         case SET_CENTERTEXTCOLOR:       //## %s=""  # Color of text RED:WHITE:BLUE: YELLOW
01806                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_CENTERTEXTCOLOR not implemented\n" );
01807                 return 0;
01808                 break;
01809         case SET_SCROLLTEXTCOLOR:       //## %s=""  # Color of text RED:WHITE:BLUE: YELLOW
01810                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_SCROLLTEXTCOLOR not implemented\n" );
01811                 return 0;
01812                 break;
01813         case SET_COPY_ORIGIN://## %s="targetname"  # Copy the origin of the ent with targetname to your origin
01814                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_COPY_ORIGIN not implemented\n" );
01815                 return 0;
01816                 break;
01817         case SET_DEFEND_TARGET://## %s="targetname"  # This NPC will attack the target NPC's enemies
01818                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_COPY_ORIGIN not implemented\n" );
01819                 return 0;
01820                 break;
01821         case SET_VIDEO_PLAY://## %s="filename" !!"W:\game\base\video\!!#*.roq" # Play a Video (inGame)
01822                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_VIDEO_PLAY not implemented\n" );
01823                 return 0;
01824                 break;
01825         case SET_LOADGAME://## %s="exitholodeck" # Load the savegame that was auto-saved when you started the holodeck
01826                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_LOADGAME not implemented\n" );
01827                 return 0;
01828                 break;
01829         case SET_LOCKYAW://## %s="off"  # Lock legs to a certain yaw angle (or "off" or "auto" uses current)
01830                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_LOCKYAW not implemented\n" );
01831                 return 0;
01832                 break;
01833         case SET_SCROLLTEXT:    //## %s="" # key of text string to print
01834                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_SCROLLTEXT not implemented\n" );
01835                 return 0;
01836                 break;
01837         case SET_LCARSTEXT:     //## %s="" # key of text string to print in LCARS frame
01838                 G_DebugPrint( WL_WARNING, "Q3_GetString: SET_LCARSTEXT not implemented\n" );
01839                 return 0;
01840                 break;
01841 
01842         case SET_FULLNAME://## %s="NULL" # Set/change your targetname
01843                 *value = ent->fullName;
01844                 break;
01845         default:
01846 
01847                 if ( trap_ICARUS_VariableDeclared( name ) != VTYPE_STRING )
01848                         return 0;
01849 
01850                 return trap_ICARUS_GetStringVariable( name, (const char *) *value );
01851         }
01852 
01853         return 1;
01854 }

int Q3_GetTag int  entID,
const char *  name,
int  lookup,
vec3_t  info
 

Definition at line 948 of file g_ICARUScb.c.

References g_entities, gentity_t, gentity_s::inuse, name, gentity_s::ownername, TAG_GetAngles(), TAG_GetOrigin(), TYPE_ANGLES, TYPE_ORIGIN, and vec3_t.

Referenced by vmMain().

00949 {
00950         gentity_t       *ent = &g_entities[entID];
00951 
00952         if (!ent->inuse)
00953         {
00954                 assert(0);
00955                 return 0;
00956         }
00957 
00958         switch ( lookup )
00959         {
00960         case TYPE_ORIGIN:
00961                 return TAG_GetOrigin( ent->ownername, name, info );
00962                 break;
00963 
00964         case TYPE_ANGLES:
00965                 return TAG_GetAngles( ent->ownername, name, info );
00966                 break;  
00967         }
00968 
00969         return 0;
00970 }

int Q3_GetVector int  entID,
int  type,
const char *  name,
vec3_t  value
 

Definition at line 1573 of file g_ICARUScb.c.

References entityShared_t::currentAngles, entityShared_t::currentOrigin, G_DebugPrint(), g_entities, gentity_t, GetIDForString(), name, parms_t::parm, gentity_s::parms, gentity_s::r, SET_ANGLES, SET_ORIGIN, SET_PARM1, SET_PARM10, SET_PARM11, SET_PARM12, SET_PARM13, SET_PARM14, SET_PARM15, SET_PARM16, SET_PARM2, SET_PARM3, SET_PARM4, SET_PARM5, SET_PARM6, SET_PARM7, SET_PARM8, SET_PARM9, SET_TELEPORT_DEST, setTable, sscanf(), trap_ICARUS_GetVectorVariable(), trap_ICARUS_VariableDeclared(), vec3_t, VectorCopy, and WL_WARNING.

Referenced by vmMain().

01574 {
01575         gentity_t       *ent = &g_entities[entID];
01576         int toGet = 0;
01577         if ( !ent )
01578         {
01579                 return 0;
01580         }
01581 
01582         toGet = GetIDForString( setTable, name );       //FIXME: May want to make a "getTable" as well
01583         //FIXME: I'm getting really sick of these huge switch statements!
01584 
01585         //NOTENOTE: return true if the value was correctly obtained
01586         switch ( toGet )
01587         {
01588         case SET_PARM1:
01589         case SET_PARM2:
01590         case SET_PARM3:
01591         case SET_PARM4:
01592         case SET_PARM5:
01593         case SET_PARM6:
01594         case SET_PARM7:
01595         case SET_PARM8:
01596         case SET_PARM9:
01597         case SET_PARM10:
01598         case SET_PARM11:
01599         case SET_PARM12:
01600         case SET_PARM13:
01601         case SET_PARM14:
01602         case SET_PARM15:
01603         case SET_PARM16:
01604                 sscanf( ent->parms->parm[toGet - SET_PARM1], "%f %f %f", &value[0], &value[1], &value[2] );
01605                 break;
01606 
01607         case SET_ORIGIN:
01608                 VectorCopy(ent->r.currentOrigin, value);
01609                 break;
01610 
01611         case SET_ANGLES:
01612                 VectorCopy(ent->r.currentAngles, value);
01613                 break;
01614         
01615         case SET_TELEPORT_DEST://## %v="0.0 0.0 0.0" # Set origin here as soon as the area is clear
01616                 G_DebugPrint( WL_WARNING, "Q3_GetVector: SET_TELEPORT_DEST not implemented\n" );
01617                 return 0;
01618                 break;
01619 
01620         default:
01621 
01622                 if ( trap_ICARUS_VariableDeclared( name ) != VTYPE_VECTOR )
01623                         return 0;
01624 
01625                 return trap_ICARUS_GetVectorVariable( name, value );
01626         }
01627 
01628         return 1;
01629 }

void Q3_Kill int  entID,
const char *  name
 

Definition at line 1009 of file g_ICARUScb.c.

References gentity_s::client, gentity_s::die, gentity_s::enemy, FL_NO_KNOCKBACK, gentity_s::flags, FOFS, G_DebugPrint(), g_entities, G_Find(), gentity_t, gentity_s::health, MOD_UNKNOWN, name, NULL, Q_stricmp(), and WL_WARNING.

Referenced by vmMain().

01010 {
01011         gentity_t       *ent = &g_entities[entID];
01012         gentity_t       *victim = NULL;
01013         int                     o_health;
01014 
01015         if( !Q_stricmp( name, "self") )
01016         {
01017                 victim = ent;
01018         }
01019         else if( !Q_stricmp( name, "enemy" ) )
01020         {
01021                 victim = ent->enemy;
01022         }
01023         else
01024         {
01025                 victim = G_Find (NULL, FOFS(targetname), (char *) name );
01026         }
01027 
01028         if ( !victim )
01029         {
01030                 G_DebugPrint( WL_WARNING, "Q3_Kill: can't find %s\n", name);
01031                 return;
01032         }
01033 
01034         //rww - I guess this would only apply to NPCs anyway. I'm not going to bother.
01035         //if ( victim == ent )
01036         //{//don't ICARUS_FreeEnt me, I'm in the middle of a script!  (FIXME: shouldn't ICARUS handle this internally?)
01037         //      victim->svFlags |= SVF_KILLED_SELF;
01038         //}
01039 
01040         o_health = victim->health;
01041         victim->health = 0;
01042         if ( victim->client )
01043         {
01044                 victim->flags |= FL_NO_KNOCKBACK;
01045         }
01046         //G_SetEnemy(victim, ent);
01047         if( victim->die != NULL )       // check can be omitted
01048         {
01049                 //GEntity_DieFunc( victim, NULL, NULL, o_health, MOD_UNKNOWN );
01050                 victim->die(victim, victim, victim, o_health, MOD_UNKNOWN);
01051         }
01052 }

void Q3_Lerp2Angles int  taskID,
int  entID,
vec3_t  angles,
float  duration
 

Definition at line 892 of file g_ICARUScb.c.

References gentity_s::alt_fire, anglerCallback(), AngleSubtract(), entityState_s::apos, gentity_s::classname, gentity_s::client, entityShared_t::currentAngles, G_DebugPrint(), g_entities, gentity_t, level, gentity_s::nextthink, Q_stricmp(), gentity_s::r, gentity_s::s, gentity_s::think, TID_ANGLE_FACE, level_locals_t::time, TR_LINEAR_STOP, TR_NONLINEAR_STOP, trap_ICARUS_TaskIDSet(), trap_LinkEntity(), trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trDuration, trajectory_t::trTime, trajectory_t::trType, vec3_t, VectorCopy, WL_ERROR, and WL_WARNING.

Referenced by vmMain().

00893 {
00894         gentity_t       *ent = &g_entities[entID];
00895         vec3_t          ang;
00896         int                     i;
00897 
00898         if(!ent)
00899         {
00900                 G_DebugPrint( WL_WARNING, "Q3_Lerp2Angles: invalid entID %d\n", entID);
00901                 return;
00902         }
00903         
00904         if ( ent->client || Q_stricmp(ent->classname, "target_scriptrunner") == 0 )
00905         {
00906                 G_DebugPrint( WL_ERROR, "Q3_Lerp2Angles: ent %d is NOT a mover!\n", entID);
00907                 return;
00908         }
00909 
00910         //If we want an instant move, don't send 0...
00911         ent->s.apos.trDuration = (duration>0) ? duration : 1;
00912 
00913         for ( i = 0; i < 3; i++ )
00914         {
00915                 ang [i] = AngleSubtract( angles[i], ent->r.currentAngles[i]);
00916                 ent->s.apos.trDelta[i] = ( ang[i] / ( ent->s.apos.trDuration * 0.001f ) );
00917         }
00918 
00919         VectorCopy( ent->r.currentAngles, ent->s.apos.trBase );
00920 
00921         if ( ent->alt_fire )
00922         {
00923                 ent->s.apos.trType = TR_LINEAR_STOP;
00924         }
00925         else
00926         {
00927                 ent->s.apos.trType = TR_NONLINEAR_STOP;
00928         }
00929 
00930         ent->s.apos.trTime = level.time;
00931         
00932         trap_ICARUS_TaskIDSet( ent, TID_ANGLE_FACE, taskID );
00933 
00934         //ent->e_ReachedFunc = reachedF_NULL;
00935         ent->think = anglerCallback;
00936         ent->nextthink = level.time + duration;
00937 
00938         trap_LinkEntity( ent );
00939 }

void Q3_Lerp2End int  entID,
int  taskID,
float  duration
 

Definition at line 730 of file g_ICARUScb.c.

References gentity_s::blocked, Blocked_Mover(), BMS_START, gentity_s::classname, gentity_s::client, gentity_s::damage, ET_MOVER, entityState_s::eType, G_DebugPrint(), g_entities, G_PlayDoorLoopSound(), G_PlayDoorSound(), gentity_t, level, MOVER_1TO2, moverCallback(), gentity_s::moverState, entityState_s::pos, Q_stricmp(), gentity_s::reached, gentity_s::s, TID_MOVE_NAV, entityState_s::time, level_locals_t::time, trap_ICARUS_TaskIDSet(), trap_LinkEntity(), trajectory_t::trDuration, WL_ERROR, and WL_WARNING.

Referenced by vmMain().

00731 {
00732         gentity_t       *ent = &g_entities[entID];
00733 
00734         if(!ent)
00735         {
00736                 G_DebugPrint( WL_WARNING, "Q3_Lerp2End: invalid entID %d\n", entID);
00737                 return;
00738         }
00739         
00740         if ( ent->client || Q_stricmp(ent->classname, "target_scriptrunner") == 0 )
00741         {
00742                 G_DebugPrint( WL_ERROR, "Q3_Lerp2End: ent %d is NOT a mover!\n", entID);
00743                 return;
00744         }
00745 
00746         if ( ent->s.eType != ET_MOVER )
00747         {
00748                 ent->s.eType = ET_MOVER;
00749         }
00750 
00751         //FIXME: set up correctly!!!
00752         ent->moverState = MOVER_1TO2;
00753         ent->s.eType = ET_MOVER;
00754         ent->reached = moverCallback;           //Callsback the the completion of the move
00755         if ( ent->damage )
00756         {
00757                 ent->blocked = Blocked_Mover;
00758         }
00759 
00760         ent->s.pos.trDuration = duration * 10;  //In seconds
00761         ent->s.time = level.time;
00762         
00763         trap_ICARUS_TaskIDSet( ent, TID_MOVE_NAV, taskID );
00764         // starting sound
00765         G_PlayDoorLoopSound( ent );
00766         G_PlayDoorSound( ent, BMS_START );      //??
00767 
00768         trap_LinkEntity( ent );
00769 }

void Q3_Lerp2Origin int  taskID,
int  entID,
vec3_t  origin,
float  duration
 

Definition at line 2051 of file g_ICARUScb.c.

References gentity_s::blocked, Blocked_Mover(), BMS_START, gentity_s::classname, gentity_s::client, entityShared_t::currentOrigin, gentity_s::damage, ET_MOVER, entityState_s::eType, G_DebugPrint(), g_entities, G_PlayDoorLoopSound(), G_PlayDoorSound(), gentity_t, InitMoverTrData(), level, MatchTeam(), MOVER_1TO2, MOVER_2TO1, MOVER_POS1, MOVER_POS2, moverCallback(), gentity_s::moverState, moverState_t, entityState_s::pos, gentity_s::pos1, gentity_s::pos2, Q_stricmp(), gentity_s::r, gentity_s::reached, gentity_s::s, TID_MOVE_NAV, level_locals_t::time, trap_ICARUS_TaskIDSet(), trap_LinkEntity(), trajectory_t::trDuration, vec3_t, VectorCopy, WL_ERROR, and WL_WARNING.

Referenced by asteroid_field_think(), and vmMain().

02052 {
02053         gentity_t       *ent = &g_entities[entID];
02054         moverState_t moverState;
02055 
02056         if(!ent)
02057         {
02058                 G_DebugPrint( WL_WARNING, "Q3_Lerp2Origin: invalid entID %d\n", entID);
02059                 return;
02060         }
02061         
02062         if ( ent->client || Q_stricmp(ent->classname, "target_scriptrunner") == 0 )
02063         {
02064                 G_DebugPrint( WL_ERROR, "Q3_Lerp2Origin: ent %d is NOT a mover!\n", entID);
02065                 return;
02066         }
02067 
02068         if ( ent->s.eType != ET_MOVER )
02069         {
02070                 ent->s.eType = ET_MOVER;
02071         }
02072 
02073         moverState = ent->moverState;
02074 
02075         if ( moverState == MOVER_POS1 || moverState == MOVER_2TO1 )
02076         {
02077                 VectorCopy( ent->r.currentOrigin, ent->pos1 );
02078                 VectorCopy( origin, ent->pos2 );
02079 
02080                 moverState = MOVER_1TO2;
02081         }
02082         else if ( moverState == MOVER_POS2 || moverState == MOVER_1TO2 )
02083         {
02084                 VectorCopy( ent->r.currentOrigin, ent->pos2 );
02085                 VectorCopy( origin, ent->pos1 );
02086 
02087                 moverState = MOVER_2TO1;
02088         }
02089 
02090         InitMoverTrData( ent ); //FIXME: This will probably break normal things that are being moved...
02091 
02092         ent->s.pos.trDuration = duration;
02093 
02094         // start it going
02095         MatchTeam( ent, moverState, level.time );
02096         //SetMoverState( ent, moverState, level.time );
02097 
02098         ent->reached = moverCallback;
02099         if ( ent->damage )
02100         {
02101                 ent->blocked = Blocked_Mover;
02102         }
02103         if ( taskID != -1 )
02104         {
02105                 trap_ICARUS_TaskIDSet( ent, TID_MOVE_NAV, taskID );
02106         }
02107         // starting sound
02108         G_PlayDoorLoopSound( ent );//start looping sound
02109         G_PlayDoorSound( ent, BMS_START );      //play start sound
02110 
02111         trap_LinkEntity( ent );
02112 }

void Q3_Lerp2Pos int  taskID,
int  entID,
vec3_t  origin,
vec3_t  angles,
float  duration
 

Definition at line 781 of file g_ICARUScb.c.

References gentity_s::alt_fire, AngleDelta(), entityState_s::apos, gentity_s::blocked, Blocked_Mover(), BMS_START, gentity_s::classname, gentity_s::client, entityShared_t::currentAngles, entityShared_t::currentOrigin, gentity_s::damage, ET_MOVER, entityState_s::eType, G_DebugPrint(), g_entities, G_PlayDoorLoopSound(), G_PlayDoorSound(), gentity_t, InitMoverTrData(), level, MatchTeam(), moveAndRotateCallback(), MOVER_1TO2, MOVER_2TO1, MOVER_POS1, moverCallback(), gentity_s::moverState, moverState_t, NULL, entityState_s::pos, gentity_s::pos1, gentity_s::pos2, Q_stricmp(), gentity_s::r, gentity_s::reached, gentity_s::s, TID_ANGLE_FACE, TID_MOVE_NAV, level_locals_t::time, TR_LINEAR_STOP, TR_NONLINEAR_STOP, trap_ICARUS_TaskIDSet(), trap_LinkEntity(), trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trDuration, trajectory_t::trTime, trajectory_t::trType, vec3_t, VectorCopy, WL_ERROR, and WL_WARNING.

Referenced by vmMain().

00782 {
00783         gentity_t       *ent = &g_entities[entID];
00784         vec3_t          ang;
00785         int                     i;
00786         moverState_t moverState;
00787 
00788         if(!ent)
00789         {
00790                 G_DebugPrint( WL_WARNING, "Q3_Lerp2Pos: invalid entID %d\n", entID);
00791                 return;
00792         }
00793         
00794         if ( ent->client || Q_stricmp(ent->classname, "target_scriptrunner") == 0 )
00795         {
00796                 G_DebugPrint( WL_ERROR, "Q3_Lerp2Pos: ent %d is NOT a mover!\n", entID);
00797                 return;
00798         }
00799 
00800         if ( ent->s.eType != ET_MOVER )
00801         {
00802                 ent->s.eType = ET_MOVER;
00803         }
00804 
00805         //Don't allow a zero duration
00806         if ( duration == 0 )
00807                 duration = 1;
00808 
00809         //
00810         // Movement
00811 
00812         moverState = ent->moverState;
00813 
00814         if ( moverState == MOVER_POS1 || moverState == MOVER_2TO1 )
00815         {
00816                 VectorCopy( ent->r.currentOrigin, ent->pos1 );
00817                 VectorCopy( origin, ent->pos2 );
00818 
00819                 moverState = MOVER_1TO2;
00820         }
00821         else
00822         {
00823                 VectorCopy( ent->r.currentOrigin, ent->pos2 );
00824                 VectorCopy( origin, ent->pos1 );
00825 
00826                 moverState = MOVER_2TO1;
00827         }
00828 
00829         InitMoverTrData( ent );
00830 
00831         ent->s.pos.trDuration = duration;
00832 
00833         // start it going
00834         MatchTeam( ent, moverState, level.time );
00835         //SetMoverState( ent, moverState, level.time );
00836 
00837         //Only do the angles if specified
00838         if ( angles != NULL )
00839         {
00840                 //
00841                 // Rotation
00842 
00843                 for ( i = 0; i < 3; i++ )
00844                 {
00845                         ang[i] = AngleDelta( angles[i], ent->r.currentAngles[i] );
00846                         ent->s.apos.trDelta[i] = ( ang[i] / ( duration * 0.001f ) );
00847                 }
00848 
00849                 VectorCopy( ent->r.currentAngles, ent->s.apos.trBase );
00850 
00851                 if ( ent->alt_fire )
00852                 {
00853                         ent->s.apos.trType = TR_LINEAR_STOP;
00854                 }
00855                 else
00856                 {
00857                         ent->s.apos.trType = TR_NONLINEAR_STOP;
00858                 }
00859                 ent->s.apos.trDuration = duration;
00860 
00861                 ent->s.apos.trTime = level.time;
00862 
00863                 ent->reached = moveAndRotateCallback;
00864                 trap_ICARUS_TaskIDSet( ent, TID_ANGLE_FACE, taskID );
00865         }
00866         else
00867         {
00868                 //Setup the last bits of information
00869                 ent->reached = moverCallback;
00870         }
00871 
00872         if ( ent->damage )
00873         {
00874                 ent->blocked = Blocked_Mover;
00875         }
00876 
00877         trap_ICARUS_TaskIDSet( ent, TID_MOVE_NAV, taskID );
00878         // starting sound
00879         G_PlayDoorLoopSound( ent );
00880         G_PlayDoorSound( ent, BMS_START );      //??
00881 
00882         trap_LinkEntity( ent );
00883 }

void Q3_Lerp2Start int  entID,
int  taskID,
float  duration
 

Definition at line 682 of file g_ICARUScb.c.

References gentity_s::blocked, Blocked_Mover(), BMS_START, gentity_s::classname, gentity_s::client, gentity_s::damage, ET_MOVER, entityState_s::eType, G_DebugPrint(), g_entities, G_PlayDoorLoopSound(), G_PlayDoorSound(), gentity_t, level, MOVER_2TO1, moverCallback(), gentity_s::moverState, entityState_s::pos, Q_stricmp(), gentity_s::reached, gentity_s::s, TID_MOVE_NAV, level_locals_t::time, trap_ICARUS_TaskIDSet(), trap_LinkEntity(), trajectory_t::trDuration, trajectory_t::trTime, WL_ERROR, and WL_WARNING.

Referenced by vmMain().

00683 {
00684         gentity_t       *ent = &g_entities[entID];
00685 
00686         if(!ent)
00687         {       
00688                 G_DebugPrint( WL_WARNING, "Q3_Lerp2Start: invalid entID %d\n", entID);
00689                 return;
00690         }
00691         
00692         if ( ent->client || Q_stricmp(ent->classname, "target_scriptrunner") == 0 )
00693         {
00694                 G_DebugPrint( WL_ERROR, "Q3_Lerp2Start: ent %d is NOT a mover!\n", entID);
00695                 return;
00696         }
00697 
00698         if ( ent->s.eType != ET_MOVER )
00699         {
00700                 ent->s.eType = ET_MOVER;
00701         }
00702 
00703         //FIXME: set up correctly!!!
00704         ent->moverState = MOVER_2TO1;
00705         ent->s.eType = ET_MOVER;
00706         ent->reached = moverCallback;           //Callsback the the completion of the move
00707         if ( ent->damage )
00708         {
00709                 ent->blocked = Blocked_Mover;
00710         }
00711 
00712         ent->s.pos.trDuration = duration * 10;  //In seconds
00713         ent->s.pos.trTime = level.time;
00714         
00715         trap_ICARUS_TaskIDSet( ent, TID_MOVE_NAV, taskID );
00716         // starting sound
00717         G_PlayDoorLoopSound( ent );
00718         G_PlayDoorSound( ent, BMS_START );      //??
00719 
00720         trap_LinkEntity( ent );
00721 }

void Q3_Play int  taskID,
int  entID,
const char *  type,
const char *  name
 

Definition at line 527 of file g_ICARUScb.c.

References entityState_s::angles2, entityShared_t::currentAngles, entityShared_t::currentOrigin, g_entities, G_NewString(), gentity_t, name, entityState_s::number, entityState_s::origin2, Q_stricmp(), qtrue, gentity_s::r, gentity_s::roffid, gentity_s::roffname, gentity_s::s, TID_MOVE_NAV, trap_ICARUS_TaskIDSet(), trap_LinkEntity(), trap_ROFF_Cache(), trap_ROFF_Play(), and VectorCopy.

Referenced by vmMain().

00528 {
00529         gentity_t *ent = &g_entities[entID];
00530 
00531         if ( !Q_stricmp( type, "PLAY_ROFF" ) )
00532         {
00533                 // Try to load the requested ROFF
00534                 ent->roffid = trap_ROFF_Cache((char*)name);
00535                 if ( ent->roffid )
00536                 {
00537                         ent->roffname = G_NewString( name );
00538 
00539                         // Start the roff from the beginning
00540                         //ent->roff_ctr = 0;
00541 
00542                         //Save this off for later
00543                         trap_ICARUS_TaskIDSet( ent, TID_MOVE_NAV, taskID );
00544 
00545                         // Let the ROFF playing start.
00546                         //ent->next_roff_time = level.time;
00547 
00548                         //rww - Maybe use pos1 and pos2? I don't think we need to care if these values are sent across the net.
00549                         // These need to be initialised up front...
00550                         //VectorCopy( ent->r.currentOrigin, ent->pos1 );
00551                         //VectorCopy( ent->r.currentAngles, ent->pos2 );
00552                         VectorCopy( ent->r.currentOrigin, ent->s.origin2 );
00553                         VectorCopy( ent->r.currentAngles, ent->s.angles2 );
00554                         
00555                         trap_LinkEntity( ent );
00556 
00557                         trap_ROFF_Play(ent->s.number, ent->roffid, qtrue);
00558                 }
00559         }
00560 }

int Q3_PlaySound int  taskID,
int  entID,
const char *  name,
const char *  channel
 

Definition at line 400 of file g_ICARUScb.c.

References atof(), CHAN_AUTO, CHAN_VOICE, gentity_s::classname, COM_StripExtension(), entityShared_t::currentOrigin, EV_GLOBAL_SOUND, entityState_s::eventParm, g_entities, G_Sound(), G_SoundIndex(), G_TempEntity(), gentity_t, MAX_QPATH, name, Q_stricmp(), Q_strncpyz(), Q_strupr(), qboolean, qfalse, qtrue, gentity_s::r, gentity_s::s, soundChannel_t, SVF_BROADCAST, entityShared_t::svFlags, TID_CHAN_VOICE, trap_Cvar_VariableStringBuffer(), and trap_ICARUS_TaskIDSet().

Referenced by vmMain().

00401 {
00402         gentity_t               *ent = &g_entities[entID];
00403         char                    finalName[MAX_QPATH];
00404         soundChannel_t  voice_chan = CHAN_VOICE; // set a default so the compiler doesn't bitch
00405         qboolean                type_voice = qfalse;
00406         int                             soundHandle;
00407         qboolean                bBroadcast;
00408 
00409         Q_strncpyz( finalName, name, MAX_QPATH );
00410         Q_strupr(finalName);
00411         //G_AddSexToMunroString( finalName, qtrue );
00412 
00413         COM_StripExtension( (const char *)finalName, finalName );
00414 
00415         soundHandle = G_SoundIndex( (char *) finalName );
00416         bBroadcast = qfalse;
00417 
00418         if ( ( Q_stricmp( channel, "CHAN_ANNOUNCER" ) == 0 ) || (ent->classname && Q_stricmp("target_scriptrunner", ent->classname ) == 0) ) {
00419                 bBroadcast = qtrue;
00420         }
00421 
00422 
00423         // moved here from further down so I can easily check channel-type without code dup...
00424         //
00425         if ( Q_stricmp( channel, "CHAN_VOICE" ) == 0 )
00426         {
00427                 voice_chan = CHAN_VOICE;
00428                 type_voice = qtrue;
00429         }
00430         else if ( Q_stricmp( channel, "CHAN_VOICE_ATTEN" ) == 0 )
00431         {
00432                 voice_chan = CHAN_AUTO;//CHAN_VOICE_ATTEN;
00433                 type_voice = qtrue;
00434         }
00435         else if ( Q_stricmp( channel, "CHAN_VOICE_GLOBAL" ) == 0 ) // this should broadcast to everyone, put only casue animation on G_SoundOnEnt...
00436         {
00437                 voice_chan = CHAN_AUTO;//CHAN_VOICE_GLOBAL;
00438                 type_voice = qtrue;
00439                 bBroadcast = qtrue;
00440         }
00441 
00442         // if we're in-camera, check for skipping cinematic and ifso, no subtitle print (since screen is not being
00443         //      updated anyway during skipping). This stops leftover subtitles being left onscreen after unskipping.
00444         //
00445         /*
00446         if (!in_camera ||
00447                 (!g_skippingcin || !g_skippingcin->integer)
00448                 )       // paranoia towards project end <g>
00449         {
00450                 // Text on
00451                 // certain NPC's we always want to use subtitles regardless of subtitle setting
00452                 if (g_subtitles->integer == 1 || (ent->NPC && (ent->NPC->scriptFlags & SCF_USE_SUBTITLES) ) ) // Show all text
00453                 {
00454                         if ( in_camera) // Cinematic
00455                         {                                       
00456                                 trap_SendServerCommand( -1, va("ct \"%s\" %i", finalName, soundHandle) );
00457                         }
00458                         else //if (precacheWav[i].speaker==SP_NONE)     //  lower screen text
00459                         {
00460                                 sharedEntity_t          *ent2 = SV_GentityNum(0);
00461                                 // the numbers in here were either the original ones Bob entered (350), or one arrived at from checking the distance Chell stands at in stasis2 by the computer core that was submitted as a bug report...
00462                                 //
00463                                 if (bBroadcast || (DistanceSquared(ent->currentOrigin, ent2->currentOrigin) < ((voice_chan == CHAN_VOICE_ATTEN)?(350 * 350):(1200 * 1200)) ) )
00464                                 {
00465                                         trap_SendServerCommand( -1, va("ct \"%s\" %i", finalName, soundHandle) );
00466                                 }
00467                         }
00468                 }
00469                 // Cinematic only
00470                 else if (g_subtitles->integer == 2) // Show only talking head text and CINEMATIC
00471                 {
00472                         if ( in_camera) // Cinematic text
00473                         {                                                       
00474                                 trap_SendServerCommand( -1, va("ct \"%s\" %i", finalName, soundHandle));
00475                         }
00476                 }
00477 
00478         }
00479         */
00480 
00481         if ( type_voice )
00482         {
00483                 char buf[128];
00484                 float tFVal = 0;
00485 
00486                 trap_Cvar_VariableStringBuffer("timescale", buf, sizeof(buf));
00487 
00488                 tFVal = atof(buf);
00489 
00490 
00491                 if ( tFVal > 1.0f )
00492                 {//Skip the damn sound!
00493                         return qtrue;
00494                 }
00495                 else
00496                 {
00497                         //This the voice channel
00498                         G_Sound( ent, voice_chan, G_SoundIndex((char *) finalName) );
00499                 }
00500                 //Remember we're waiting for this
00501                 trap_ICARUS_TaskIDSet( ent, TID_CHAN_VOICE, taskID );
00502 
00503                 return qfalse;
00504         }
00505 
00506         if ( bBroadcast )
00507         {//Broadcast the sound
00508                 gentity_t       *te;
00509 
00510                 te = G_TempEntity( ent->r.currentOrigin, EV_GLOBAL_SOUND );
00511                 te->s.eventParm = soundHandle;
00512                 te->r.svFlags |= SVF_BROADCAST;
00513         }
00514         else
00515         {
00516                 G_Sound( ent, CHAN_AUTO, soundHandle );
00517         }
00518 
00519         return qtrue;
00520 }

void Q3_Remove int  entID,
const char *  name
 

Definition at line 1128 of file g_ICARUScb.c.

References gentity_s::enemy, FOFS, G_DebugPrint(), g_entities, G_Find(), gentity_t, name, NULL, Q3_RemoveEnt(), Q_stricmp(), and WL_WARNING.

Referenced by vmMain().

01129 {
01130         gentity_t *ent = &g_entities[entID];
01131         gentity_t       *victim = NULL;
01132 
01133         if( !Q_stricmp( "self", name ) )
01134         {
01135                 victim = ent;
01136                 if ( !victim )
01137                 {
01138                         G_DebugPrint( WL_WARNING, "Q3_Remove: can't find %s\n", name );
01139                         return;
01140                 }
01141                 Q3_RemoveEnt( victim );
01142         }
01143         else if( !Q_stricmp( "enemy", name ) )
01144         {
01145                 victim = ent->enemy;
01146                 if ( !victim )
01147                 {
01148                         G_DebugPrint( WL_WARNING, "Q3_Remove: can't find %s\n", name );
01149                         return;
01150                 }
01151                 Q3_RemoveEnt( victim );
01152         }
01153         else
01154         {
01155                 victim = G_Find( NULL, FOFS(targetname), (char *) name );
01156                 if ( !victim )
01157                 {
01158                         G_DebugPrint( WL_WARNING, "Q3_Remove: can't find %s\n", name );
01159                         return;
01160                 }
01161 
01162                 while ( victim )
01163                 {
01164                         Q3_RemoveEnt( victim );
01165                         victim = G_Find( victim, FOFS(targetname), (char *) name );
01166                 }
01167         }
01168 }

void Q3_RemoveEnt gentity_t victim  ) 
 

Definition at line 1062 of file g_ICARUScb.c.

References CLASS_VEHICLE, gentity_s::client, vehicleInfo_t::EjectAll, ET_NPC, entityState_s::eType, G_DebugPrint(), G_FreeEntity(), gentity_t, level, gentity_s::m_pVehicle, Vehicle_s::m_pVehicleInfo, gentity_s::nextthink, gclient_s::NPC_class, gentity_s::s, gentity_s::think, level_locals_t::time, Vehicle_t, and WL_WARNING.

Referenced by Q3_Remove().

01063 {
01064         if( victim->client )
01065         {
01066                 if ( victim->s.eType != ET_NPC )
01067                 {
01068                         G_DebugPrint( WL_WARNING, "Q3_RemoveEnt: You can't remove clients in MP!\n" );
01069                         assert(0); //can't remove clients in MP
01070                 }
01071                 else
01072                 {//remove the NPC
01073                         if ( victim->client->NPC_class == CLASS_VEHICLE )
01074                         {//eject everyone out of a vehicle that's about to remove itself
01075                                 Vehicle_t *pVeh = victim->m_pVehicle;
01076                                 if ( pVeh && pVeh->m_pVehicleInfo )
01077                                 {
01078                                         pVeh->m_pVehicleInfo->EjectAll( pVeh );
01079                                 }
01080                         }
01081                         victim->think = G_FreeEntity;
01082                         victim->nextthink = level.time + 100;
01083                 }
01084                 /*
01085                 //ClientDisconnect(ent);
01086                 victim->s.eFlags |= EF_NODRAW;
01087                 victim->s.eType = ET_INVISIBLE;
01088                 victim->contents = 0;
01089                 victim->health = 0;
01090                 victim->targetname = NULL;
01091 
01092                 if ( victim->NPC && victim->NPC->tempGoal != NULL )
01093                 {
01094                         G_FreeEntity( victim->NPC->tempGoal );
01095                         victim->NPC->tempGoal = NULL;
01096                 }
01097                 if ( victim->client->ps.saberEntityNum != ENTITYNUM_NONE && victim->client->ps.saberEntityNum > 0 )
01098                 {
01099                         if ( g_entities[victim->client->ps.saberEntityNum].inuse )
01100                         {
01101                                 G_FreeEntity( &g_entities[victim->client->ps.saberEntityNum] );
01102                         }
01103                         victim->client->ps.saberEntityNum = ENTITYNUM_NONE;
01104                 }
01105                 //Disappear in half a second
01106                 victim->e_ThinkFunc = thinkF_G_FreeEntity;
01107                 victim->nextthink = level.time + 500;
01108                 return;
01109                 */
01110         }
01111         else
01112         {
01113                 victim->think = G_FreeEntity;
01114                 victim->nextthink = level.time + 100;
01115         }
01116 }

qboolean Q3_Set int  taskID,
int  entID,
const char *  type_name,
const char *  data
 

Definition at line 5004 of file g_ICARUScb.c.

References atof(), atoi(), gentity_s::classname, G_DebugPrint(), g_entities, G_SetOrigin(), gentity_t, GetIDForString(), LockDoors(), entityState_s::origin, Q3_SetICARUSFreeze(), Q3_SetLoopSound(), Q3_SetParm(), Q3_SetViewEntity(), Q3_TaskIDClear(), Q_stricmp(), Q_strncmp(), qboolean, qfalse, qtrue, gentity_s::s, SET_ADDLHANDBOLT_MODEL, SET_ADDRHANDBOLT_MODEL, SET_ADJUST_AREA_PORTALS, SET_AGGRESSION, SET_AIM, SET_ALT_FIRE, SET_ANGERSCRIPT, SET_ANGLES, SET_ANIM_BOTH, SET_ANIM_HOLDTIME_BOTH, SET_ANIM_HOLDTIME_LOWER, SET_ANIM_HOLDTIME_UPPER, SET_ANIM_LOWER, SET_ANIM_UPPER, SET_ANIMFRAME, SET_ARMOR, SET_ATTACKSCRIPT, SET_AWAKESCRIPT, SET_BEHAVIOR_STATE, SET_BLOCKEDSCRIPT, SET_CAMERA_GROUP, SET_CAMERA_GROUP_TAG, SET_CAMERA_GROUP_Z_OFS, SET_CAPTIONTEXTCOLOR, SET_CAPTURE, SET_CENTERTEXTCOLOR, SET_CHASE_ENEMIES, SET_CINEMATIC_SKIPSCRIPT, SET_CLEAN_DAMAGING_ENTS, SET_CLOSINGCREDITS, SET_COPY_ORIGIN, SET_COUNT, SET_CROUCHED, SET_DEATHSCRIPT, SET_DEFAULT_BSTATE, SET_DEFEND_TARGET, SET_DELAYEDSCRIPT, SET_DELAYSCRIPTTIME, SET_DISABLE_SHADER_ANIM, SET_DISMEMBERABLE, SET_DMG_BY_HEAVY_WEAP_ONLY, SET_DONT_FLEE, SET_DONTFIRE, SET_DONTSHOOT, SET_DPITCH, SET_DYAW, SET_EARSHOT, SET_END_SCREENDISSOLVE, SET_ENDFRAME, SET_ENEMY, SET_ENEMY_TEAM, SET_EVENT, SET_FACE_MOVE_DIR, SET_FACEAUX, SET_FACEBLINK, SET_FACEBLINKFROWN, SET_FACEEYESCLOSED, SET_FACEEYESOPENED, SET_FACEFROWN, SET_FACENORMAL, SET_FFDEATHSCRIPT, SET_FFIRESCRIPT, SET_FIRE_WEAPON, SET_FLEESCRIPT, SET_FOLLOWDIST, SET_FORCE_GRIP_LEVEL, SET_FORCE_HEAL_LEVEL, SET_FORCE_INVINCIBLE, SET_FORCE_JUMP_LEVEL, SET_FORCE_LIGHTNING_LEVEL, SET_FORCE_MINDTRICK_LEVEL, SET_FORCE_PULL_LEVEL, SET_FORCE_PUSH_LEVEL, SET_FORCE_SPEED_LEVEL, SET_FORCED_MARCH, SET_FORWARDMOVE, SET_FRICTION, SET_FULLNAME, SET_FUNC_USABLE_VISIBLE, SET_GRAVITY, SET_GREET_ALLIES, SET_HEALTH, SET_HFOV, SET_HUD, SET_ICARUS_FREEZE, SET_ICARUS_UNFREEZE, SET_IGNOREALERTS, SET_IGNOREENEMIES, SET_IGNOREPAIN, SET_INACTIVE, SET_INTERFACE, SET_INVINCIBLE, SET_INVISIBLE, SET_ITEM, SET_LCARSTEXT, SET_LEADER, SET_LEAN, SET_LOADGAME, SET_LOCATION, SET_LOCK_PLAYER_WEAPONS, SET_LOCKED_ENEMY, SET_LOCKYAW, SET_LOOK_FOR_ENEMIES, SET_LOOK_TARGET, SET_LOOP_ANIM, SET_LOOPSOUND, SET_MENU_SCREEN, SET_MINDTRICKSCRIPT, SET_MISSION_STATUS_SCREEN, SET_MISSIONFAILED, SET_MISSIONSTATUSTEXT, SET_MISSIONSTATUSTIME, SET_MORELIGHT, SET_MUSIC_STATE, SET_NAVGOAL, SET_NO_ACROBATICS, SET_NO_ALERT_TALK, SET_NO_COMBAT_TALK, SET_NO_FALLTODEATH, SET_NO_FORCE, SET_NO_GROUPS, SET_NO_IMPACT_DAMAGE, SET_NO_KNOCKBACK, SET_NO_MINDTRICK, SET_NO_RESPONSE, SET_NOAVOID, SET_NOTARGET, SET_OBJECTIVE_CLEARALL, SET_OBJECTIVE_FAILED, SET_OBJECTIVE_HIDE, SET_OBJECTIVE_SHOW, SET_OBJECTIVE_SUCCEEDED, SET_ORIGIN, SET_PAINSCRIPT, SET_PAINTARGET, SET_PARM1, SET_PARM10, SET_PARM11, SET_PARM12, SET_PARM13, SET_PARM14, SET_PARM15, SET_PARM16, SET_PARM2, SET_PARM3, SET_PARM4, SET_PARM5, SET_PARM6, SET_PARM7, SET_PARM8, SET_PARM9, SET_PLAYER_LOCKED, SET_PLAYER_TEAM, SET_PLAYER_USABLE, SET_REMOVE_TARGET, SET_REMOVELHANDBOLT_MODEL, SET_REMOVERHANDBOLT_MODEL, SET_RIGHTMOVE, SET_RUNNING, SET_RUNSPEED, SET_SABER_DEFENSE, SET_SABER_OFFENSE, SET_SABER_THROW, SET_SABERACTIVE, SET_SCALE, SET_SCROLLTEXT, SET_SCROLLTEXTCOLOR, SET_SHADER_ANIM, SET_SHIELDED, SET_SHIELDS, SET_SHOOTDIST, SET_SHOT_SPACING, SET_SKILL, SET_SOLID, SET_SPAWNSCRIPT, SET_STARTFRAME, SET_TARGET, SET_TARGET2, SET_TARGETNAME, SET_TELEPORT_DEST, SET_TEMP_BSTATE, SET_TIMESCALE, SET_TREASONED, SET_UNDYING, SET_USE_CP_NEAREST, SET_USE_SUBTITLES, SET_USESCRIPT, SET_VAMPIRE, SET_VFOV, SET_VICTORYSCRIPT, SET_VIDEO_FADE_IN, SET_VIDEO_FADE_OUT, SET_VIDEO_PLAY, SET_VIEWENTITY, SET_VIEWTARGET, SET_VIGILANCE, SET_VISRANGE, SET_WAIT, SET_WALKING, SET_WALKSPEED, SET_WATCHTARGET, SET_WEAPON, SET_WIDTH, SET_XVELOCITY, SET_YAWSPEED, SET_YVELOCITY, SET_Z_OFFSET, SET_ZVELOCITY, setTable, sscanf(), gentity_s::targetname, gentity_s::taskID, TID_ANGLE_FACE, TID_ANIM_BOTH, TID_ANIM_LOWER, TID_ANIM_UPPER, TID_BSTATE, TID_LOCATION, TID_MOVE_NAV, TID_RESIZE, trap_ICARUS_SetVar(), trap_ICARUS_TaskIDSet(), UnLockDoors(), vec3_t, VectorCopy, WL_ERROR, WL_VERBOSE, and WL_WARNING.

Referenced by vmMain().

05005 {
05006         gentity_t       *ent = &g_entities[entID];
05007         float           float_data;
05008         int                     int_data, toSet;
05009         vec3_t          vector_data;
05010 
05011         //Set this for callbacks
05012         toSet = GetIDForString( setTable, type_name );
05013 
05014         //TODO: Throw in a showscript command that will list each command and what they're doing...
05015         //              maybe as simple as printing that line of the script to the console preceeded by the person's name?
05016         //              showscript can take any number of targetnames or "all"?  Groupname?
05017         switch ( toSet )
05018         {
05019         case SET_ORIGIN:
05020                 sscanf( data, "%f %f %f", &vector_data[0], &vector_data[1], &vector_data[2] );
05021                 G_SetOrigin( ent, vector_data );
05022                 if ( Q_strncmp( "NPC_", ent->classname, 4 ) == 0 )
05023                 {//hack for moving spawners
05024                         VectorCopy( vector_data, ent->s.origin);
05025                 }
05026                 break;
05027 
05028         case SET_TELEPORT_DEST:
05029                 sscanf( data, "%f %f %f", &vector_data[0], &vector_data[1], &vector_data[2] );
05030                 if ( !Q3_SetTeleportDest( entID, vector_data ) )
05031                 {
05032                         trap_ICARUS_TaskIDSet( ent, TID_MOVE_NAV, taskID );
05033                         return qfalse;
05034                 }
05035                 break;
05036 
05037         case SET_COPY_ORIGIN:
05038                 Q3_SetCopyOrigin( entID, (char *) data );
05039                 break;
05040 
05041         case SET_ANGLES:
05042                 //Q3_SetAngles( entID, *(vec3_t *) data);
05043                 sscanf( data, "%f %f %f", &vector_data[0], &vector_data[1], &vector_data[2] );
05044                 Q3_SetAngles( entID, vector_data);
05045                 break;
05046 
05047         case SET_XVELOCITY:
05048                 float_data = atof((char *) data);
05049                 Q3_SetVelocity( entID, 0, float_data);
05050                 break;
05051         
05052         case SET_YVELOCITY:
05053                 float_data = atof((char *) data);
05054                 Q3_SetVelocity( entID, 1, float_data);
05055                 break;
05056 
05057         case SET_ZVELOCITY:
05058                 float_data = atof((char *) data);
05059                 Q3_SetVelocity( entID, 2, float_data);
05060                 break;
05061 
05062         case SET_Z_OFFSET:
05063                 float_data = atof((char *) data);
05064                 Q3_SetOriginOffset( entID, 2, float_data);
05065                 break;
05066 
05067         case SET_ENEMY:
05068                 Q3_SetEnemy( entID, (char *) data );
05069                 break;
05070 
05071         case SET_LEADER:
05072                 Q3_SetLeader( entID, (char *) data );
05073                 break;
05074 
05075         case SET_NAVGOAL:
05076                 if ( Q3_SetNavGoal( entID, (char *) data ) )
05077                 {
05078                         trap_ICARUS_TaskIDSet( ent, TID_MOVE_NAV, taskID );
05079                         return qfalse;  //Don't call it back
05080                 }
05081                 break;
05082 
05083         case SET_ANIM_UPPER:
05084                 if ( Q3_SetAnimUpper( entID, (char *) data ) )
05085                 {
05086                         Q3_TaskIDClear( &ent->taskID[TID_ANIM_BOTH] );//We only want to wait for the top
05087                         trap_ICARUS_TaskIDSet( ent, TID_ANIM_UPPER, taskID );
05088                         return qfalse;  //Don't call it back
05089                 }
05090                 break;
05091 
05092         case SET_ANIM_LOWER:
05093                 if ( Q3_SetAnimLower( entID, (char *) data ) )
05094                 {
05095                         Q3_TaskIDClear( &ent->taskID[TID_ANIM_BOTH] );//We only want to wait for the bottom
05096                         trap_ICARUS_TaskIDSet( ent, TID_ANIM_LOWER, taskID );
05097                         return qfalse;  //Don't call it back
05098                 }
05099                 break;
05100 
05101         case SET_ANIM_BOTH:
05102                 {
05103                         int     both = 0;
05104                         if ( Q3_SetAnimUpper( entID, (char *) data ) )
05105                         {
05106                                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_UPPER, taskID );
05107                                 both++;
05108                         }
05109                         else
05110                         {
05111                                 G_DebugPrint( WL_ERROR, "Q3_SetAnimUpper: %s does not have anim %s!\n", ent->targetname, (char *)data );
05112                         }
05113                         if ( Q3_SetAnimLower( entID, (char *) data ) )
05114                         {
05115                                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_LOWER, taskID );
05116                                 both++;
05117                         }
05118                         else
05119                         {
05120                                 G_DebugPrint( WL_ERROR, "Q3_SetAnimLower: %s does not have anim %s!\n", ent->targetname, (char *)data );
05121                         }
05122                         if ( both >= 2 )
05123                         {
05124                                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_BOTH, taskID );
05125                         }
05126                         if ( both )
05127                         {
05128                                 return qfalse;  //Don't call it back
05129                         }
05130                 }
05131                 break;
05132         
05133         case SET_ANIM_HOLDTIME_LOWER:
05134                 int_data = atoi((char *) data);
05135                 Q3_SetAnimHoldTime( entID, int_data, qtrue );
05136                 Q3_TaskIDClear( &ent->taskID[TID_ANIM_BOTH] );//We only want to wait for the bottom
05137                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_LOWER, taskID );
05138                 return qfalse;  //Don't call it back
05139                 break;
05140 
05141         case SET_ANIM_HOLDTIME_UPPER:
05142                 int_data = atoi((char *) data);
05143                 Q3_SetAnimHoldTime( entID, int_data, qfalse );
05144                 Q3_TaskIDClear( &ent->taskID[TID_ANIM_BOTH] );//We only want to wait for the top
05145                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_UPPER, taskID );
05146                 return qfalse;  //Don't call it back
05147                 break;
05148 
05149         case SET_ANIM_HOLDTIME_BOTH:
05150                 int_data = atoi((char *) data);
05151                 Q3_SetAnimHoldTime( entID, int_data, qfalse );
05152                 Q3_SetAnimHoldTime( entID, int_data, qtrue );
05153                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_BOTH, taskID );
05154                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_UPPER, taskID );
05155                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_LOWER, taskID );
05156                 return qfalse;  //Don't call it back
05157                 break;
05158 
05159         case SET_PLAYER_TEAM:
05160                 G_DebugPrint( WL_WARNING, "Q3_SetPlayerTeam: Not in MP ATM, let a programmer (ideally Rich) know if you need it\n");
05161                 break;
05162 
05163         case SET_ENEMY_TEAM:
05164                 G_DebugPrint( WL_WARNING, "Q3_SetEnemyTeam: NOT SUPPORTED IN MP\n");
05165                 break;
05166 
05167         case SET_HEALTH:
05168                 int_data = atoi((char *) data);
05169                 Q3_SetHealth( entID, int_data );
05170                 break;
05171 
05172         case SET_ARMOR:
05173                 int_data = atoi((char *) data);
05174                 Q3_SetArmor( entID, int_data );
05175                 break;
05176 
05177         case SET_BEHAVIOR_STATE:
05178                 if( !Q3_SetBState( entID, (char *) data ) )
05179                 {
05180                         trap_ICARUS_TaskIDSet( ent, TID_BSTATE, taskID );
05181                         return qfalse;//don't complete
05182                 }
05183                 break;
05184 
05185         case SET_DEFAULT_BSTATE:
05186                 Q3_SetDefaultBState( entID, (char *) data );
05187                 break;
05188 
05189         case SET_TEMP_BSTATE:
05190                 if( !Q3_SetTempBState( entID, (char *) data ) )
05191                 {
05192                         trap_ICARUS_TaskIDSet( ent, TID_BSTATE, taskID );
05193                         return qfalse;//don't complete
05194                 }
05195                 break;
05196 
05197         case SET_CAPTURE:
05198                 Q3_SetCaptureGoal( entID, (char *) data );
05199                 break;
05200 
05201         case SET_DPITCH://FIXME: make these set tempBehavior to BS_FACE and await completion?  Or set lockedDesiredPitch/Yaw and aimTime?
05202                 float_data = atof((char *) data);
05203                 Q3_SetDPitch( entID, float_data );
05204                 trap_ICARUS_TaskIDSet( ent, TID_ANGLE_FACE, taskID );
05205                 return qfalse;
05206                 break;
05207 
05208         case SET_DYAW:
05209                 float_data = atof((char *) data);
05210                 Q3_SetDYaw( entID, float_data );
05211                 trap_ICARUS_TaskIDSet( ent, TID_ANGLE_FACE, taskID );
05212                 return qfalse;
05213                 break;
05214 
05215         case SET_EVENT:
05216                 Q3_SetEvent( entID, (char *) data );
05217                 break;
05218 
05219         case SET_VIEWTARGET:
05220                 Q3_SetViewTarget( entID, (char *) data );
05221                 trap_ICARUS_TaskIDSet( ent, TID_ANGLE_FACE, taskID );
05222                 return qfalse;
05223                 break;
05224 
05225         case SET_WATCHTARGET:
05226                 Q3_SetWatchTarget( entID, (char *) data );
05227                 break;
05228 
05229         case SET_VIEWENTITY:
05230                 Q3_SetViewEntity( entID, (char *) data );
05231                 break;
05232 
05233         case SET_LOOPSOUND:
05234                 Q3_SetLoopSound( entID, (char *) data );
05235                 break;
05236 
05237         case SET_ICARUS_FREEZE:
05238         case SET_ICARUS_UNFREEZE:
05239                 Q3_SetICARUSFreeze( entID, (char *) data, (qboolean)(toSet==SET_ICARUS_FREEZE) );
05240                 break;
05241 
05242         case SET_WEAPON:
05243                 Q3_SetWeapon ( entID, (char *) data);
05244                 break;
05245 
05246         case SET_ITEM:
05247                 Q3_SetItem ( entID, (char *) data);
05248                 break;
05249 
05250         case SET_WALKSPEED:
05251                 int_data = atoi((char *) data);
05252                 Q3_SetWalkSpeed ( entID, int_data);
05253                 break;
05254 
05255         case SET_RUNSPEED:
05256                 int_data = atoi((char *) data);
05257                 Q3_SetRunSpeed ( entID, int_data);
05258                 break;
05259 
05260         case SET_WIDTH:
05261                 int_data = atoi((char *) data);
05262                 Q3_SetWidth( entID, int_data );
05263                 return qfalse;
05264                 break;
05265 
05266         case SET_YAWSPEED:
05267                 float_data = atof((char *) data);
05268                 Q3_SetYawSpeed ( entID, float_data);
05269                 break;
05270 
05271         case SET_AGGRESSION:
05272                 int_data = atoi((char *) data);
05273                 Q3_SetAggression ( entID, int_data);
05274                 break;
05275 
05276         case SET_AIM:
05277                 int_data = atoi((char *) data);
05278                 Q3_SetAim ( entID, int_data);
05279                 break;
05280 
05281         case SET_FRICTION:
05282                 int_data = atoi((char *) data);
05283                 Q3_SetFriction ( entID, int_data);
05284                 break;
05285 
05286         case SET_GRAVITY:
05287                 float_data = atof((char *) data);
05288                 Q3_SetGravity ( entID, float_data);
05289                 break;
05290 
05291         case SET_WAIT:
05292                 float_data = atof((char *) data);
05293                 Q3_SetWait( entID, float_data);
05294                 break;
05295 
05296         case SET_FOLLOWDIST:
05297                 float_data = atof((char *) data);
05298                 Q3_SetFollowDist( entID, float_data);
05299                 break;
05300 
05301         case SET_SCALE:
05302                 float_data = atof((char *) data);
05303                 Q3_SetScale( entID, float_data);
05304                 break;
05305 
05306         case SET_COUNT:
05307                 Q3_SetCount( entID, (char *) data);
05308                 break;
05309 
05310         case SET_SHOT_SPACING:
05311                 int_data = atoi((char *) data);
05312                 Q3_SetShotSpacing( entID, int_data );
05313                 break;
05314 
05315         case SET_IGNOREPAIN:
05316                 if(!Q_stricmp("true", ((char *)data)))
05317                         Q3_SetIgnorePain( entID, qtrue);
05318                 else if(!Q_stricmp("false", ((char *)data)))
05319                         Q3_SetIgnorePain( entID, qfalse);
05320                 break;
05321 
05322         case SET_IGNOREENEMIES:
05323                 if(!Q_stricmp("true", ((char *)data)))
05324                         Q3_SetIgnoreEnemies( entID, qtrue);
05325                 else if(!Q_stricmp("false", ((char *)data)))
05326                         Q3_SetIgnoreEnemies( entID, qfalse);
05327                 break;
05328 
05329         case SET_IGNOREALERTS:
05330                 if(!Q_stricmp("true", ((char *)data)))
05331                         Q3_SetIgnoreAlerts( entID, qtrue);
05332                 else if(!Q_stricmp("false", ((char *)data)))
05333                         Q3_SetIgnoreAlerts( entID, qfalse);
05334                 break;
05335                 
05336         case SET_DONTSHOOT:
05337                 if(!Q_stricmp("true", ((char *)data)))
05338                         Q3_SetDontShoot( entID, qtrue);
05339                 else if(!Q_stricmp("false", ((char *)data)))
05340                         Q3_SetDontShoot( entID, qfalse);
05341                 break;
05342         
05343         case SET_DONTFIRE:
05344                 if(!Q_stricmp("true", ((char *)data)))
05345                         Q3_SetDontFire( entID, qtrue);
05346                 else if(!Q_stricmp("false", ((char *)data)))
05347                         Q3_SetDontFire( entID, qfalse);
05348                 break;
05349 
05350         case SET_LOCKED_ENEMY:
05351                 if(!Q_stricmp("true", ((char *)data)))
05352                         Q3_SetLockedEnemy( entID, qtrue);
05353                 else if(!Q_stricmp("false", ((char *)data)))
05354                         Q3_SetLockedEnemy( entID, qfalse);
05355                 break;
05356 
05357         case SET_NOTARGET:
05358                 if(!Q_stricmp("true", ((char *)data)))
05359                         Q3_SetNoTarget( entID, qtrue);
05360                 else if(!Q_stricmp("false", ((char *)data)))
05361                         Q3_SetNoTarget( entID, qfalse);
05362                 break;
05363 
05364         case SET_LEAN:
05365                 G_DebugPrint( WL_WARNING, "SET_LEAN NOT SUPPORTED IN MP\n" );
05366                 break;
05367 
05368         case SET_SHOOTDIST:
05369                 float_data = atof((char *) data);
05370                 Q3_SetShootDist( entID, float_data );
05371                 break;
05372 
05373         case SET_TIMESCALE:
05374                 Q3_SetTimeScale( entID, (char *) data );
05375                 break;
05376 
05377         case SET_VISRANGE:
05378                 float_data = atof((char *) data);
05379                 Q3_SetVisrange( entID, float_data );
05380                 break;
05381         
05382         case SET_EARSHOT:
05383                 float_data = atof((char *) data);
05384                 Q3_SetEarshot( entID, float_data );
05385                 break;
05386         
05387         case SET_VIGILANCE:
05388                 float_data = atof((char *) data);
05389                 Q3_SetVigilance( entID, float_data );
05390                 break;
05391         
05392         case SET_VFOV:
05393                 int_data = atoi((char *) data);
05394                 Q3_SetVFOV( entID, int_data );
05395                 break;
05396 
05397         case SET_HFOV:
05398                 int_data = atoi((char *) data);
05399                 Q3_SetHFOV( entID, int_data );
05400                 break;
05401 
05402         case SET_TARGETNAME:
05403                 Q3_SetTargetName( entID, (char *) data );
05404                 break;
05405 
05406         case SET_TARGET:
05407                 Q3_SetTarget( entID, (char *) data );
05408                 break;
05409 
05410         case SET_TARGET2:
05411                 Q3_SetTarget2( entID, (char *) data );
05412                 break;
05413         
05414         case SET_LOCATION:
05415                 if ( !Q3_SetLocation( entID, (char *) data ) )
05416                 {
05417                         trap_ICARUS_TaskIDSet( ent, TID_LOCATION, taskID );
05418                         return qfalse;
05419                 }
05420                 break;
05421 
05422         case SET_PAINTARGET:
05423                 Q3_SetPainTarget( entID, (char *) data );
05424                 break;
05425 
05426         case SET_DEFEND_TARGET:
05427                 G_DebugPrint( WL_WARNING, "Q3_SetDefendTarget unimplemented\n", entID );
05428                 //Q3_SetEnemy( entID, (char *) data);
05429                 break;
05430 
05431         case SET_PARM1:
05432         case SET_PARM2:
05433         case SET_PARM3:
05434         case SET_PARM4:
05435         case SET_PARM5:
05436         case SET_PARM6:
05437         case SET_PARM7:
05438         case SET_PARM8:
05439         case SET_PARM9:
05440         case SET_PARM10:
05441         case SET_PARM11:
05442         case SET_PARM12:
05443         case SET_PARM13:
05444         case SET_PARM14:
05445         case SET_PARM15:
05446         case SET_PARM16:
05447                 Q3_SetParm( entID, (toSet-SET_PARM1), (char *) data );
05448                 break;
05449 
05450         case SET_SPAWNSCRIPT:
05451         case SET_USESCRIPT:
05452         case SET_AWAKESCRIPT:
05453         case SET_ANGERSCRIPT:
05454         case SET_ATTACKSCRIPT:
05455         case SET_VICTORYSCRIPT:
05456         case SET_PAINSCRIPT:
05457         case SET_FLEESCRIPT:
05458         case SET_DEATHSCRIPT:
05459         case SET_DELAYEDSCRIPT:
05460         case SET_BLOCKEDSCRIPT:
05461         case SET_FFIRESCRIPT:
05462         case SET_FFDEATHSCRIPT:
05463         case SET_MINDTRICKSCRIPT:
05464                 if( !Q3_SetBehaviorSet(entID, toSet, (char *) data) )
05465                         G_DebugPrint( WL_ERROR, "Q3_SetBehaviorSet: Invalid bSet %s\n", type_name );
05466                 break;
05467 
05468         case SET_NO_MINDTRICK:
05469                 if(!Q_stricmp("true", ((char *)data)))
05470                         Q3_SetNoMindTrick( entID, qtrue);
05471                 else
05472                         Q3_SetNoMindTrick( entID, qfalse);
05473                 break;
05474 
05475         case SET_CINEMATIC_SKIPSCRIPT :
05476                 Q3_SetCinematicSkipScript((char *) data);
05477                 break;
05478 
05479 
05480         case SET_DELAYSCRIPTTIME:
05481                 int_data = atoi((char *) data);
05482                 Q3_SetDelayScriptTime( entID, int_data );
05483                 break;
05484 
05485         case SET_CROUCHED:
05486                 if(!Q_stricmp("true", ((char *)data)))
05487                         Q3_SetCrouched( entID, qtrue);
05488                 else
05489                         Q3_SetCrouched( entID, qfalse);
05490                 break;
05491 
05492         case SET_WALKING:
05493                 if(!Q_stricmp("true", ((char *)data)))
05494                         Q3_SetWalking( entID, qtrue);   
05495                 else
05496                         Q3_SetWalking( entID, qfalse);  
05497                 break;
05498 
05499         case SET_RUNNING:
05500                 if(!Q_stricmp("true", ((char *)data)))
05501                         Q3_SetRunning( entID, qtrue);   
05502                 else
05503                         Q3_SetRunning( entID, qfalse);  
05504                 break;
05505 
05506         case SET_CHASE_ENEMIES:
05507                 if(!Q_stricmp("true", ((char *)data)))
05508                         Q3_SetChaseEnemies( entID, qtrue);      
05509                 else
05510                         Q3_SetChaseEnemies( entID, qfalse);     
05511                 break;
05512 
05513         case SET_LOOK_FOR_ENEMIES:
05514                 if(!Q_stricmp("true", ((char *)data)))
05515                         Q3_SetLookForEnemies( entID, qtrue);    
05516                 else
05517                         Q3_SetLookForEnemies( entID, qfalse);   
05518                 break;
05519 
05520         case SET_FACE_MOVE_DIR:
05521                 if(!Q_stricmp("true", ((char *)data)))
05522                         Q3_SetFaceMoveDir( entID, qtrue);       
05523                 else
05524                         Q3_SetFaceMoveDir( entID, qfalse);      
05525                 break;
05526 
05527         case SET_ALT_FIRE:
05528                 if(!Q_stricmp("true", ((char *)data)))
05529                         Q3_SetAltFire( entID, qtrue);   
05530                 else
05531                         Q3_SetAltFire( entID, qfalse);  
05532                 break;
05533 
05534         case SET_DONT_FLEE:
05535                 if(!Q_stricmp("true", ((char *)data)))
05536                         Q3_SetDontFlee( entID, qtrue);  
05537                 else
05538                         Q3_SetDontFlee( entID, qfalse); 
05539                 break;
05540 
05541         case SET_FORCED_MARCH:
05542                 if(!Q_stricmp("true", ((char *)data)))
05543                         Q3_SetForcedMarch( entID, qtrue);       
05544                 else
05545                         Q3_SetForcedMarch( entID, qfalse);      
05546                 break;
05547 
05548         case SET_NO_RESPONSE:
05549                 if(!Q_stricmp("true", ((char *)data)))
05550                         Q3_SetNoResponse( entID, qtrue);        
05551                 else
05552                         Q3_SetNoResponse( entID, qfalse);       
05553                 break;
05554 
05555         case SET_NO_COMBAT_TALK:
05556                 if(!Q_stricmp("true", ((char *)data)))
05557                         Q3_SetCombatTalk( entID, qtrue);        
05558                 else
05559                         Q3_SetCombatTalk( entID, qfalse);       
05560                 break;
05561 
05562         case SET_NO_ALERT_TALK:
05563                 if(!Q_stricmp("true", ((char *)data)))
05564                         Q3_SetAlertTalk( entID, qtrue); 
05565                 else
05566                         Q3_SetAlertTalk( entID, qfalse);        
05567                 break;
05568 
05569         case SET_USE_CP_NEAREST:
05570                 if(!Q_stricmp("true", ((char *)data)))
05571                         Q3_SetUseCpNearest( entID, qtrue);      
05572                 else
05573                         Q3_SetUseCpNearest( entID, qfalse);     
05574                 break;
05575 
05576         case SET_NO_FORCE:
05577                 if(!Q_stricmp("true", ((char *)data)))
05578                         Q3_SetNoForce( entID, qtrue);   
05579                 else
05580                         Q3_SetNoForce( entID, qfalse);  
05581                 break;
05582 
05583         case SET_NO_ACROBATICS:
05584                 if(!Q_stricmp("true", ((char *)data)))
05585                         Q3_SetNoAcrobatics( entID, qtrue);      
05586                 else
05587                         Q3_SetNoAcrobatics( entID, qfalse);     
05588                 break;
05589 
05590         case SET_USE_SUBTITLES:
05591                 if(!Q_stricmp("true", ((char *)data)))
05592                         Q3_SetUseSubtitles( entID, qtrue);      
05593                 else
05594                         Q3_SetUseSubtitles( entID, qfalse);     
05595                 break;
05596 
05597         case SET_NO_FALLTODEATH:
05598                 if(!Q_stricmp("true", ((char *)data)))
05599                         Q3_SetNoFallToDeath( entID, qtrue);     
05600                 else
05601                         Q3_SetNoFallToDeath( entID, qfalse);    
05602                 break;
05603 
05604         case SET_DISMEMBERABLE:
05605                 if(!Q_stricmp("true", ((char *)data)))
05606                         Q3_SetDismemberable( entID, qtrue);     
05607                 else
05608                         Q3_SetDismemberable( entID, qfalse);    
05609                 break;
05610 
05611         case SET_MORELIGHT:
05612                 if(!Q_stricmp("true", ((char *)data)))
05613                         Q3_SetMoreLight( entID, qtrue); 
05614                 else
05615                         Q3_SetMoreLight( entID, qfalse);        
05616                 break;
05617 
05618 
05619         case SET_TREASONED:
05620                 G_DebugPrint( WL_VERBOSE, "SET_TREASONED is disabled, do not use\n" );
05621                 /*
05622                 G_TeamRetaliation( NULL, SV_GentityNum(0), qfalse );
05623                 ffireLevel = FFIRE_LEVEL_RETALIATION;
05624                 */
05625                 break;
05626 
05627         case SET_UNDYING:
05628                 if(!Q_stricmp("true", ((char *)data)))
05629                         Q3_SetUndying( entID, qtrue);   
05630                 else
05631                         Q3_SetUndying( entID, qfalse);  
05632                 break;
05633 
05634         case SET_INVINCIBLE:
05635                 if(!Q_stricmp("true", ((char *)data)))
05636                         Q3_SetInvincible( entID, qtrue);        
05637                 else
05638                         Q3_SetInvincible( entID, qfalse);       
05639                 break;
05640 
05641         case SET_NOAVOID:
05642                 if(!Q_stricmp("true", ((char *)data)))
05643                         Q3_SetNoAvoid( entID, qtrue);   
05644                 else
05645                         Q3_SetNoAvoid( entID, qfalse);  
05646                 break;
05647 
05648         case SET_SOLID:
05649                 if(!Q_stricmp("true", ((char *)data)))
05650                 {
05651                         if ( !Q3_SetSolid( entID, qtrue) )
05652                         {
05653                                 trap_ICARUS_TaskIDSet( ent, TID_RESIZE, taskID );
05654                                 return qfalse;
05655                         }
05656                 }
05657                 else
05658                 {
05659                         Q3_SetSolid( entID, qfalse);
05660                 }
05661                 break;
05662 
05663         case SET_INVISIBLE:
05664                 if( !Q_stricmp("true", ((char *)data)) )
05665                         Q3_SetInvisible( entID, qtrue );
05666                 else
05667                         Q3_SetInvisible( entID, qfalse );
05668                 break;
05669 
05670         case SET_VAMPIRE:
05671                 if( !Q_stricmp("true", ((char *)data)) )
05672                         Q3_SetVampire( entID, qtrue );
05673                 else
05674                         Q3_SetVampire( entID, qfalse );
05675                 break;
05676 
05677         case SET_FORCE_INVINCIBLE:
05678                 if( !Q_stricmp("true", ((char *)data)) )
05679                         Q3_SetForceInvincible( entID, qtrue );
05680                 else
05681                         Q3_SetForceInvincible( entID, qfalse );
05682                 break;
05683 
05684         case SET_GREET_ALLIES:
05685                 if( !Q_stricmp("true", ((char *)data)) )
05686                         Q3_SetGreetAllies( entID, qtrue );
05687                 else
05688                         Q3_SetGreetAllies( entID, qfalse );
05689                 break;
05690 
05691         case SET_PLAYER_LOCKED:
05692                 if( !Q_stricmp("true", ((char *)data)) )
05693                         Q3_SetPlayerLocked( entID, qtrue );
05694                 else
05695                         Q3_SetPlayerLocked( entID, qfalse );
05696                 break;
05697                 
05698         case SET_LOCK_PLAYER_WEAPONS:
05699                 if( !Q_stricmp("true", ((char *)data)) )
05700                         Q3_SetLockPlayerWeapons( entID, qtrue );
05701                 else
05702                         Q3_SetLockPlayerWeapons( entID, qfalse );
05703                 break;
05704 
05705         case SET_NO_IMPACT_DAMAGE:
05706                 if( !Q_stricmp("true", ((char *)data)) )
05707                         Q3_SetNoImpactDamage( entID, qtrue );
05708                 else
05709                         Q3_SetNoImpactDamage( entID, qfalse );
05710                 break;
05711 
05712         case SET_FORWARDMOVE:
05713                 int_data = atoi((char *) data);
05714                 Q3_SetForwardMove( entID, int_data);    
05715                 break;
05716 
05717         case SET_RIGHTMOVE:
05718                 int_data = atoi((char *) data);
05719                 Q3_SetRightMove( entID, int_data);      
05720                 break;
05721 
05722         case SET_LOCKYAW:
05723                 Q3_SetLockAngle( entID, data);  
05724                 break;
05725         
05726         case SET_CAMERA_GROUP:
05727                 Q3_CameraGroup(entID, (char *)data);
05728                 break;
05729         case SET_CAMERA_GROUP_Z_OFS:
05730                 float_data = atof((char *) data);
05731                 Q3_CameraGroupZOfs( float_data );
05732                 break;
05733         case SET_CAMERA_GROUP_TAG:
05734                 Q3_CameraGroupTag( (char *)data );
05735                 break;
05736 
05737         //FIXME: put these into camera commands
05738         case SET_LOOK_TARGET:
05739                 Q3_LookTarget(entID, (char *)data);
05740                 break;
05741 
05742         case SET_ADDRHANDBOLT_MODEL:
05743                 Q3_AddRHandModel(entID, (char *)data);
05744                 break;
05745 
05746         case SET_REMOVERHANDBOLT_MODEL:
05747                 Q3_RemoveRHandModel(entID, (char *)data);
05748                 break;
05749 
05750         case SET_ADDLHANDBOLT_MODEL:
05751                 Q3_AddLHandModel(entID, (char *)data);
05752                 break;
05753 
05754         case SET_REMOVELHANDBOLT_MODEL:
05755                 Q3_RemoveLHandModel(entID, (char *)data);
05756                 break;
05757 
05758         case SET_FACEEYESCLOSED:
05759         case SET_FACEEYESOPENED:
05760         case SET_FACEAUX:
05761         case SET_FACEBLINK:
05762         case SET_FACEBLINKFROWN:
05763         case SET_FACEFROWN:
05764         case SET_FACENORMAL:
05765                 float_data = atof((char *) data);
05766                 Q3_Face(entID, toSet, float_data);
05767                 break;
05768 
05769         case SET_SCROLLTEXT:
05770                 Q3_ScrollText( (char *)data );  
05771                 break;
05772 
05773         case SET_LCARSTEXT:
05774                 Q3_LCARSText( (char *)data );   
05775                 break;
05776 
05777         case SET_CAPTIONTEXTCOLOR:
05778                 Q3_SetCaptionTextColor ( (char *)data );        
05779                 break;
05780         case SET_CENTERTEXTCOLOR:
05781                 Q3_SetCenterTextColor ( (char *)data ); 
05782                 break;
05783         case SET_SCROLLTEXTCOLOR:
05784                 Q3_SetScrollTextColor ( (char *)data ); 
05785                 break;
05786 
05787         case SET_PLAYER_USABLE:
05788                 if(!Q_stricmp("true", ((char *)data)))
05789                 {
05790                         Q3_SetPlayerUsable(entID, qtrue);
05791                 }
05792                 else
05793                 {
05794                         Q3_SetPlayerUsable(entID, qfalse);
05795                 }
05796                 break;
05797 
05798         case SET_STARTFRAME:
05799                 int_data = atoi((char *) data);
05800                 Q3_SetStartFrame(entID, int_data);
05801                 break;
05802         
05803         case SET_ENDFRAME:
05804                 int_data = atoi((char *) data);
05805                 Q3_SetEndFrame(entID, int_data);
05806 
05807                 trap_ICARUS_TaskIDSet( ent, TID_ANIM_BOTH, taskID );
05808                 return qfalse;
05809                 break;
05810 
05811         case SET_ANIMFRAME:
05812                 int_data = atoi((char *) data);
05813                 Q3_SetAnimFrame(entID, int_data);
05814                 return qfalse;
05815                 break;
05816                 
05817         case SET_LOOP_ANIM:
05818                 if(!Q_stricmp("true", ((char *)data)))
05819                 {
05820                         Q3_SetLoopAnim(entID, qtrue);
05821                 }
05822                 else
05823                 {
05824                         Q3_SetLoopAnim(entID, qfalse);
05825                 }
05826                 break;
05827 
05828         case SET_INTERFACE:
05829                 G_DebugPrint( WL_WARNING, "Q3_SetInterface: NOT SUPPORTED IN MP\n");
05830 
05831                 break;
05832 
05833         case SET_SHIELDS:
05834                 if(!Q_stricmp("true", ((char *)data)))
05835                 {
05836                         Q3_SetShields(entID, qtrue);
05837                 }
05838                 else
05839                 {
05840                         Q3_SetShields(entID, qfalse);
05841                 }
05842                 break;
05843         
05844         case SET_SABERACTIVE:
05845                 if(!Q_stricmp("true", ((char *)data)))
05846                 {
05847                         Q3_SetSaberActive( entID, qtrue );
05848                 }
05849                 else
05850                 {
05851                         Q3_SetSaberActive( entID, qfalse );
05852                 }
05853                 break;
05854 
05855         case SET_ADJUST_AREA_PORTALS:
05856                 G_DebugPrint( WL_WARNING, "Q3_SetAdjustAreaPortals: NOT SUPPORTED IN MP\n");
05857                 break;
05858         
05859         case SET_DMG_BY_HEAVY_WEAP_ONLY:
05860                 G_DebugPrint( WL_WARNING, "Q3_SetDmgByHeavyWeapOnly: NOT SUPPORTED IN MP\n");
05861                 break;
05862 
05863         case SET_SHIELDED:
05864                 G_DebugPrint( WL_WARNING, "Q3_SetShielded: NOT SUPPORTED IN MP\n");
05865                 break;
05866 
05867         case SET_NO_GROUPS:
05868                 G_DebugPrint( WL_WARNING, "Q3_SetNoGroups: NOT SUPPORTED IN MP\n");
05869                 break;
05870 
05871         case SET_FIRE_WEAPON:
05872                 if(!Q_stricmp("true", ((char *)data)))
05873                 {
05874                         Q3_SetFireWeapon( entID, qtrue);
05875                 }
05876                 else if(!Q_stricmp("false", ((char *)data)))
05877                 {
05878                         Q3_SetFireWeapon( entID, qfalse);
05879                 }
05880                 break;
05881 
05882         case SET_INACTIVE:
05883                 if(!Q_stricmp("true", ((char *)data)))
05884                 {
05885                         Q3_SetInactive( entID, qtrue);
05886                 }
05887                 else if(!Q_stricmp("false", ((char *)data)))
05888                 {
05889                         Q3_SetInactive( entID, qfalse);
05890                 }
05891                 else if(!Q_stricmp("unlocked", ((char *)data)))
05892                 {
05893                         UnLockDoors(&g_entities[entID]);
05894                 }
05895                 else if(!Q_stricmp("locked", ((char *)data)))
05896                 {
05897                         LockDoors(&g_entities[entID]);
05898                 }
05899                 break;
05900         case SET_END_SCREENDISSOLVE:
05901                 G_DebugPrint( WL_WARNING, "SET_END_SCREENDISSOLVE: NOT SUPPORTED IN MP\n");
05902                 break;
05903 
05904         case SET_MISSION_STATUS_SCREEN:
05905                 //Cvar_Set("cg_missionstatusscreen", "1");
05906                 G_DebugPrint( WL_WARNING, "SET_MISSION_STATUS_SCREEN: NOT SUPPORTED IN MP\n");
05907                 break;
05908 
05909         case SET_FUNC_USABLE_VISIBLE:
05910                 if(!Q_stricmp("true", ((char *)data)))
05911                 {
05912                         Q3_SetFuncUsableVisible( entID, qtrue);
05913                 }
05914                 else if(!Q_stricmp("false", ((char *)data)))
05915                 {
05916                         Q3_SetFuncUsableVisible( entID, qfalse);
05917                 }
05918                 break;
05919 
05920         case SET_NO_KNOCKBACK:
05921                 if(!Q_stricmp("true", ((char *)data)))
05922                 {
05923                         Q3_SetNoKnockback(entID, qtrue);
05924                 }
05925                 else
05926                 {
05927                         Q3_SetNoKnockback(entID, qfalse);
05928                 }
05929                 break;
05930 
05931         case SET_VIDEO_PLAY:
05932                 // don't do this check now, James doesn't want a scripted cinematic to also skip any Video cinematics as well,
05933                 //      the "timescale" and "skippingCinematic" cvars will be set back to normal in the Video code, so doing a
05934                 //      skip will now only skip one section of a multiple-part story (eg VOY1 bridge sequence)
05935                 //
05936 //              if ( g_timescale->value <= 1.0f )
05937                 {
05938                         G_DebugPrint( WL_WARNING, "SET_VIDEO_PLAY: NOT SUPPORTED IN MP\n");
05939                         //SV_SendConsoleCommand( va("inGameCinematic %s\n", (char *)data) );
05940                 }
05941                 break;
05942 
05943         case SET_VIDEO_FADE_IN:
05944                 G_DebugPrint( WL_WARNING, "SET_VIDEO_FADE_IN: NOT SUPPORTED IN MP\n");
05945                 break;
05946 
05947         case SET_VIDEO_FADE_OUT:
05948                 G_DebugPrint( WL_WARNING, "SET_VIDEO_FADE_OUT: NOT SUPPORTED IN MP\n");
05949                 break;
05950         case SET_REMOVE_TARGET:
05951                 Q3_SetRemoveTarget( entID, (const char *) data );
05952                 break;
05953 
05954         case SET_LOADGAME:
05955                 //gi.SendConsoleCommand( va("load %s\n", (const char *) data ) );
05956                 G_DebugPrint( WL_WARNING, "SET_LOADGAME: NOT SUPPORTED IN MP\n");
05957                 break;
05958 
05959         case SET_MENU_SCREEN:
05960                 //UI_SetActiveMenu( (const char *) data );
05961                 break;
05962 
05963         case SET_OBJECTIVE_SHOW:
05964                 G_DebugPrint( WL_WARNING, "SET_OBJECTIVE_SHOW: NOT SUPPORTED IN MP\n");
05965                 break;
05966         case SET_OBJECTIVE_HIDE:
05967                 G_DebugPrint( WL_WARNING, "SET_OBJECTIVE_HIDE: NOT SUPPORTED IN MP\n");
05968                 break;
05969         case SET_OBJECTIVE_SUCCEEDED:
05970                 G_DebugPrint( WL_WARNING, "SET_OBJECTIVE_SUCCEEDED: NOT SUPPORTED IN MP\n");
05971                 break;
05972         case SET_OBJECTIVE_FAILED:
05973                 G_DebugPrint( WL_WARNING, "SET_OBJECTIVE_FAILED: NOT SUPPORTED IN MP\n");
05974                 break;
05975 
05976         case SET_OBJECTIVE_CLEARALL:
05977                 G_DebugPrint( WL_WARNING, "SET_OBJECTIVE_CLEARALL: NOT SUPPORTED IN MP\n");
05978                 break;
05979 
05980         case SET_MISSIONFAILED:
05981                 G_DebugPrint( WL_WARNING, "SET_MISSIONFAILED: NOT SUPPORTED IN MP\n");
05982                 break;
05983 
05984         case SET_MISSIONSTATUSTEXT:
05985                 G_DebugPrint( WL_WARNING, "SET_MISSIONSTATUSTEXT: NOT SUPPORTED IN MP\n");
05986                 break;
05987                 
05988         case SET_MISSIONSTATUSTIME:
05989                 G_DebugPrint( WL_WARNING, "SET_MISSIONSTATUSTIME: NOT SUPPORTED IN MP\n");
05990                 break;
05991 
05992         case SET_CLOSINGCREDITS:
05993                 G_DebugPrint( WL_WARNING, "SET_CLOSINGCREDITS: NOT SUPPORTED IN MP\n");
05994                 break;
05995 
05996         case SET_SKILL:
05997 //              //can never be set
05998                 break;
05999 
06000         case SET_FULLNAME:
06001                 Q3_SetFullName( entID, (char *) data );
06002                 break;
06003 
06004         case SET_DISABLE_SHADER_ANIM:
06005                 if(!Q_stricmp("true", ((char *)data)))
06006                 {
06007                         Q3_SetDisableShaderAnims( entID, qtrue);
06008                 }
06009                 else
06010                 {
06011                         Q3_SetDisableShaderAnims( entID, qfalse);
06012                 }
06013                 break;
06014 
06015         case SET_SHADER_ANIM:
06016                 if(!Q_stricmp("true", ((char *)data)))
06017                 {
06018                         Q3_SetShaderAnim( entID, qtrue);
06019                 }
06020                 else
06021                 {
06022                         Q3_SetShaderAnim( entID, qfalse);
06023                 }
06024                 break;
06025 
06026         case SET_MUSIC_STATE:
06027                 Q3_SetMusicState( (char *) data );
06028                 break;
06029 
06030         case SET_CLEAN_DAMAGING_ENTS:
06031                 Q3_SetCleanDamagingEnts();
06032                 break;
06033 
06034         case SET_HUD:
06035                 G_DebugPrint( WL_WARNING, "SET_HUD: NOT SUPPORTED IN MP\n");
06036                 break;
06037 
06038         case SET_FORCE_HEAL_LEVEL:
06039         case SET_FORCE_JUMP_LEVEL:
06040         case SET_FORCE_SPEED_LEVEL:
06041         case SET_FORCE_PUSH_LEVEL:
06042         case SET_FORCE_PULL_LEVEL:
06043         case SET_FORCE_MINDTRICK_LEVEL:
06044         case SET_FORCE_GRIP_LEVEL:
06045         case SET_FORCE_LIGHTNING_LEVEL:
06046         case SET_SABER_THROW:
06047         case SET_SABER_DEFENSE:
06048         case SET_SABER_OFFENSE:
06049                 int_data = atoi((char *) data);
06050                 Q3_SetForcePowerLevel( entID, (toSet-SET_FORCE_HEAL_LEVEL), int_data );
06051                 break;
06052         
06053         default:
06054                 //G_DebugPrint( WL_ERROR, "Q3_Set: '%s' is not a valid set field\n", type_name );
06055                 trap_ICARUS_SetVar( taskID, entID, type_name, data );
06056                 break;
06057         }
06058 
06059         return qtrue;
06060 }

void Q3_SetICARUSFreeze int  entID,
const char *  name,
qboolean  freeze
 

Definition at line 3056 of file g_ICARUScb.c.

References FOFS, G_DebugPrint(), G_Find(), gentity_t, name, NULL, gentity_s::r, SVF_ICARUS_FREEZE, entityShared_t::svFlags, and WL_WARNING.

Referenced by Q3_Set().

03057 {
03058         gentity_t       *self  = G_Find( NULL, FOFS(targetname), name );
03059         if ( !self )
03060         {//hmm, targetname failed, try script_targetname?
03061                 self = G_Find( NULL, FOFS(script_targetname), name );
03062         }
03063 
03064         if ( !self )
03065         {
03066                 G_DebugPrint( WL_WARNING, "Q3_SetICARUSFreeze: invalid ent %s\n", name);
03067                 return;
03068         }
03069         
03070         if ( freeze )
03071         {
03072                 self->r.svFlags |= SVF_ICARUS_FREEZE;
03073         }
03074         else
03075         {
03076                 self->r.svFlags &= ~SVF_ICARUS_FREEZE;
03077         }
03078 }

void Q3_SetLoopSound int  entID,
const char *  name
 

Definition at line 3031 of file g_ICARUScb.c.

References G_DebugPrint(), g_entities, G_SoundIndex(), gentity_t, entityState_s::loopIsSoundset, entityState_s::loopSound, name, Q_stricmp(), qfalse, gentity_s::s, sfxHandle_t, and WL_WARNING.

Referenced by Q3_Set().

03032 {
03033         sfxHandle_t     index;
03034         gentity_t       *self  = &g_entities[entID];
03035 
03036         if ( Q_stricmp( "NULL", name ) == 0 || Q_stricmp( "NONE", name )==0)
03037         {
03038                 self->s.loopSound = 0;
03039                 self->s.loopIsSoundset = qfalse;
03040                 return;
03041         }
03042 
03043         index = G_SoundIndex( (char*)name );
03044 
03045         if (index)
03046         {
03047                 self->s.loopSound = index;
03048                 self->s.loopIsSoundset = qfalse;
03049         }
03050         else
03051         {
03052                 G_DebugPrint( WL_WARNING, "Q3_SetLoopSound: can't find sound file: '%s'\n", name );
03053         }
03054 }

void Q3_SetParm int  entID,
int  parmNum,
const char *  parmValue
 

Definition at line 3637 of file g_ICARUScb.c.

References atof(), Com_sprintf(), G_Alloc(), G_DebugPrint(), g_entities, gentity_t, MAX_PARMS, memset(), parms_t::parm, gentity_s::parms, strncpy(), and WL_WARNING.

Referenced by BG_ParseField(), NPC_Spawn_Do(), and Q3_Set().

03638 {
03639         gentity_t       *ent = &g_entities[entID];
03640         float           val;
03641 
03642         if ( !ent )
03643         {
03644                 G_DebugPrint( WL_WARNING, "Q3_SetParm: invalid entID %d\n", entID);
03645                 return;
03646         }
03647 
03648         if ( parmNum < 0 || parmNum >= MAX_PARMS )
03649         {
03650                 G_DebugPrint( WL_WARNING, "SET_PARM: parmNum %d out of range!\n", parmNum );
03651                 return;
03652         }
03653 
03654         if( !ent->parms )
03655         {
03656                 ent->parms = (parms_t *)G_Alloc( sizeof(parms_t) );
03657                 memset( ent->parms, 0, sizeof(parms_t) );
03658         }
03659 
03660         if ( (val = Q3_GameSideCheckStringCounterIncrement( parmValue )) )
03661         {
03662                 val += atof( ent->parms->parm[parmNum] );
03663                 Com_sprintf( ent->parms->parm[parmNum], sizeof(ent->parms->parm), "%f", val );
03664         }
03665         else
03666         {//Just copy the string
03667                 //copy only 16 characters
03668                 strncpy( ent->parms->parm[parmNum], parmValue, sizeof(ent->parms->parm[0]) );
03669                 //set the last charcter to null in case we had to truncate their passed string
03670                 if ( ent->parms->parm[parmNum][sizeof(ent->parms->parm[0]) - 1] != 0 )
03671                 {//Tried to set a string that is too long
03672                         ent->parms->parm[parmNum][sizeof(ent->parms->parm[0]) - 1] = 0;
03673                         G_DebugPrint( WL_WARNING, "SET_PARM: parm%d string too long, truncated to '%s'!\n", parmNum, ent->parms->parm[parmNum] );
03674                 }
03675         }
03676 }

void Q3_SetViewEntity int  entID,
const char *  name
 

Definition at line 3089 of file g_ICARUScb.c.

References G_DebugPrint(), and WL_WARNING.

Referenced by Q3_Set().

03090 {
03091         G_DebugPrint( WL_WARNING, "Q3_SetViewEntity currently unsupported in MP, ask if you need it.\n");
03092 }

void Q3_TaskIDClear int *  taskID  ) 
 

Definition at line 270 of file g_ICARUScb.c.

Referenced by Q3_Set().

00271 {
00272         *taskID = -1;
00273 }

void Q3_Use int  entID,
const char *  target
 

Definition at line 981 of file g_ICARUScb.c.

References G_DebugPrint(), g_entities, G_UseTargets2(), gentity_t, and WL_WARNING.

Referenced by vmMain().

00982 {
00983         gentity_t       *ent  = &g_entities[entID];
00984         
00985         if ( !ent )
00986         {
00987                 G_DebugPrint( WL_WARNING, "Q3_Use: invalid entID %d\n", entID);
00988                 return;
00989         }
00990 
00991         if( !target || !target[0] )
00992         {
00993                 G_DebugPrint( WL_WARNING, "Q3_Use: string is NULL!\n" );
00994                 return;
00995         }
00996 
00997         G_UseTargets2(ent, ent, target);
00998 }

void SolidifyOwner gentity_t self  ) 
 

Definition at line 4257 of file g_ICARUScb.c.

References entityShared_t::contents, CONTENTS_BODY, entityShared_t::currentOrigin, FRAMETIME, g_entities, G_FreeEntity(), gentity_t, gentity_s::inuse, level, gentity_s::nextthink, entityShared_t::ownerNum, gentity_s::r, SolidifyOwner(), SpotWouldTelefrag2(), gentity_s::think, TID_RESIZE, level_locals_t::time, and trap_ICARUS_TaskIDComplete().

Referenced by SolidifyOwner().

04258 {
04259         int oldContents;
04260         gentity_t *owner = &g_entities[self->r.ownerNum];
04261 
04262         self->nextthink = level.time + FRAMETIME;
04263         self->think = G_FreeEntity;
04264 
04265         if ( !owner || !owner->inuse )
04266         {
04267                 return;
04268         }
04269 
04270         oldContents = owner->r.contents;
04271         owner->r.contents = CONTENTS_BODY;
04272         if ( SpotWouldTelefrag2( owner, owner->r.currentOrigin ) )
04273         {
04274                 owner->r.contents = oldContents;
04275                 self->think = SolidifyOwner;
04276         }
04277         else
04278         {
04279                 trap_ICARUS_TaskIDComplete( owner, TID_RESIZE );
04280         }
04281 }

qboolean SpotWouldTelefrag2 gentity_t mover,
vec3_t  dest
 

Definition at line 554 of file g_client.c.

00555 {
00556         int                     i, num;
00557         int                     touch[MAX_GENTITIES];
00558         gentity_t       *hit;
00559         vec3_t          mins, maxs;
00560 
00561         VectorAdd( dest, mover->r.mins, mins );
00562         VectorAdd( dest, mover->r.maxs, maxs );
00563         num = trap_EntitiesInBox( mins, maxs, touch, MAX_GENTITIES );
00564 
00565         for (i=0 ; i<num ; i++) 
00566         {
00567                 hit = &g_entities[touch[i]];
00568                 if ( hit == mover )
00569                 {
00570                         continue;
00571                 }
00572 
00573                 if ( hit->r.contents & mover->r.contents )
00574                 {
00575                         return qtrue;
00576                 }
00577         }
00578 
00579         return qfalse;
00580 }

void UnLockDoors gentity_t *const  ent  ) 
 

Definition at line 820 of file g_mover.c.

References entityState_s::frame, gentity_t, MOVER_LOCKED, MOVER_TOGGLE, NULL, gentity_s::s, gentity_s::spawnflags, gentity_s::targetname, and gentity_s::teamchain.

Referenced by Q3_Set(), and Use_BinaryMover().

00821 {
00822         //noise?
00823         //go through and unlock the door and all the slaves
00824         gentity_t       *slave = ent;
00825         do 
00826         {       // want to allow locked toggle doors, so keep the targetname
00827                 if( !(slave->spawnflags & MOVER_TOGGLE) )
00828                 {
00829                         slave->targetname = NULL;//not usable ever again
00830                 }
00831                 slave->spawnflags &= ~MOVER_LOCKED;
00832                 slave->s.frame = 1;//second stage of anim
00833                 slave = slave->teamchain;
00834         } while  ( slave );
00835 }


Variable Documentation

stringID_table_t animTable[MAX_ANIMATIONS+1]
 

Definition at line 50 of file g_ICARUScb.c.

stringID_table_t BSTable[]
 

Definition at line 17 of file g_ICARUScb.c.

Referenced by G_ActivateBehavior().

char cinematicSkipScript[1024]
 

Definition at line 3881 of file g_ICARUScb.c.

qboolean player_locked = qfalse
 

Definition at line 4561 of file g_ICARUScb.c.

stringID_table_t setTable[]
 

Definition at line 52 of file g_ICARUScb.c.

Referenced by Q3_GetFloat(), Q3_GetString(), Q3_GetVector(), Q3_Set(), and vmMain().

vec4_t textcolor_caption
 

Definition at line 4919 of file g_ICARUScb.c.

vec4_t textcolor_center
 

Definition at line 4920 of file g_ICARUScb.c.

vec4_t textcolor_scroll
 

Definition at line 4921 of file g_ICARUScb.c.

stringID_table_t WPTable[]
 

Definition at line 16 of file g_ICARUScb.c.