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
 
Thanks. I think I'll just add an additional check for a classname (Chthon shouldn't really bleed from a nail) and call it a day. 
 
Monsters become DAMAGE_NO in Killed(), but each monster has 'self.solid = SOLID_NOT' somewhere a couple frames into each death anim.

You could check 'self.flags & FL_MONSTER' in your nail ricochet touch. 
 
I went with FL_MONSTER check after takedamage check returns false. Thanks for replies! 
Short Post 
I promised last week I'd put up an attempt to explain the way the origin key works for brush-based entities. Here's that post:

http://tomeofpreach.wordpress.com/2014/06/18/origin-of-the-entities/

Coming up next: using a nosave variable to (among other things) detect when the engine loads a saved game and run some custom QC. 
Longer Post 
Here's the guide to using nosave to create a LoadGame function that runs only when the player loads a saved game.

http://tomeofpreach.wordpress.com/2014/06/19/save-game-detection/

Also bonus content on how you can create CheckExtension friendly code which allows for cross-engine save file compatibility (hint: it uses nosave again, that's the theme of the blog...) 
 
the noload feature:
float _foo;
will be saved, but not loaded. works with any qcc. this quirk may be useful if you wish to write the extensions the saved game previously expected, for debugging, without causing any issues later. 
Aha 
So it's like the counterpart to the "private fields" trick, which creates a field mappers can't set on your entities by naming the field with a leading underscore... 
 
Quoth for instance uses it to sort out the screen tints for the custom powerups, restore stuffcmds the mapper has applied, and warn you if you load an incompatible save from an earlier version of the mod.

Really?

I've spent a long time thrashing around in qc trying to figure out how to do all of those things.

A big thank you, once again, for keeping the Quoth source closed, so that nobody can learn anything from it until revealed years later on Preach's blog. 
 
Got it working, but I had to use "nosave float" and not "float nosave" like your post says. This is with the latest fteqcc downloaded from the super-secret triptohell moodles directory above. 
Yeah, Well 
There aren't any trade secrets in Quoth, if there's any other features people want to understand just shout and I'll put it on the tutorial list. Thanks for the pointer on the keyword order, I'll fix that in the text. 
QC Blackbox 
There aren't any trade secrets in Quoth, if there's any other features people want to understand just shout

I think you are completely wrong! I have seen CZG, necro, Kinn and metlslime QC files and all of them were amazing sets of code which has made my understanding of QC better. I think you seriously under estimate the value of letting people see a working codebase. Cherry picking examples is all well and good but seeing the whole picture is damn right educational.

For example I would love to see the AI code for a bob from Quoth, I love how they move, shoot and even their crazy death is cool. Another gem I would love to see is the working code for the ladders in Quoth, not text descriptions but actually working QC files.

There are tons of things about Quoth QC that would be awesome to look at and I personally believe the greatest thing you could ever do for this community is let people see what QC tricks you have done. 
Hm 
I should probably post the RMQ qc somewhere.

<Most hated project ever yadda yadda go fuck yourself>

Would any of the people the above didn't apply to be interested in seeing it?

There are some gems in there, like Supa's NPC code and the Shambler lightning attack visual improvement.

Exploding zombies and fast zombies were mine, and pretty cool if I do say so myself :>

I think next map (after I release the current one) will have the exploders in it. 
 
For all its faults, RMQ had some wonderful things in the qc. 
RJ's 
Map were also incredibly epic... 
Maps 
 
...rj's Maps... 
Ugh 
Wish those would get released standalone. 
Can Somebody Smart Do This Thing But For Scrags. 
 
That looks flocking amazing! 
Using FTEQCC 
Why is:
void() frame = [ $f1, self.th_run ] {};
not allowed?

error: Type mismatch on redeclaration of self. void (), should be entity 
QC Opcodes 
In short, because the newthink function has to be determined at compile time for the frame definitions to work.

In long: the [frame, newthink] notation in QC is usually described as a shorthand, but it's actually a bit more than that. When QC is compiled it gets turned into opcodes (like java). Most of the opcodes are pretty generic and normal, but for efficiency reasons that made sense in '96 there's a special opcode which does all the basic monster housekeeping:

* it sets the frame
* it sets the new think function
* it sets nextthink to time 0.1

The only way to create something with this opcode is to use the special [] notation, but once you do, you're locked into using the opcode, and it needs to hardcode the function. I suppose in theory a compiler could treat the [] differently - detect when a dynamic expression has been input and in that case skip the opcode optimisation in favour or writing the relevant QC manually. Might break the principle of least surprise though... 
 
state functions need special handling if only because they're the one place where a variable can be used without prototyping it first.
this means that the qcc is expecting explicitly a function name and not a statement/formula, and is naturally complaining when the name it saw (self) was not in fact a function as required by the opcode.
the .th_run] part of the definition has not been tokenized yet. 
 
thanks, that makes sense. :) 
Aiming 
I've got a large enemy that fires twin streams of projectiles from either hand, each being offset quite a bit from the centre to either side.

The point they aim at has a scattered origin, randomising within a small volume to make the fire pattern more interesting.

In a small test map the enemy works fine, but in my main map it occasionally looks like it's the point of origin and not the point of aim that's getting slightly randomised.

Does this sound like an engine precision issue? 
 
depends how large your projectiles are.
with the vanilla network protocol, origins have 1/8th qu precision.
angles have 1/256th revolution precision

on a large object with offset origins (read: rotating bsp doors), the angular precision can result in significant jerks. this is generally not much of an issue with models though.

if you want to test if its an engine precision thing, try the following engine+cvar settings.
fte: compare sv_bigcoords 0(low/vanilla precision) to 1(16bit angles, 32bit float coords). restart the map for it to take effect.
dp: compare sv_protocol 'quake' (vanilla) to 'dpp7' (16bit angles, 32bit float coords), or whatever it was. not sure what you need to do to actually apply the new setting. 
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.