Jump to content

JaceSolarisVIII

Members
  • Posts

    79
  • Joined

  • Last visited

Community Answers

  1. JaceSolarisVIII's post in Random NPC file was marked as the answer   
    This also needs to be supported in the code.
     
    In the code add the following in. NPC _spawn.cpp
    static void NPC_Spawn_f(void) after Jedi_random add
    if ( !Q_stricmp( "jedi_random", NPCspawner->NPC_type ) ) {//special case, for testing NPCspawner->NPC_type = NULL; NPCspawner->spawnflags |= 4; SP_NPC_Jedi( NPCspawner ); } else if ( !Q_stricmp( "sith_random", NPCspawner->NPC_type ) ) {//special case, for testing NPCspawner->NPC_type = NULL; NPCspawner->spawnflags |= 4; SP_NPC_Sith( NPCspawner ); } else { NPC_Spawn( NPCspawner, NPCspawner, NPCspawner ); } then after void SP_NPC_Jedi( gentity_t *self) add a variation of this
    void SP_NPC_Sith( gentity_t *self) { if(!self->NPC_type) { if ( self->spawnflags & 4 ) {//random! int sanityCheck = 20; //just in case while ( sanityCheck-- ) { switch( Q_irand( 0, 11 ) ) { case 0: self->NPC_type = "Sith1"; break; case 1: self->NPC_type = "Sith2"; break; case 2: self->NPC_type = "Sith3"; break; case 3: self->NPC_type = "Sith4"; break; case 4: self->NPC_type = "Sith5"; break; case 5: self->NPC_type = "Sith6"; break; case 6: self->NPC_type = "Sith7"; break; case 7: self->NPC_type = "Sith8"; break; case 8: self->NPC_type = "Sith9"; break; case 9: self->NPC_type = "Sith10"; break; case 10: self->NPC_type = "Sith11"; break; case 11: default://just in case self->NPC_type = "Sith12"; break; } if ( strstr( self->NPC_type, g_char_model->string ) != NULL ) {//bah, we're using this one, try again continue; } break; //get out of the while } } else if ( self->spawnflags & 2 ) { self->NPC_type = "RebornFencer"; } else if ( self->spawnflags & 1 ) { self->NPC_type = "RebornForceUser"; } else { if ( !Q_irand( 0, 2 ) ) { self->NPC_type = "RebornRodian"; } else if ( Q_irand( 0, 1 ) ) { self->NPC_type = "RebornTrandoshan"; } else { self->NPC_type = "RebornWeequay"; } } } SP_NPC_spawner( self ); } then you need to make a npc file to match the names of the npc,c you have created .like this
    Sith1 { playerModel cultist2 customSkin brown saber reborn weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 0 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 0 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd cultist1 sndcombat cultist2 sndextra cultist3 sndjedi cultist1 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith2 { playerModel cultist3 customSkin red saber reborn_new weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 0 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 0 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd cultist1 sndcombat cultist2 sndextra cultist3 sndjedi cultist1 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith3 { playerModel chiss saber reborn weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 1 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 1 FP_LIGHTNING 1 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 1 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd reborn1 sndcombat reborn2 sndextra reborn1 sndjedi reborn2 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith4 { playerModel rosh_penin saber shadowtrooper weapon WP_SABER saberStyle 3 health 500 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 0 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 0 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd rosh_boss sndextra rosh_boss sndcombat rosh_boss sndjedi rosh_boss dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith5 { playerModel alora saber Tavion weapon WP_SABER sabercolor red saberStyle 1 saberStyle 2 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 1 FP_PUSH 3 FP_PULL 2 FP_TELEPATHY 0 FP_GRIP 1 FP_LIGHTNING 2 FP_RAGE 0 FP_PROTECT 2 FP_ABSORB 2 FP_DRAIN 2 FP_SEE 2 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_ALORA sex female snd alora sndcombat alora sndextra alora sndjedi alora dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith6 { playerModel tavion saber tavion saberColor red weapon WP_SABER saberStyle 5 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 1 FP_SPEED 0 FP_PUSH 3 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 2 FP_RAGE 0 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 2 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank commander reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_TAVION sex female snd tavion sndextra tavion sndcombat tavion sndjedi tavion dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith7 { playerModel desann weapon WP_SABER saber Desann saberColor red saberStyle 4 altFire 1 health 500 FP_HEAL 2 FP_LEVITATION 3 FP_SPEED 0 FP_PUSH 3 FP_PULL 2 FP_GRIP 3 FP_LIGHTNING 2 FP_SEE 2 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 forceRegenRate 50 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 scale 135 height 78 crouchheight 42 width 18 playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_DESANN yawSpeed 120 walkSpeed 55 runSpeed 200 earshot 2048 visrange 4096 vigilance 1 movetype "walk" snd desann sndextra desann sndcombat desann sndjedi desann dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith8 { playerModel reborn2 customSkin boss saber RebornMaster weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 1 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 1 FP_LIGHTNING 1 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 1 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd reborn1 sndcombat reborn2 sndextra reborn1 sndjedi reborn2 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith9 { playerModel rodian saber reborn weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 0 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 0 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd rodian1 sndcombat rodian1 sndextra rodian1 sndjedi rodian1 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith10 { playerModel trandoshan saber reborn weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 0 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 0 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd trandoshan1 sndcombat trandoshan1 sndextra trandoshan1 sndjedi trandoshan1 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith11 { playerModel reborn customSkin acrobat saber reborn weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 0 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 0 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd reborn1 sndcombat reborn2 sndextra reborn1 sndjedi reborn2 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } Sith12 { playerModel reborn customSkin fencer saber reborn weapon WP_SABER saberStyle 2 saberStyle 1 altFire 1 health 200 FP_HEAL 3 FP_LEVITATION 2 FP_SPEED 0 FP_PUSH 2 FP_PULL 1 FP_TELEPATHY 0 FP_GRIP 0 FP_LIGHTNING 0 FP_RAGE 0 FP_PROTECT 1 FP_ABSORB 2 FP_DRAIN 0 FP_SEE 1 FP_SABERTHROW 2 //npc,s never get more than 2 because they spam it. FP_SABER_DEFENSE 5 FP_SABER_OFFENSE 5 rank captain reactions 5 aim 5 move 5 aggression 5 evasion 5 intelligence 5 hfov 160 vfov 160 yawSpeed 120 walkSpeed 50 runSpeed 170 earshot 2048 visrange 4096 vigilance 1 movetype "walk" playerTeam TEAM_ENEMY enemyTeam TEAM_PLAYER class CLASS_REBORN snd reborn1 sndcombat reborn2 sndextra reborn1 sndjedi reborn2 dismemberProbHead 95 dismemberProbArms 95 dismemberProbLegs 95 dismemberProbHands 0 dismemberProbWaist 95 } this  or a variation of this will allow you to create a new random npc spawn list.
  2. JaceSolarisVIII's post in Automatic Healing was marked as the answer   
    If your doing it in code,try this.
     
    This is multiplayer version
    void ClientTimerActions( gentity_t *ent, int msec ) { gclient_t *client; int clientNum = ent-g_entities; client = ent->client; client->timeResidual += msec; while ( client->timeResidual >= 1000 ) { client->timeResidual -= 1000; //you heal 1 hp every 1 second. if ( ent->health < client->ps.stats[STAT_MAX_HEALTH] ) { ent->health++; } if ( client->ps.stats[STAT_ARMOR] < client->ps.stats[STAT_MAX_HEALTH] ) { client->ps.stats[STAT_ARMOR]++; } // count down health when over max if ( ent->health > client->ps.stats[STAT_MAX_HEALTH] ) { ent->health--; } // count down armor when over max if ( client->ps.stats[STAT_ARMOR] > client->ps.stats[STAT_MAX_HEALTH] ) { client->ps.stats[STAT_ARMOR]--; } } } This is singleplayer version
    void ClientTimerActions( gentity_t *ent, int msec ) { gclient_t *client; client = ent->client; client->timeResidual += msec; while ( client->timeResidual >= 1000 ) { client->timeResidual -= 1000; if ( ent->s.weapon != WP_NONE ) { ent->client->sess.missionStats.weaponUsed[ent->s.weapon]++; } //you heal 1 hp every 1 second. if ( ent->health < client->ps.stats[STAT_MAX_HEALTH] ) { ent->health++; } if ( client->ps.stats[STAT_ARMOR] < client->ps.stats[STAT_MAX_HEALTH] ) { client->ps.stats[STAT_ARMOR]++; } // count down health when over max if ( ent->health > client->ps.stats[STAT_MAX_HEALTH] ) { ent->health--; } // count down armor when over max if ( client->ps.stats[STAT_ARMOR] > client->ps.stats[STAT_MAX_HEALTH] ) { client->ps.stats[STAT_ARMOR]--; } if ( (ent->flags&FL_OVERCHARGED_HEALTH) ) {//need to gradually reduce health back to max if ( ent->health > ent->client->ps.stats[STAT_MAX_HEALTH] ) {//decrement it ent->health--; ent->client->ps.stats[STAT_HEALTH] = ent->health; } else {//done ent->flags &= ~FL_OVERCHARGED_HEALTH; } } } } Should give the effect you want for your mod
×
×
  • Create New...