#770 posted by necros on 2012/04/07 21:14:32
oh that's right. ouch.
Control
#771 posted by Preach on 2012/04/08 00:41:35
I'd edit your fgd/def file to make other lights default to a different style. I'll admit I've not tried it, so maybe the effect isn't all that dramatic. It sounds like it's one of those things where you could get a good effect in the bsp format, but that maybe the tools for it aren't quite there yet...
Touchy Triggers
#772 posted by necros on 2012/04/20 22:42:52
is there some kind of bug where triggers touching each other can cause a touch function to run on the other trigger?
ex: trigger A and trigger B are touching.
player touched trigger A, trigger A and trigger B both run touch functions.
#773 posted by negke on 2012/04/20 22:59:08
Sounds like you forgot to set the trigger_dont_link flag.
#774 posted by necros on 2012/04/20 23:08:30
you're thinking about door_dont_link.
this happens with just normal triggers.
Joke; Didn't Work
#775 posted by negke on 2012/04/20 23:14:12
Shape
#776 posted by Preach on 2012/04/20 23:14:59
Any chance that it can be because the trigger brushes are oddly shaped, and the resulting bbox shaped triggers end up coinciding? Never heard of an effect like this before, might have to take a look at the map to figure it out.
Another tool that I've only recently begun to use is the pair of builtins traceon and traceoff. Calling the former means that all the QCasm instructions get printed to the console until you call the latter. It's about as close as you can get to a debugger for QC, and a lot of the time it's much quicker than adding a bunch of dprint statements to nail down a bug. Putting them round the touch functions might be helpful.
#777 posted by necros on 2012/04/20 23:22:01
this actually happened in ne_ruins.
it's in that little corridor between the two maps, in the start map, there are a couple of triggers that get fired depending on flags (ie: just entered the map or returning).
except they were both firing until i spaced them 1 unit apart.
i'll have to try out those builtins...
Re Traceon/off
#778 posted by necros on 2012/04/21 00:25:46
yikes... that's a LOT of output.
it'll take some time to get used to reading this.
i suspect it'll be best to turn it on and off sparingly.
Deluge
#779 posted by Preach on 2012/04/21 00:30:29
Yeah, it's not something that you want on functions running many times a second,it might be necessary to turn it on right after the basic touch rejection code. The thing I found it best for was when I have a function with lots of if branches, and needed to work out which ones it was taking or rejecting.
Unsolicited Advice
#780 posted by Preach on 2012/04/22 15:47:03
Suppose that you are writing a mod which other mappers will use, and you want mappers to be able to control a parameter. In this post I will use corpse-duration in a corpse removal system as an example. Traditionally if you wanted a global property then you would add a field to worldspawn to set it.
Apart from it being a bit of a waste to add a field to every entity which is only ever read from worldspawn, I think there is a better pattern, which is a bit more powerful. The key use-case is a property which a mapper might want to vary as well as set initially. Corpse lifetime arguably fits this criteria, for example: during a large horde combat you might want to remove corpses faster than the rest of the map.
My suggestion is to create a new entity function as follows:
float corpse_duration;
void() set_corpse_duration =
{
��corpse_duration = self.count;
��if(!self.targetname)
����remove(self);
}
Then the way to set the corpse_duration initially is adding a point entity with classname set_corpse_duration and count equal to the desired duration.
Can any of you keen entity hackers see how we change it dynamically? Well, we set up an entity with the desired count, but with "classname" "info_notnull" and "use" "set_corpse_duration". If we set a targetname then every time we trigger this entity it sets the corpse duration. If you want to codify it as less of a hack you could invent a new classname for this kind of entity like set_dynamic_property, but it doesn't need any supporting code.
The remove(self) bit of code is a bit ugly, but it makes sure that initially setting the property doesn't cost you an entity, yet the info_notnulls can be used multiple times.
Mismatched Flags
#781 posted by sock on 2012/04/23 01:59:24
I am trying to query a monster to see if the current enemy has an artifact enabled. I am using (self.enemy) and I checked to see if it a player. I query the flags (self.enemy.flags) and it does not show the player flags properly. I tested this by using an artifact routine (void() powerup_touch) to print to the console what it was doing and it produced a different flags value.
I double checked the classname field and other player variables and it is certainly looking at the same entity, except the monster query will not show the content of the flags correctly.
Is there something strange about queries with the player flags?
#782 posted by necros on 2012/04/23 03:02:29
what value are you seeing? how are you querying for flags? flags must be checked via bitwise operation (self.enemy.flags & FL_CLIENT) will return 1 (true) for the player.
are you saying you do the above operation and it returns false when the monster is angry at the player?
also note that players gain and loose flags a lot during play, godmode, notarget, onground, partialground...
Fixed
#783 posted by sock on 2012/04/23 05:35:19
I was mixing up .item and .flag queries. I was too tired to see the difference and could not understand why. doh!
Ideas/tutorials For Useful Entities...
#784 posted by wakey on 2012/04/25 00:26:40
to add to progs.dat.
I'm quite the noob when it comes to coding.
Included misc_model entity from a old tutorial, but that was just copy/paste and compile.
For example i would love to have such swinging door's/ pushable func_rotate things like in ne_ruins.
Googled, found no tutorial for that yet, and dont know what other stuff could come handy.
Suggestions?
Inside3D Is The Place For Everything QC
#785 posted by negke on 2012/04/25 10:48:57
They have a forum and a set of tutorials on the site.
necros code is a different matter. I think it's part QC and part evil arcane magic, or something.
QC Beginnings
#786 posted by Kinn on 2012/04/25 12:39:37
For example i would love to have such swinging door's/ pushable func_rotate things like in ne_ruins.
If this is your first foray into QC I would forget all that stuff and just start small. Most of the QC tutorials you can find online are the "make a grunt shoot rockets"-type stuff but they will help you learn the basics.
The sort of stuff necros does (pseudo-physics movers and whatnot) is not going to be achieved with copy and paste.
#787 posted by necros on 2012/04/25 19:01:18
this is from last year, but i haven't really done much to the pushable rotaters since then anyway.
http://necros.slipgateconstruct.com/temp/ne_rotation_pushableRotaters(17.12.11).qc
i doubt it will work by plugging in, and it should be obvious it requires the hipnotic rotation code, but you can at last see what's going on. it also needs a lot of work still-- there is no implementation for other axis of rotation because those must factor in gravity.
overall, the concept is pretty simple: the movewalls have a touch function now that takes the speed that the player touches them with and dumps it into the rotators which then decays that speed over time. there's more to it of course, like translating velocity into angular momentum and such, but i'm not going to explain the whole thing. i think i've posted about it before, but i forget where.
for coding qc:
knowing about unit vectors, dot product, normalizing vectors, reflection, etc... (but you can always google this stuff up and learn it on the spot if you are not averse to that)
if you know some physics, that can help too, but you don't need to be a rocket scientist. (wow, when will that saying get old? maybe it already has...)
Thx Necros & Negke
#788 posted by wakey on 2012/04/25 20:36:21
for the code & link.
Looks very complicated for me, but the concept sounds logical, hopefuly i will learn enough about qc to understand the code eventualy.
Let's see what i will find on inside3d :D
#789 posted by necros on 2012/05/04 01:56:14
um.. what is trace_plane_dist?
the name implies it's the distance to the plane it hit, but after testing, i was seeing very strange values being returned, some in the thousands from a short 80 unit trace.
#790 posted by necros on 2012/05/04 05:48:51
a bit more testing... seems to be the distance from the origin based on the axis of the plane, so a trace on a face on the y/z plane returns distance from origin along the x axis.
non-axial planes returns strange values, some kind of combination of the different axis based on the slope of the plane?
It Is Probably The Plane Distance Using The Plane Normal
#791 posted by czg on 2012/05/04 08:36:56
http://mathworld.wolfram.com/HessianNormalForm.html
You can define a plane in 3D space using its normal vector and distance from origin (in the direction of the normal)
#792 posted by necros on 2012/05/04 18:59:43
thanks for clearing that up. :)
#793 posted by necros on 2012/05/11 20:01:03
is there any way to 'reset' frame aliases back to 0?
or is making a new qc file the only way?
Compiler Extensions
#794 posted by Preach on 2012/05/11 21:04:56
QTEQCC supports resetting the frame aliases using
$framevalue 0
(literally, the keyword is framevalue)
The need to make an extension suggests it can't be done normally.
|