Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Bitrate

Page: 1 of 1
 alexx860
11-24-2004, 12:48 PM
#1
Hi again
I wonder how make the bitrate (not sure of the name), for example :
starting weapon
g_startweaps
SABER : 1
BLASTER : 2
DISRUPTOR : 4
BOWCASTER : 8
for start with saber and bowcaster : 1 + 8 = 9
g_startweaps = 9

thx in advance
alexx
 alexx860
11-26-2004, 9:55 AM
#2
nobody? :(
 razorace
11-26-2004, 2:23 PM
#3
Yep, you got it. however, it's a bit easier if you just use the predefined macros for the weapon bits instead of doing it manually.

IE use something like..

NPC->client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_SABER);
NPC->client->ps.stats[STAT_WEAPONS] |= ( 1 << WP_MELEE);
 alexx860
11-26-2004, 9:17 PM
#4
where are these predifined macros?
 razorace
11-27-2004, 7:59 AM
#5
Uh, in bg_weapons.h, right at the top.
 alexx860
11-28-2004, 2:38 AM
#6
I don't realy understand. I want something like the allowed admins command cvar in JA+, but for weapon.
 razorace
11-28-2004, 6:22 PM
#7
What do you mean by "allowed admins commands"? Exactly what are you trying to do?
 alexx860
11-28-2004, 10:18 PM
#8
"allowed admins commands" was an example.
I want to lets the player(the one who make the server) choose the starting weapon, with a cvar. cvar bitvalue, I dont remember the name..

Thx in advance
alexx
 razorace
11-29-2004, 7:20 AM
#9
Ok, well, that's fairly easy. You'll need to have clientspawn set the client->ps.stats[STAT_WEAPONS] to the value of your cvar.

something like "self->client->ps.stats[STAT_WEAPONS] = yourcvar.integer;"

Note: There is other code in clientspawn that sets the player's weapons and which weapon is initially used by the player. So, you're going to have to study the code to figure out how to add this feature without breaking anything.

If you don't understand what's going on I suggest you google up some quake 3 coding and C tutorial.
 alexx860
11-29-2004, 9:58 AM
#10
OK thanks.
For the other code who set the weaps, I've commented some of them already (i can set weapons manually with self->client->ps.stats[STAT_WEAPONS] = WP_* or something like that)

Thxx
alexx
 alexx860
11-29-2004, 9:25 PM
#11
ok it work :D and how make the player select the first weapon ??

Thx in advance
alexx
 alexx860
11-30-2004, 9:56 AM
#12
because if I type client->ps.weapon = FIRST_WEAPON; ive a blaster and when I change I ve the weapons I've set.
And can I make the game restart when the cvar is changed??

Thxx again
alexx:D
 razorace
11-30-2004, 11:36 AM
#13
This will only change the initial weapons for spawning players.
Page: 1 of 1