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
Haxxing 
OK, that's an explanation I understand. I expected some kind of hack here, and tricking the game into "thinking" you are picking up a weapon for the first time during weapon cycling is pretty much that.

One thing to keep in mind: Even the shotgun replacement uses ammo (cells). There is a function which sets its ammo to 1 even if the counter reaches 0, but if you use the Friend Maker which uses the same ammo type, 0 cells are still possible. Shrak in fact does not have any weapon without ammo requirement, even the tools in the axe slot can run out. This might be a problem since the general function structure from original Quake is maintained.

What could be a possible solution besides commenting out that flash function entirely? The way you describe it, only a sufficient delay while switching can bridge that gap. TBH that excessive flashing during switching looks stupid anyway, fast switching would be more important. 
 
The easiest solution would be to put a counter in that infinite loop, and exit if it reaches a high number like 100, assuming that if you reached that high you have exhausted all options. Not super elegant but I don’t see any downsides. 
 
What if you put a delay before Impulsecommand() which is higher than the nextthink delay from flashWeapon (time+0.1)? It would slow down weapon cycling, but it would make sure to avoid the situation with no weapon available. That is a poor approach however and I'd rather comment out that useless flashing thing. 
To Clarify 
By "ammo requirement", I really meant "ammo requirement within that function" - it's the only weapon which doesn't set the am flag to 1. This in effect means lack of ammo doesn't prevent you switching to the weapon, separate from any ammo requirement for actually attacking.

In theory one approach to fix the bug would be to have a second field called items_borrowed. While an item is being blinked off, you store it in items_borrowed (and remove it from there when you put it back into the regular items field). Then in all the weapon selection code you check if the weapon is in either items OR items_borrowed. Lot of effort to preserve a not particularly useful effect... 
Main Thing Is It's Done 
Indeed, it's a useless feature. Since it's only causing issues and contributing nothing to actual gameplay, I decided to just remove the entire function from the code and be done with it. In return you now have super-fast weapon switching without any risk of triggering crashes.

It's interesting that Matt Walsh had apparently been kinda aware of the problem since he implemented a delay timer in ImpulseCommands. However, he placed it in the wrong position within the code and it wasn't working very well in any case. In 1996, available hardware was probably not capable of such fast input which would allow you to send impulse commands in rapid succession, but nowadays mousewheel abuse is entirely possible.

One way or the other, thanks a lot for helping me to figure out what was going on here, guys! I am a bit proud of myself since I was at least able to find the exact location of the error. For someone without any previous QuakeC knowledge, I consider it quite an achievement. 
Another Simple Thing 
Is it possible to check whether a file exists (e.g. a certain bsp file inside a pak) - and if so, how (ofc)? 
Posts Marked As Spam At Ijazz's Request. 
I presume they'll be happy for discussion on the issue to continue so I've requoted the bulk of the post here:

So now I migrated to Rubicon Rumble Pack's code.With some of my changes.

I have some questions.Again.

1.How do I add a weapon? All the bit values upto 8388608 are used.And I tried 16777216 but it doesn't seem to work.

2.How do I do that subtraction thingy with self.items?
How does it work,anyway?

3.I checked out the Keep mod by QMaster,and it has a self.items2.What is the self.items2?
How do I add it in my mod?

I know I can just do a .float self.items2,but how can I manipulate it?
 
Lol 
 
Any Luck Extracting Qtest1's QuakeC? 
I've given a whole bunch of decompilers a try on qtest's progs.dat, and none work. I expect the underlying format/C structs to have changed. Has anyone done this successfully?

So far tried:

proqcc
deacc/reacc
frikdec
unqcc 
Hey Matt 
I'm making a new Q1Test mod for single player. The progs.dat for Q1Test differs , so far as it is only used for deat match game.

I have them ready, and I'm adding a SP with the original monsters.
Decompiling with fte would be an option. 
Here 
 
and sofar for my version..,
Q1Test_Sp 
Q1Test Progs.dat Decompiled 
Is http://home.kpn.nl/lo2kf8/quake/Q1test_src.zip a decompile of the original, or is this self-made attempt to recreate after the fact? Wow! Which version of FTE did you use to make the decompile work?

You are a true saint!

I examined the progs.dat in a hex editor, and it appears to have entries for the monsters. So it seemed we could reverse it an peer back into time. 
Checkoff 
Quaketastic can give you more info about the content and purpose of Q1test. There was never an official release of the Q1testQcc.

The breakpoint is that a compiler can't find the starting progs.scr. So it stops at that point. I recollected the bits after looking at the animation frames and comparing with the original code.

As the readme says it was only a try out to see if the internet connections were OK. So the added Sp monsters are lame as used for DM, aside they were included.

My idea was to add the monsterplay for Sp, add a qc for the Serpent, Vormit and ClassicOgre and make it compatible with the other monsters in SP. The result is Q1Test_SP. I would apreciate if you take a look at it.

Megalol also did a start with a convertion for it some years ago. 
 
Thank you for both the explanation and the attention to detail you paid in recreating/restoring this. I am really impressed with your work.

I am familiar with original QTest from the '90s and my childhood. Mostly what I was interested in was trying to ascertain a deeper understanding of what the actual single player game might have looked like from a https://tcrf.net/Proto:Quake_(PC)/Qtest1 perspective. The history and intent is really the past I am fascinated about. I recall (it's years) the original "Quake 2" comment stubs in the original QuakeC. These felt nuts in retrospect to see, "guys, you're not even done with the first game; what are you thinking?"

I was thinking about doing something to the effect of a unified diff https://en.wikipedia.org/wiki/Diff of the extracted QuakeC from QTest versus the QuakeC from the original v1.01 dump. Of course a fair bit of noise would exist due to code reflowing and comments. I don't suppose anyone ever made a automatic formatter for QuakeC á la https://blog.golang.org/gofmt? ;) 
Grenade Bounce On Downward Slopes Fix In QuakeC 
4LT posted this in discord:

Well, the grenade fix seems to be working as it should now. You can patch it into your mod now, you just need to add this file to your project, patch GrenadeTouch and OgreGrenadeTouch to call GrenadeHandlePhysics (don't forget forward declarations!), and be sure to check the source to make sure we're not trampling eachother's entity fields.

https://github.com/4LT/qc-necrotelecomnicon/blob/master/grenade_fix.qc 
1 More Thing 
Forgot to mention, you'll also need to snag the "reflect" function from math.qc

But, you'd figure that out soon enough I suppose. 
HELPLZ 
How can i use waterjump end of the ladder 
Simple Modding Help 
I want to make a Quake mod, and I just need to change a few simple things but I'm having major trouble finding any info on how this is done

I want to make a texture wad, I want to change the player's speed in game, so that when people play my map's they don't have to go into the console and slow the player down themselves, and I want to edit weapons, mainly the axe and shotgun, any good guides I should find? 
 
For making texture wads I should use progs like Texmex or Wally. Changing a player's movements are more like a qc matter. It are two different archivements. One is mapping, the other is code modding

You can find a lot of info on quakewiki. But as I think it takes some time to make the workaround your own. 
 
LB79, you can change the player's speed in your mod by just adding cl_forwardspeed [value] and cl_sidespeed [value] commands in an autoexec.cfg or quake.rc file. 
Tribal: (response From Other Thead) 
THe thing that stands out to me is this line:

parm9 = self.armortype = 0.3; //this is the green armor type

First, you should not be assigning to self.armortype here, just assign to parm9.

Second, armortype parms need to be multiplied by 100 when stored to parms, so you should do

parm9 = 30;

(they get divided by 100 in DecodeLevelParms)

Try that and see if it helps. 
@metlslime 
Thank you again!!! I'll try this! :) 
@metlslime 
It's me again!

The "parm9 = 30;" works like a charm :)

You're awesome! 
Something I Had Been Asking In The QS-Spiked Thread 
I am trying to make a kind of countdown timer display for powerups in CSQC (for Quakespasm-Spiked). The idea is to have five transparent overlay images for the powerup icons (Quad, Ring of Shadows etc) which cover more and more of the icon when a powerup moves towards expiration.

One of the many things I tried:

if (autocvar(cl_pwrtime, 1) == 1)
PowerupTimer();

I added this function above it:

static void PowerupTimer()
{
entity ptimer = spawn();
ptimer.nextthink = time + 5;
ptimer.think = PowerGFX1;
ptimer.nextthink = time + 5;
ptimer.think = PowerGFX2;
ptimer.nextthink = time + 5;
ptimer.think = PowerGFX3;
ptimer.nextthink = time + 5;
ptimer.think = PowerGFX4;
ptimer.nextthink = time + 5;
ptimer.think = PowerGFX5;
remove(self);
};

And before that (I am not listing all functions, just the first, and only for one powerup):

static void PowerGFX1()
{
if (sitems & IT_QUAD)
drawpic(pos+'272 8 0', "gfx/sba1_quad", '16 16 0', '1 1 1', 0.5, 0);
};

There are two problems here:
- The replacement image doesn't show up ingame. Tried with text (drawstring) and it also won't work.
- I don't know how to port over the vector "pos" (it's used in the function that draws the itembar on top of the statusbar). 
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.