|
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. |
|
|
Pass Thru Bullets
#2000 posted by Qmaster on 2016/02/05 03:27:22
You should check out the nail piercer code from the AD mod just release, it should help you to see how the nails think/touch when the player has the piercer effect on.
Where Is It Exactly?
#2001 posted by aDaya on 2016/02/05 19:11:45
I found nailpiercer but only for the powerup duration, not the actual code itself. W_FireSpikes only has codes for firing offsets and nailguns switching.
#2002 posted by necros on 2016/02/05 19:47:44
dunno about that code, but the easiest way to me would be to create a new .entity field and store .owner there instead.
then, every time it hits something and you go to do your damage, temporarily swap the entity back into .owner before you call t_damage. then set .owner to be the monster you just hit, making it non solid to the nail.
Yes
#2003 posted by ijed on 2016/02/05 22:07:01
I think that's how Supa handled it in the RMQ code. You need to add it to each thing you want to pass through - grenades probably and rockets maybe.
Also a flag for breakables - this should happen with stained glass but not crumbling bricks for example.
We also made nails go through zombies, but not gib them. Which was fun, but also pretty pointless, with hindsight.
#2004 posted by necros on 2016/02/06 01:45:10
i did that for the fast zombies in ruins! it lets you kill dozens with well placed quad shotgun blasts. :D
i did limit shells and nails to only penetrate once. and nails turn ballistic after hitting the first zombie.
Items2
Someone mentioned the items2 field, which can be used but carefully, as the values you place into it reflect runes showing up in the hud.
[ Also it will have to be floated in a safe place , IE: .float items2; ]
32 = Resist
64 = Strength
128 = Haste
256 = Regen
I believe values < 32 and above 256 up to the max limit would be ok to store some new stuff, but I thought I remembered someone saying something weird happens to the hud if you do that, not sure...
Bfg
@Daya
Note you could also give that bfg ball a purple glow that may look pretty good since its purple already.
When it spawns, make its .effects field = EF_RED | EF_BLUE;
By the looks you are using Darkplaces engine is why I suggest it, if not it wont work.
Also looks like your beams from the orb pass through the targets they zap which is ok, but you could also pickup the end of the traceline where it contacts their hitbox using trace_endpos, then use that as the end point for the beam when you call the effect. I have done that with the Thunderbolt and spawned spark effects there. Not sure if you are already doing that, I didnt look at your code yet, but thought I would mention it.
Thanks Teknoskillz
#2007 posted by aDaya on 2016/02/06 09:59:34
But right now I'd like to focus on that sprites spawning problem and I can't find a damn solution about it. It shouldn't be that hard!
Speaking of which, how was Quoth able to make the explosion particles blue? I wanted to do that but it only made the vanilla explosion particles. And that EXPLOSION2 alternative make the impact look like water splashes.
And I plan for this mod to be playable on most clients (quakespasm, fitzquake and DP for starters) so making DP-only code wouldn't be a good idea.
The Endpoint Is Near?
#2008 posted by Preach on 2016/02/06 17:20:20
In BFG_Blast, it's important to remember that self is still the projectile, not the extra sprite you've spawned at the end of the lightning. This has an impact in two places
1) Where you have the following code...
WriteCoord (MSG_BROADCAST, self.origin_x);
WriteCoord (MSG_BROADCAST, self.origin_y);
WriteCoord (MSG_BROADCAST, self.origin_z);
...it is making sparks at the origin of self, i.e. the projectile, not the endpoint of the lightning. Change this to use org, the vector that you pass to the function.
WriteCoord (MSG_BROADCAST, org_x);
WriteCoord (MSG_BROADCAST, org_y);
WriteCoord (MSG_BROADCAST, org_z);
2) The following line of code is very subtle in its effect:
bfgblast1();
This is actually triggering a think function on self, when you want it to trigger on the newent you've created. Try something like
newent.nextthink = time + 0.01;
newent.think = bfgblast1;
This should improve things.
Quoth uses TE_EXPLOSION2 for the plasma effects, but where you use colour 246 we use 35. Bear in mind that there is a particle limit, and firing several explosions at the same time may well exceed it (you can also hit it if you gib enough monsters in a single second). An alternative would be to go down the lines of a canned mdl animation in the vein of
https://tomeofpreach.wordpress.com/2012/11/21/embers/
Obviously for the particles to be appropriate for a BFG it would need more than just a palette swap, but let me know if that would interest you...
The Explosion Particle For The Blast Now Appears
#2009 posted by aDaya on 2016/02/06 18:49:48
And the Blast sprites appears now, thanks to "setmodel (newent, "progs/bfgblst.spr");" (it was self instead of newent). Thing is, they appear at the target's foot. This maybe points to the origin. Another thing is that when the blast sprite shows up, it skips the first frame and plays it at the end of the animation. Does it has something to do with "newent.nextthink = time + 0.01;"?
The explosion sprite itself still doesn't appear though. I tried
self.nextthink = time + 0.01;
self.think = bfgexpl1;
Similarly to what you suggested for BFG_Blast, but no dice (tried both with self and bfgexpl).
Sprite Animation
Fimg comes in handy working with Sprites [ http://www.insideqc.com/frikbot/projects.php ]
But the issue you have might be because when the ent spawns, the frame by default is 0. So try starting it at frame 1 in the macro code. Otherwise open it up in Fimg, there could be an extra frame in there or the sprite file could be corrupted.
The Sprite File Wasn't Corrupted Or Anything
#2011 posted by aDaya on 2016/02/06 21:45:20
But I changed the animation cycle so that it starts at the last frame and cycles back to the beginning:
void() bfgblast1 = [4, bfgblast2] {};
void() bfgblast2 = [0, bfgblast3] {};
void() bfgblast3 = [1, bfgblast4] {};
void() bfgblast4 = [2, bfgblast5] {};
void() bfgblast5 = [3, SUB_Remove] {};
And the sprite animates properly now. Kind of wierd since the vanilla explosion sprite doesn't have that problem.
Again, Why Would The Blast Sprite Show Up Properly But Not The
#2012 posted by aDaya on 2016/02/07 00:57:40
explosion one? I can't find any issues.
Experiment
#2013 posted by Preach on 2016/02/07 01:07:25
Reset your code to start the frames from 0, then try swapping the filenames, renaming A to B and B to A. If it's still the one at the centre of the explosion which is skipping the first frame then we know the problem is in the code. If it starts being the the sprite on the blasts which is out-of-order then we know it's a sprite file issue.
#2014 posted by Shambler on 2016/02/07 22:56:26
A Quake C Exercise [EDIT]
Posted by Teknoskillz [73.142.34.180] on 2016/02/07 22:38:53
We seem to have alot of good QC coders here, so wanted to see if any are up to collaborating on a new modification for the gibs, where (and heres where its kinda gross :o) ) we give the gibs a .touch field and check for an impact against a solid where we look for vlen (self.velocity) > a certain value, and if its moving very fast and hits say the bsp, we do 1 of 3 things:
1) Make it stick partially in the wall or the ceiling. (sort of like the nails stick in walls mod)
(I believe I have played a Doom mod out there that does this)
2) Same as 1, but make it slide down and or maybe fall off the wall with a seperate think.
3) Create a "splat" effect , either using a new sprite which is sorta a flattened image of the original gib, or perhaps use a decal?
I have no knowledge of decals, not really sure if its possible to use QC for that, as it may be an engine only effect.
Some Answers
#2015 posted by Preach on 2016/02/08 00:01:33
1) Make it stick partially in the wall or the ceiling. (sort of like the nails stick in walls mod)
This is easy. Make this the .touch function of a gib
void() gib_touch =
{
��if(vlen(self.velocity) > 300 && other = world)
��{
����self.velocity = '0 0 0';
����self.movetype = MOVETYPE_NONE;
����self.avelocity = '0 0 0'
��}
}
2) Same as 1, but make it slide down and or maybe fall off the wall with a seperate think.
This will be a bit harder, and I don't think the request is fully specified yet. For example, what happens if the gib hits a ceiling? How about angled surfaces? Sloped up or down?
Regardless of the answers to these questions, there are some concerns which always apply. There's no simple way of determining the facing of the surface we collided with. We could try and traceline backwards but this may be inaccurate in corners. There's also a bug with MOVETYPE_BOUNCE entities moving down slopes just get stuck.
However, in the simple case where we have determined that we've hit a proper wall, one which is not sloped but perfectly vertical, you could probably simulate sliding down the wall quite well by setting self.velocity = '0 0 0' and self.gravity = 0.4.
3) Create a "splat" effect , either using a new sprite which is sorta a flattened image of the original gib, or perhaps use a decal?
Gonna pass on this, there's no actual decal support in normal engines, and there are loads of pitfalls in using sprites.
Preach
#2016 posted by necros on 2016/02/08 03:05:12
if(vlen(self.velocity) > 300 && other = world)
^_^;
Touch Field
One day I decided to peek at trace_plane_normal while in a touch field..and like I thought, it was returning the correct value corresponding to the type of plane it hit, with respect to world. I was using DP of course, but according to Lord Havocs response, it seems like all the other engines would replicate this. Of course give it a try and see.
So if that turns out to be true, then could we not use this to determine the angle we need to align the gib? Im guessing it only makes sense to do this if its a perfectly straight wall or ceiling, but I suppose we could do sloping cielings without a problem. Sloping floors not so important, as that would boil down to more of a rolling effect.
Yes vlen > 300 and touching world is a start. However I might reinforce that code to also cover non world ents which also have a bsp solid, such as exploboxes, doors and I suppose plats that are doors...and I guess buttons.
Heres A Start ...
http://collabedit.com/phw6e
Neat site I think will let us collaborate code.
Would vectoangles of the normal set the angles on the gib correctly?
Er, Yeah
#2019 posted by Preach on 2016/02/08 08:15:26
As necros kinda pointed out, that should read
if(vlen(self.velocity) > 300 && other == world)
You don't want to use things other than the world, because those things might move. This code doesn't attach the gib to a moving object, it just stops it from moving. You might end up with a gib suspended in the air.
Moving BSP Ents
True, however I suppose we could look for that case where its already a movetype 0, and is contacting a bsp != world...or like I have seen in some other code in my travels, somoene had marked the origin it stuck to and used setorigin I believe in the doors think to find it. Maybe more complex, but for now I guess we can think about it for later.
So Where To Begin?
#2021 posted by Skiffy on 2016/02/08 13:35:22
So what compiler to use if I want to start wandering into Quake coding?
FrikQCC 2.0 I read was one of the later versions correct? Other than reading all 2000 posts in this thread which will be a good start I guess.. any more focused coding site for quake? :)
Thanks in advance!
At The Risk Of Being Biased...
#2022 posted by Spike on 2016/02/08 15:40:38
if you're on windows, fteqccgui.
tell it to debug with fteqw and you get breakpoints and other nice debugging stuff.
http://triptohell.info/moodles/win32/fteqccgui.exe
place in your quake directory and set up a file association for .src files so you can easily start/update it etc. making lots and lots of copies also works, but yuck.
imho frikqcc is kinda obsolete now, but there are still people using it, it was good for its time.
if you prefer commandlines/alternatives, there's also (non-gui) fteqcc, gmqcc, or qfcc.
gmqcc is used by xonotic, whereas qfcc is kinda dead and unused.
the bigger issue is which mod you use as a base. that mod may depend upon specific features of the qcc it was written for.
if you're targetting either fteqw or dp, these engines have their own FOOextensions.qc files so that you can quickly get started with their various extensions. note that the inclusion of either of these extension def files does not automatically rule out compatibility with other engines, but you may still find you end up using extensions without realising it, resulting in issues with engines that don't support them.
FTEQCC
#2023 posted by Qmaster on 2016/02/08 18:34:05
Also has support for arrays and other cool stuff that isn't available in standard qcc compilers. I used proqcc.exe for a while, but FTE is the best. It even gives you a warning if you have added variables up too high in your defs.qc file. You can double click errors to open the file right at the error line. It's great.
In And Out Of Water Monsters?
#2024 posted by Skiffy on 2016/02/10 14:16:50
Is this possible? A monster that can swim and lurk in the water but also jump out and follow you on land if you get too close? I would love a big sort of lurker type water monster that stays near the surface and mainly attacks from the water or under water when you are spotted underneath but if you are on the shore it could jump out and maul you / run after you. I find Quake's water to be very empty except for the rot fish :P
|
|
You must be logged in to post in this thread.
|
Website copyright © 2002-2024 John Fitzgibbons. All posts are copyright their respective authors.
|
|