|
QuakeZone MOD Coding Tutorials
|
|
|
Introduction Pre-requisites Code Notes Exercises |
|
| Introduction |
|
|
Related Links
15 Teamplay Enhancements 16 Display Team Info on screen 18 Team Weapon
| This tutorial buildon the previous tutorial, 18 Team Weapon, and shows how to display each team's weapon on the detahmatch scoreboard and the player's hud. |
| Pre-requisites |
|
|
| Code |
|
|
q_shared.h Add the folloiwng line as indicated: #define STAT_TEAM_NAME 23 // PJT - team play - team name <-- locate this line #define STAT_TEAM_WEAPON 24 // PJT - team rail - team weapon <-- insert here #define MAX_STATS 32 p_hud.c Insert the following lines below as indicated: 1. in DeathmatchScoreboardMessage, make the following additions: char *tag; char *weapon; // PJT - team rail - weapon string <-- insert then locate the team 1 code...... // team 1 // PJT - team rail - weapon <-- insert here if (team_table[1].teamrail == 0) weapon = "[Rockets]"; else weapon = "[Railgun]"; // PJT <-- end of insert Com_sprintf(entry, sizeof(entry), "xv 32 yv -16 string \"%s\" " "xv 216 yv -16 string \"%4i\" " "xv 256 yv -16 string \"%s\" ", // PJT - team weapon <-- insert team_table[1].name, team_table[1].score, weapon); then locate the team 2 code...... // team 2 // PJT - team rail - weapon <-- start insert if (team_table[2].teamrail == 0) weapon = "[Rockets]"; else weapon = "[Railgun]"; // PJT <-- end of insert Com_sprintf(entry, sizeof(entry), "xv 32 yv -8 string \"%s\" " "xv 216 yv -8 string \"%4i\" " "xv 256 yv -8 string \"%s\" ", // PJT - team weapon <-- insert team_table[2].name, team_table[2].score, weapon); // PJT - team weapon <-- insert 2. at the end of update_hud_rockets, add the following lines: // PJT - team rail - team weapon <-- start of insert ent->client->ps.stats[STAT_TEAM_WEAPON] = CS_TR_STRINGS + 44 + ent->client->resp.teamrail; // PJT <-- end of insert 3. at the end of init_hud_rocket_strings, insert the following: // PJT - team play - team scores <-- start of insert gi.configstring (CS_TR_STRINGS +44, "[Rockets]"); gi.configstring (CS_TR_STRINGS +45, "[Railgun]"); // PJT <-- end of insert g_spawn.c Add the following lines as indicated: 1. Locate the dm_statusbar string and amend and add the following lines as indicated: // PJT - team play - team name(23) "xr -300 " // PJT team weapon <-- amend this line "yt 20 " "string \"Team\" " "xr -252 " // PJT team weapon <-- amend this line "stat_string 23 " // PJT // PJT - team rail - team weapon(24) <-- start of insert "xr -100 " "yt 20 " "stat_string 24 " // PJT <-- end of insert |
| Notes |
|
|
q_shared.c
p_hud.c
g_spawn.c
|
| Exercises |
|
|