News | Forum | People | FAQ | Links | Search | Register | Log in
Coding Help
This is a counterpart to the "Mapping Help" thread. If you need help with QuakeC coding, or questions about how to do some engine modification, this is the place for you! We've got a few coders here on the forum and hopefully someone knows the answer.
First | Previous | Next | Last
Source Code For Mission Pack #2? + Other Things 
I had someone test my first schlossherr map, and he picked-up the MegaHealth item in my map, and because they share the same itemslot, he got the BFG as well.

With this, coupled with the fact that I want 2 extra-items after being done with the BFG, I remembered that mission pack #2 had an items_2 thing that lets you store more items. Thing is, my google-fu is weak and I can't find its sourcecode, even in ModDB. Would anyone be kind enough to link me to it?
Another thing, since I'm adding additional weapons, how can I add extra HUD icons?

One last thing, Back when I was asking questions about my BFG problems regarding the projectile penetrating enemies, I recall someone saying something like "destroy the projectile which makes a new one with the same trajectory as the original projectile", but what's the way to pick up those coordinates and use them? 
Source Code For MP2 
I can't seem to find a regular download for the rogue QC either, but I did find a github account with it

https://github.com/bazilio-ua/q1.progs/tree/master/original/rogue/progs

It looks like some modifications have taken place since, but if you track back to the initial commit it's probably how the original files looked. Hopefully...

Another thing, since I'm adding additional weapons, how can I add extra HUD icons?

You only have three options as to how the HUD works. You can have the HUD like it is in vanilla, or the HUD from mission pack one, or the HUD from mission pack two. You can customise the icons themselves, but there is no way of rearranging them or adding more than what the mission packs have. The mission packs got special customisations to the engine code before the source was released, it's not something the QC gives you any ability to change.

Incidentally, items2 was actually introduced in hipnotic, not in rogue, so you want the mission pack 1 source code really! 
Had Rogue's QC From The Start 
Re-looking at it, and I have items2 defined in hip_def.qc (included in progs.def), which begs the question: if it was, then how come I have trouble adding items then? Or should I put my new weapons and items declaration from defs.qc to hip_defs.qc? Or is there something else that I'm missing? 
Progs.src 
Two minor ideas. Firstly, make sure that it's being included in the compilation. Take a look at the progs.src file and check that hip_def.qc is in there.

The other think to think about is that you select between the three HUDs on the command line, not in the QC. So make sure you're using -hipnotic or -rogue on your command line when you launch Quake. Also keep in mind that you need the end users of your mod to remember to do that too! I expect lots of people forget with Quoth and don't see the plasma gun icon... 
Special Brushes Affiliate? (secret Doors, Platforms, Etc.) 
I'm asking what it is so I could properly made the BFG orb for my mod not to target them/make the orb explode on impact on them, and also so I can get around bleeding brushes when you hit them. 
Translated Article, I Cant Find An English One Right Now. 
Highly interesting avoidance of computation using some bytecode string (0x5f3759df)

https://translate.google.de/translate?hl=de&ie=UTF8&prev=_t&sl=de&tl=en&u=http://www.heise.de/newsticker/meldung/Zahlen-bitte-0x5f3759df-merkwuerdige-Mathematik-im-Egoshooter-3208927.html

P.S.

Pay please! should read as numbers please. Stupid headline. 
 
Brush Entities 
I'm asking what it is so I could properly made the BFG orb for my mod not to target them/make the orb explode on impact on them, and also so I can get around bleeding brushes when you hit them.

Clarifying question: You still want the orb to explode when it hits the rest of the world, just not platforms etc? Is there any other exception you want the orb to explode when striking? 
I Want It To Explode On Any Brushes, It Usually Goes Through Enemies 
who get gibbed when hit by the orb, so my guess is that it will go through buttons and doors that need to be shot if I leave it at that.
Speaking of which I still don't know how to remove the orb and THEN create another one with the same XYZ coordinates it got when it was first shot, because leaving at that makes the orb bounce off.

Another thing, I've been trying to clean my weapon cycle code by looking at scourge of armagon's code, but things get more complicated when you have weapons that share the same slot and have different ammo consumption.
My code:
http://pastebin.com/fRKhfLVG
Compilation error message (can't really find what's wrong with the whole oldimpulse thing and all):
http://pastebin.com/cFTRBHVB
Hipnotic's part of the code (just in case):
http://pastebin.com/J7fnWur4 
Daya 
I feel more confused after your clarification. At the moment does the orb

1a) explode when it hits the world - yes/no
1b) explode when it hits a door - yes/no

Would you like it to

2a) explode when it hits the world - yes/no
2b) explode when it hits a door - yes/no

Please delete as applicable. 
Preach 
1a yes
1b yes

Actually I just tested in the first map, and while it targets nearby shootable brushes, it kind of makes for a Power Bomb effect like in Metroid, where detonating one would reveal every secret tiles on the screen, so I think it's something I can leave on (still looking for a solution for those "custom explosion sprite doesn't appear" and "how do I make a new orb that shares the XYZ coordinates after removing the original once it collides with an enemy that got gibbed on direct impact?" problems). 
Man Daya 
There were four question, I still don't understand what part of your post is what it's currently doing and what part is how you want it to be different. 
Alright So 
1. Me being afraid of the BFG orb doing wierd things to special brushes (mostly secret doors, doors and buttons that need to be shot) was a false scare, so we're done with it

2. There's been a talk on the BFG orb ricochetting off a enemy who's been gibbed on direct impact, while the aim was to make the shot penetrate if the target gets gibbed on direct impact, and one solution was to remove the orb and make a new one using the same angle as the first one, to make it seem the orb goes through. I'm looking for how to code [remove orb] and [create new orb with the same coordinates as the first one at the exact same frame it first appeared].

3. When the orb explodes, it should leave a custom explosion sprite, but it doesn't. Wierdly enough, the blast sprite appears.
Code: http://pastebin.com/Q479dGGb

4. I'm currently having a problem with my weapons switching code, because if you have the nailgun or super nailgun in your inventory and press 4/5, it says "no weapons". So I fiddled around while looking at scourge of armagon's code, but when you have weapons that share the same slot AND have different ammo consumption (super nailgun=2 & gatling gun=1 ; Thunderbolt=1 & BFG9500=30) I run into trouble because of scourge's code. And I got a big compilation error for that. I'm also looking for ways of isolating both the "not enough ammo" and "no weapon" code so I can play a sound for each of them.
Compilation error message:
http://pastebin.com/cFTRBHVB
Weapons.qc code:
http://pastebin.com/0G7g8h34
Scourge's w_changeweapon:
http://pastebin.com/0m9X14wP

Hope I've been clear here. 
Fixes 
2. This kind of thing is hard to diagnose without playing around with it, but something to try: After you set velocity on the orb when you first launch it, add a line

self.pos1 = self.velocity;

This saves the velocity it should have.

In the collision code, add the reverse line

self.velocity = self.pos1;

This restores the missile's velocity after a collision. Try it, and remove it again if it doesn't help.

3. Twice in that code you write:

BFG_Expl();
remove(self);

This is setting up the custom sprite, and then immediately removing it.

4. On line 1903 you have forgotten to comment out the bracket. This had made the compiler think that the function is over, so it doesn't understand why you're still talking about oldimpulse. 
Most Things Are Fixed But 
The self.pos1 thing makes the orb full-stop in thin-air when it collides with an enemy who gibs on direct impact.
Is there another thing I could try? 
Update 
That's because the first bit needs to be a bit different to what I said:

bfgsphere.pos1 = bfgsphere.velocity;

is what's needed. In the function where the orb is launched, self is the player and bfgsphere is the orb, so we need to save the value elsewhere. 
Still The Odd Ricochet 
 
# In Quake Compiling 
Hi,

Today I downloaded the Transfusion SDK in order to start up on that project where the dev team left off. The source code comes with their own custom compiler, BQCC (Blood Quake C Compiler) which seems to have some types defined which frikgui.exe does not have.

The problem is, I'm more comfortable with frikgui.exe, because it has a far more sophisticated interface, along with tools for debugging any warnings or errors. Does anyone know what this means--

"Error Q548 common.qh(95) "#" is not a type

Does anyone know how I can make frikgui.exe recognize "#", along with any other types? 
 
Code written with customizations specifically for a certain QuakeC compiler aren't going to compile except for that specific compiler.

So you'll either have to re-write the problematic lines by hand yourself to work with the target compiler or use a compiler that can compile the code unmodified. 
Baker 
Feared as much!
Ok, here I go.
Thanks Baker. 
Quakespasm Coding Help 
Ahoy, so I've been trying to implement IRC support for Quakespasm. I'm trying to get it done for QExpo so that if any streamers want to have their twitch chat in game they can. Or if people want to play and shitpost on #TF or whatever. I've been using libircclient and have had some success but have come to an impasse where I have no idea what to do.

I'm wondering if somebody could look over my code and see if I'm missing anything that could be causing my issues.

I'm running a local server to test, which receives a connection from the game, but doesn't seem to keep-alive, it just times out. I have polling code, that just doesn't get called because the connection is never established.

I'm running linux, so I haven't compiled any libircclient libs or objs for windows, however in the base directory of the archive is a libircclient.o for linux. Which can be copied into the quake (source code) directory for compilation under linux.

Here are the lib irc client docs:
http://www.ulduzsoft.com/libircclient/

And here is the github link:
https://github.com/shaoner/libircclient

Most of the code exists in irc.c, with a few other bits and pieces in other files, a quick search for "shamblernaut" in files will bring up the other files that I've modified.

The thing I most need help with at the moment is figuring out why it isn't connecting. There are other things that don't work, but I'm confident I can get those working myself.

the console commands are:
irc_channel (include #)
irc_nick
irc_server
irc_port
irc_password (default set to "")

these are reflected via cvars saved in config.cfg

the above should be set first before connecting with:

irc_connect (connects with the above settings)

irc_join (sort of moot because it isn't connecting anyway)

At the moment all debugging info is printed to the console, so run from a command line.

Here is the source to my modifications:
https://www.dropbox.com/s/fsnv4y4r0oobswe/quakespasm-0.91.0-irc.zip?dl=0

Anyways, if somebody with some C and engine knowledge could have a look, that would be amazing.

Thanks in advance.

-Snaut 
I'm Selfishly Bumping This 
for a bit more visibility. Has anybody had the chance to have a look? 
 
1) Did you run the example irctest.c and test it against your irc server? What was the result and in the case of failure, the error code or response?

2) What IDE are you are using for debugging, setting breakpoints and stepping through code to look at the values of different variables and checking function results?

The library you are using looks like it requires at least an intermediate understanding of C to be able to use it since it uses callbacks, but if you are able to run the irctest.c successfully you might be able to successfully break it into pieces as-is and put it in the appropriate places. 
Hey Baker. 
Thanks for the response.

So I was using just a text editor without using an IDE. In hindsight that was a terrible idea, so I've installed codeblocks as that is the project file that is included with quakespasm. So far the debugging tools look pretty reasonable.

Strangely the example executable doesn't work for me at all, they aren't even recognising the inputs from the console... weird.

Unfortunately the irctest application isn't ideal as it uses a loop function that freezes quake. It doesn't exit the loop once it has entered it. Instead the documentation suggests a select loop which I've added to my code.

The problem is way before that though, the select loop doesn't even get the chance to run, as it only does that once the connection is completed, whereas the app makes a connection, but refuses to keep alive. My IRC server spits back a timeout error.

I'll keep digging with the debugger, if you have any ideas I'd love to hear them. 
1 post not shown on this page because it was spam
First | Previous | Next | Last
You must be logged in to post in this thread.
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.