Jump to content

Home

couple of n00b coding questions.


sroerick

Recommended Posts

1. Where is the tusken rifle? I remember seeing a post that it was not an AI only weapon, and that it was an actual weapon, but i don't know where, or how to get to it.

 

2. How does one go about adding new weapons, or replacing current weapons?

 

Thanks

Link to comment
Share on other sites

'as far as i know'

 

- in q_shared.h:

#define MAX_WEAPONS                             19

 

Also, in bg_weapons.h we find:

typedef enum {
       WP_NONE,

       WP_STUN_BATON,
       WP_MELEE,
       WP_SABER,
       WP_BRYAR_PISTOL,
       WP_BLASTER,
       WP_DISRUPTOR,
       WP_BOWCASTER,
       WP_REPEATER,
       WP_DEMP2,
       WP_FLECHETTE,
       WP_ROCKET_LAUNCHER,
       WP_THERMAL,
       WP_TRIP_MINE,
       WP_DET_PACK,
       WP_CONCUSSION,
       WP_BRYAR_OLD,
       WP_EMPLACED_GUN,
       WP_TURRET,

//      WP_GAUNTLET,
//      WP_MACHINEGUN,                  // Bryar
//      WP_SHOTGUN,                             // Blaster
//      WP_GRENADE_LAUNCHER,    // Thermal
//      WP_LIGHTNING,                   // 
//      WP_RAILGUN,                             // 
//      WP_GRAPPLING_HOOK,

       WP_NUM_WEAPONS
};
typedef int weapon_t;

 

The MAX_WEAPONS define tells us that 19 bits are sent across the network containing info telling other players what weapons this player has, so they can draw them, etc. the weapons enumeration shows which weapons are taking up those 'slots'. I'm not sure how the NPC tusken is assigned, but he probably has his own define somewhere - I haven't really tried to spawn a tusken in MP.

Link to comment
Share on other sites

The define is hard - because the server only sends 19 bits of info to the client pertaining to weapon information. There's a fix posted at Quake3World to double the ammount of weapons, and you also have a free int at the end of the playerstate struct (which means you could bump it up to 32 weapons).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...