News:

Come Chat with us live! Learn how HERE!

Main Menu

Change human starting items?

Started by DraZiLoX, January 29, 2010, 07:56:04 PM

DraZiLoX

You all prob know, humans have Rifle, Blaster and Medikit when they spawn. How to edit those items to like: Painsaw, Larmour, Helmet and Medikit?

Oh, i mean QVM of course >.>

Snake

You can try changing it on the function Cmd_Class_f in g_cmds.c or in the function ClientSpawn in g_client.c, It depends on your needs/the use you are gonna give to it.
.


CATAHA

You can do it even server-side. =)
Russian q3/trem mapping site: http://tremlair.krond.ru/
=[ Boxmaps suck if they have no concept ]=

Ice Trap (InstaGib)

Other maps: A.T.D*S Remake

DraZiLoX

Well, i got work but:

WARNING: Held items conflict with weapon 11


And code i edited:

g_cmds_c
    else if( ent->client->pers.teamSelection == PTE_HUMANS )
    {
      //set the item to spawn with
      if( !Q_stricmp( s, BG_FindNameForWeapon( WP_MACHINEGUN ) ) &&
          BG_WeaponIsAllowed( WP_MACHINEGUN ) )
      {
        ent->client->pers.humanItemSelection = WP_PAIN_SAW;
      }
      else if( !Q_stricmp( s, BG_FindNameForWeapon( WP_HBUILD ) ) &&
               BG_WeaponIsAllowed( WP_HBUILD ) )
      {
        ent->client->pers.humanItemSelection = WP_PAIN_SAW;
      }
      else if( !Q_stricmp( s, BG_FindNameForWeapon( WP_HBUILD2 ) ) &&
               BG_WeaponIsAllowed( WP_HBUILD2 ) &&
               BG_FindStagesForWeapon( WP_HBUILD2, g_humanStage.integer ) )
      {
        ent->client->pers.humanItemSelection = WP_PAIN_SAW;
      }
      else
      {
        trap_SendServerCommand( ent-g_entities,
          "print \"Unknown starting item\n\"" );
        return;
      }


g_client.c
  // clear entity values
  if( ent->client->pers.classSelection == PCL_HUMAN )
  {
    BG_AddWeaponToInventory( WP_PAIN_SAW, client->ps.stats );
    BG_AddUpgradeToInventory( UP_LIGHTARMOUR, client->ps.stats );
    BG_AddUpgradeToInventory( UP_HELMET, client->ps.stats );
    BG_AddUpgradeToInventory( UP_MEDKIT, client->ps.stats );
    weapon = client->pers.humanItemSelection;
  }
  else if( client->sess.sessionTeam != TEAM_SPECTATOR )
    weapon = BG_FindStartWeaponForClass( ent->client->pers.classSelection );
  else
    weapon = WP_NONE;

Snake

Quote from: DraZiLoX on January 30, 2010, 01:02:40 PM
g_client.c
  // clear entity values
  if( ent->client->pers.classSelection == PCL_HUMAN )
  {
    BG_AddWeaponToInventory( WP_PAIN_SAW, client->ps.stats );
    BG_AddUpgradeToInventory( UP_LIGHTARMOUR, client->ps.stats );
    BG_AddUpgradeToInventory( UP_HELMET, client->ps.stats );
    BG_AddUpgradeToInventory( UP_MEDKIT, client->ps.stats );
    weapon = client->pers.humanItemSelection;
  }
  else if( client->sess.sessionTeam != TEAM_SPECTATOR )
    weapon = BG_FindStartWeaponForClass( ent->client->pers.classSelection );
  else
    weapon = WP_NONE;



It's probably because you are giving 2 painsaws to the player, look:

  if( ent->client->pers.classSelection == PCL_HUMAN )
  {
    BG_AddWeaponToInventory( WP_PAIN_SAW, client->ps.stats );   //  <-----Here you are giving him the 1st psaw
    BG_AddUpgradeToInventory( UP_LIGHTARMOUR, client->ps.stats );
    BG_AddUpgradeToInventory( UP_HELMET, client->ps.stats );
    BG_AddUpgradeToInventory( UP_MEDKIT, client->ps.stats );
    weapon = client->pers.humanItemSelection;  // <-----and here you are setting it to give the player the second painsaw.
  }


The second painsaw is given a few lines later:

  BG_FindAmmoForWeapon( weapon, &maxAmmo, &maxClips );
  BG_AddWeaponToInventory( weapon, client->ps.stats );   //<---- HERE you are giving him the second painsaw.
  BG_PackAmmoArray( weapon, client->ps.ammo, client->ps.powerups, maxAmmo, maxClips );




I hope it helps :)
.


Snake

.

MitSugna

add them credits - start at stage 2
Otherwise you start with helmet but if you sell it you can't buy it back if you are at stage 1
lol...