|
Posted by metlslime on 2007/08/08 04:57:56 |
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. |
|
|
Different Weapon Pickup Sounds Crashes Quakespasm
#2110 posted by aDaya on 2016/04/22 14:13:58
For my mod, I made sure that each weapon pickups have their own sounds. Same thing for armors and ammo boxes.
It works without a problem on darkplaces, but picking a weapon in quakespasm stops the current game and displays this:
http://image.noelshack.com/fichiers/2016/16/1461326522-spasm0000.png
Here's my code for armors:
http://pastebin.com/7DywCzPm
My code for ammo boxes:
http://pastebin.com/eKKZUVqu
And finally, my code for weapon pickups:
http://pastebin.com/Mwr4NtnG
As you can see, I used for all of them that "self.noise" trick that allows me to add different sounds for each items.
I find it wierd because picking up ammo boxes with that method in quakespasm doesn't crash it, even though they use the same technique. At first I thought that was because the whole "self.noise" root declaration was put after all the individual weapon pickup lines, while it was put before for the ammo boxes. So I tried to do that for the weapons, but while testing in darkplaces the weapon pickup sounds don't play.
#2111 posted by metlslime on 2016/04/22 20:32:11
you need to precache sounds in the spawn functions, not the touch functions. Your armor and ammo code are doing it correctly. Your weapon code is doing it wrong.
Thanks, It Worked!
#2112 posted by aDaya on 2016/04/22 21:44:59
Source Code For Mission Pack #2? + Other Things
#2113 posted by aDaya on 2016/04/24 21:28:29
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
#2114 posted by Preach on 2016/04/24 23:25:31
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
#2115 posted by aDaya on 2016/04/25 00:51:09
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
#2116 posted by Preach on 2016/04/25 18:26:05
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.)
#2118 posted by aDaya on 2016/05/16 14:26:35
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.
#2119 posted by mfx on 2016/05/17 21:45:28
#2120 posted by mfx on 2016/05/17 21:47:50
Brush Entities
#2121 posted by Preach on 2016/05/18 00:35:26
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
#2122 posted by aDaya on 2016/05/18 14:58:26
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
#2123 posted by Preach on 2016/05/19 18:44:26
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
#2124 posted by aDaya on 2016/05/19 21:09:49
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
#2125 posted by Preach on 2016/05/19 22:46:25
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
#2126 posted by aDaya on 2016/05/20 00:56:15
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
#2127 posted by Preach on 2016/05/20 07:54:44
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
#2128 posted by aDaya on 2016/05/20 11:20:26
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
#2129 posted by Preach on 2016/05/20 17:47:48
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
#2130 posted by aDaya on 2016/05/20 20:59:34
# In Quake Compiling
#2131 posted by Ruin on 2016/06/13 06:31:40
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?
#2132 posted by Baker on 2016/06/13 07:15:54
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
#2133 posted by Ruin on 2016/06/13 07:53:32
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
|
|
1 post not shown on this page because it was spam |
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|