#1351 posted by Spike on 2014/06/12 21:20:38
cthon has health (3 on hard, woo) but is not shootable.
monsters that have been killed will have a lingering <1 health value, despite no longer being shootable.
if you're paranoid about players doing exactly enough damage to drop a monster to 0 health exactly, then you might want to test for a longering th_die instead.
#1352 posted by dwere on 2014/06/12 23:09:21
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.
#1353 posted by Lunaran on 2014/06/13 03:22:50
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.
#1354 posted by dwere on 2014/06/14 12:39:55
I went with FL_MONSTER check after takedamage check returns false. Thanks for replies!
Short Post
#1355 posted by Preach on 2014/06/18 09:44:50
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
#1356 posted by Preach on 2014/06/19 02:23:39
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...)
#1357 posted by Spike on 2014/06/19 06:17:58
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
#1358 posted by Preach on 2014/06/19 08:28:31
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...
#1359 posted by Lunaran on 2014/06/19 18:44:26
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.
#1360 posted by Lunaran on 2014/06/19 19:54:44
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
#1361 posted by Preach on 2014/06/19 21:05:36
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
#1362 posted by sock on 2014/06/19 22:29:38
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
#1363 posted by ijed on 2014/06/20 15:40:15
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
#1365 posted by ijed on 2014/06/20 18:58:45
Map were also incredibly epic...
Maps
#1366 posted by ijed on 2014/06/20 18:58:55
...rj's Maps...
Ugh
#1368 posted by Drew on 2014/06/20 23:08:59
Wish those would get released standalone.
Can Somebody Smart Do This Thing But For Scrags.
That looks flocking amazing!
Using FTEQCC
#1371 posted by necros on 2014/06/21 20:08:06
Why is:
void() frame = [ $f1, self.th_run ] {};
not allowed?
error: Type mismatch on redeclaration of self. void (), should be entity
QC Opcodes
#1372 posted by Preach on 2014/06/21 21:30:53
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...
#1373 posted by Spike on 2014/06/21 21:40:42
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.
#1374 posted by necros on 2014/06/21 22:28:30
thanks, that makes sense. :)
Aiming
#1375 posted by ijed on 2014/06/24 15:03:11
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?
|