@text_fish - Custom Intermission
#3108 posted by
Preach on 2023/06/05 19:36:04
Untested code! This should be easy to patch into most mods:
1. Open client.qc, and look for the definition of info_intermission. Replace it with the following:
/*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16)
This is the camera point for the intermission.
Use mangle instead of angle, so you can set pitch or roll as well as yaw. 'pitch roll yaw'
*/
string custom_intermission;
void() info_intermission =
{
if(self.message) {
custom_intermission = self.message;
}
};
2. Scroll further down client.qc looking for the comment below. Insert the code in bold
//
// run some text if at the end of an episode
//
if (custom_intermission)
{
WriteByte (MSG_ALL, SVC_CDTRACK);
WriteByte (MSG_ALL, 2);
WriteByte (MSG_ALL, 3);
WriteByte (MSG_ALL, SVC_FINALE);
WriteString (MSG_ALL, custom_intermission;
return;
}
else if (world.model == "maps/e1m7.bsp")...
Now you can add a "message" key on the info_intermission entity, and it will come up as the end text for the level. Note that if you have multiple info_intermission entities and give them [i]different[/i] messages, one message will overwrite all the others, and will display regardless of which viewpoint gets selected.
Spot The Error!
#3109 posted by
Preach on 2023/06/05 19:38:23
Missed out a closing brace there.
WriteString (MSG_ALL, custom_intermission);
This is the kind of deliberate error Raymond Chen would put into a solution to make sure the recipient has their brain engaged. I'm not as cunning as he is though, it's just an honest mistake on my part...
Preach
Here's how ILike80sRock did this for progs_dump: Allows for multiple pages. Would be interested in your feedback... just cuz.
https://github.com/progs-dump-dev/progs_dump/blob/main/qc/intermission.qc
Code Review
#3111 posted by
Preach on 2023/06/11 00:41:49
Hi dumptruck! It all looks good to me. It's aiming slightly higher by allowing for multiple pages of intermission text in a sequence. That explains why the code is a bit more complex than mine, and why the design requires a separate entity type to hold the pages.
That said, I'm proud of my solution as far as it goes. It wanted to be concise enough to fit into a func_ post, so I didn't add any bonus features. And I tried to create it as a "patch" that could be integrated into nearly any mod, so I aimed to make the edits:
- at as few points as possible
- at points easy to find regardless of how much the mod changes client.qc
- as small as they could be
Wow
#3112 posted by
Text_Fish on 2023/06/11 16:12:14
Thanks Preach that looks awesome, I'll try it out as soon as I can.
Respect.
Thanks!
Your insights are greatly appreciated.
Orge Doesn't Drop A Backpack With A New Ammo Type - Using Copper
#3114 posted by wuunds on 2023/09/04 01:37:23
Hi there, I got a small problem. I've been working on my own gameplay mod that adds onto the gameplay changes Copper adds, one of them being that the Grenade Launcher and Rocket Launcher uses their own ammo types (Grenades and Rockets).
I have the ammo working perfectly but I wanted the Orges to only drop the new Grenade ammo and *not* Rockets. So when I went to change the ammo they drop and tested it out, they don't drop a backpack at all. I tested other ammo types and got similar results... it only seems like they only like dropping backpacks if they ammo is set to Rockets. Any help I could get with this?
Grenade Advice
#3115 posted by
Preach on 2023/09/07 18:57:42
Hi wuunds.
I'd take a look at the DropBackpack function - one of Quake surprisingly consistent details is that the same function is used for both monsters and players dropping all their ammo. The very first check in that function is whether the total ammo of monster/player is zero or not. You will need to modify this to include the count of grenades.
This should make the ogre drop the backpack. However, you will probably also need to make related changes throughout the backpack code. Make sure that the number of grenades is copied into the backpack when it spawns. Also make sure that when a backpack is collected it makes the second transfer from the backpack to the player.
As a general tip, try doing a global search for ammo_rockets in the codebase, and see what you find. You may discover there are more spots where you need to add a case looking at ammo_grenades to avoid a bug.
Base QC Code That Makes Sense To Use
Hi!
I am starting a new adventure in coding, the MOD will be primarly MP but with SP too.
Question is, instead of starting from scratch all the times with 1.06, and then getting crazy to add CTF or bots to it, is there some solid QC code which already contains the basics for Multiplayer, so I can mod that one directly?
I am sure there are already codes to run servers with CTF + ROcket Arena + Bots + whathave you.
Can anybody point me in the right direction?