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
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. 
 
You should get the irctest example working before trying to integrate it into Quakespasm, otherwise you can't be sure you are dealing with a working model.

Btw, your code in Host_Frame will trying ro connect over and over and over again but you may know this.

Yes, the sample code isn't ideal for Quake, because of the design of the loop but the first phase of anything is making sure what you've got actually works.

Taking shortcuts in coding and not doing things proper just leads to massive headaches, so you really need to get the sample working first to verify what you have will even work. 
Shamblernaut 
Got the code compiling on OS X after a bit of fighting with the libircclient configure/makefile.

I think one issue is: if IRC_Connect_f is called with `irc_connect_bool` false, the irc_session variable will be an uninitialized pointer; then this line: "if (irc_is_connected(irc_session) == 0)" will access the bogus pointer, which should crash.

I think maybe you want irc_session to be static?

AddressSanitizer in clang/Xcode will catch this kind of thing; MSVC and recent versions of gcc also have similar functionality, I think. 
Shamblernaut 
For the record, the mainstream libircclient code
at sourceforge.net is at version 1.9, as opposed
to the old fork at github being back at 1.6:
https://sourceforge.net/projects/libircclient/ 
Changing Music Playback? 
So I've been thinking: the game's original code should mention going to the CD drives or the music, so is it possible to reroute the path from the CD drives to a custom one inside one of my mod's directory?
If yes, how can I do it?
I'd like to do that mostly so custom music can be done without dealing with engine-specific music playbacks, like Doom or UT. 
 
Quake has support for a CD --- like an actual CD that plays in a 1990s CD player stored in the CDDA format.

https://en.wikipedia.org/wiki/Compact_Disc_Digital_Audio

Think of the answer as basically no, but if you were really, really determined and had a thing for fiddling with hex editors and old software maybe you could do it, like the guy who made Windows 95 run on his Apple Watch. 
Daya 
Are you talking about tricking a quake engine into reading the "cd data" from a location that's not the cd drive, without modifying the engine?

I don't have a scooby doo how you'd do it, but just wondered if that's what you're asking. 
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.