PDA

View Full Version : couple of n00b coding questions.


sroerick
01-14-2004, 01:23 PM
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

Wudan
01-14-2004, 05:00 PM
afaik, it's only for the Tusken NPCs - it's not in the player's weapon set, which is limited to '19' slots, with 19 being used.

sroerick
01-15-2004, 01:01 AM
Actually, im not quite sure, but i know somewhere that ChangRAVEN said that unlike boba's flamethrower, the rifle was player weapon. I may be wrong. Also, i thought that there were something like 26 weapon slots

EDIT: what is afaik?

Wudan
01-15-2004, 01:21 PM
'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.

sroerick
01-15-2004, 04:24 PM
couldn't you just change the

#define MAX_WEAPONS 19
?

I'll try to spawn a tusken if i have the time.

Wudan
01-15-2004, 09:30 PM
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).

razorace
01-18-2004, 10:18 AM
Well, I don't see anything in the playerstate or entitystate net bit transmission files that actually limits this. Assuming that Raven didn't set it to exactly 19 bit, it should default to 32 bit.

Wudan
01-18-2004, 12:20 PM
It is sent as it is defined, to send 32 bits when you only need 19 is not net-friendly. In JK2 it was defined as 16 and sent as 16 ... but who knows?

Only a Raven Dev would know for sure.