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
 
gl_subdividesize to 16 maybe? 
Something I'll Do In The Near Future 
...cause right now I'm working on that BFG, but:
I'm planning on doing a Berserk power-up where attack speed is increased by 3 (weapon animation would speed up to reflect that) and ammo consumption divided by 2.
The question is, would such a thing be possible with something similar to SuperDamage? Especially with guns who are tied with their model animations (nailgun, super nailgun, thunderbolt)? 
Combining Shotgun Blasts? 
Was just reviewing the old Qc src here: http://www.gamers.org/dEngine/quake/Qc/combat.htm
the part where it mentions combining shotgun blasts (in T_damage ()), seems to be related to the dmg_take field I was working on earlier. I know there is a multidamage work around on another forum.....but what was the original intent of multidamage? Its spawning an ent that basicly collects the damage and distributes it? 
 
the whole code is designed to reduce the amount of data being sent from clients and servers. instead of sending 50~ damage messages for small amounts, it sends 1 damage message with a large amount. if a shotgun blast hits multiple entities, then multiple damage messages are needed, but they still wanted to collect everything up as much as possible.

as a side effect, it basically lets shotguns gib monsters. 
 
edit: sorry, should have actually looked at the code you were quoting.

this is to make sure the screen tint looks the right brightness.

imagine you took damage from 2 sources in the same frame, A was 50 damage and B was 5 damage.

if you just set .dmg_take to whatever the damage was, and B was processed after A, then you'd take 55 damage but have a very faint red screen effect. 
Necros, Are You Implying Shotguns Gibbing Enemies Is A Bad Thing? 
Going back to my last request, I know one way would be to have a (if BERSERK is active) check for each self.attack_finished, self.nextthink and ammo_counts for each weapons, but isn't there a more flexible option where potential added weapons could just benefit of just a function call, like what vanilla weapons do with the Quad Damage with SuperDamage(); ? 
@Necros 
Yes, I was wondering more about the multidamage function moreso, but you answered both questions, thanks.

I'm futzing a bit with some QC that checks each bullets impact point on the client, and determines a rough "hitlocation" guesstimate based on some code that Muavebib made and posted a long while back. Its counting up the correct number of impacts to each body part ok, however I am also wanting to separate out the possibility its contacting multiple targets.

Basicly Im floating 2 local ents - a,b and c and put this code in the loop if we hit a .FL_CLIENT ent:

if (a == world)
a = trace_ent;
else
{
if (trace_ent != a && b == world)
b = trace_ent;
else if (c != a && c != b && c == world)
c = trace_ent;
}

...it sorta crudely works and isolates the correct trace_ent near the end of the function where I count up location impacts, but I suspect this wont work well on more than 2 clients. Its hard to hit a group of more than 2 usually , but just in case Id like to cover that possibility somehow.

Is it easier to modify the multi_ent in multidamage to do this? 
BFG Help 
So I'm in the final stretch on doing that BFG, and that's its coding.

The idea here for the attack is for the sphere itself to drill through enemies who gib through its direct impact, and to explode against a non-gibbed dying enemy on impact.
During its travel, the sphere would spawn lightning attacks to nearby enemies (let's say 200/250 map units max).
And the explosion impact, instead of generating an explosion radius, would spawn a different lightning attack, one that would last an instant and generate more damage and an impact sprite at the end of the traceline, and its radius would be as long as vanilla thunderbolt.

Thing is, even though I have all the assets in place (models, sounds, sprites for the bfg sphere, big impact, and blast impact) I don't know how to properly code all of that.
I'm following these: http://www.insideqc.com/qctut/lesson-22.shtml http://www.insideqc.com/qctut/lesson-51.shtml
But I don't think I see anything related to "while bfgshot is in world" as a check to launch the nearby-lightning code. 
Think Fast 
The trick is similar to the problem of the looping animation you had previously. You need to create a think function like

void() bfg_ball_think =
{

//insert lightning bolt code here

self.nextthink = time + 0.3; //how often lightning strikes
self.think = bfg_ball_think; //keep repeating
}

Then when you create the ball you need to add

missile.think = bfg_ball_think;
missile.nextthink = time + 0.2;

This gets you lightning shooting out as it flies, which is a good start. 
BFG Help Part2 
Thanks again for Preach's help.

Now, for the lightning blast coming from the impact, the idea is to generate an impact sprite at the end of the lightning line generated. I know trace_endline has a role to this, and this is where the blast sprite function will be called, but I doubt "trace_endline = BFGBlast();" would work, as trace_endpos seems to be more attached to particle work.

Just for reference, here's what I wrote for the entire BFG (not including weapon animation, which aren't made yet): http://pastebin.com/E82MgGTy 
You'll Want To... 
First remove the local variable org from within BFGBlast(), then add an argument so: BFGBlast(vector org) = {...

Then in your code where you do your head finding and t_damage, you can add just after that t_damage() a call BFGBlast(head.origin); to pass the location on to that spawn function for the explosion. In BFGBlast() you'll want to change it from self to be a newent so:

local entity newent;
newent = spawn(); //create new entity to become the blast
newent.origin = org; //set location to the ending of the lightning
newent.movetype = MOVETYPE_NONE;
newent.velocity = '0 0 0';
newent.touch = SUB_Null;
setmodel (newent, "progs/bfgblast.spr");
newent.solid = SOLID_NOT;
bfgexpl1 ();
sound (newent, CHAN_WEAPON, "weapons/bfgblast.wav", 1, ATTN_NORM); 
BFGBlast(vector Org) = {... 
I don't get this part. This sure is not the start of a declaration (and isn't supposed to replace "void() BFG_Blast ="), as FTEQCC pointed out, but you said it's an argument... where should I put it? What should I put inside? 
The Argument... 
The argument goes inside the parenthesis so:
void () BFGBlast becomes:
void (vector org) BFGBlast

OR

void BFGBlast (vector org)

either way you like at the start of your function.

The newent stuff is so you create a new entity for each lightning endpoint effect rather than keep moving only one otherwise if the main blast shot out at multiple targets you would only see the sprite effect on one of them. 
... 
Inside your BFG_Expl function is where you would call your BFGBlast function, rigt after T_damage. Whenyou put head.origin inthe parentheses: BFGBlast(head.origin); you are telling it to use the end position of your lightning as the value of "org" inside your BFGBlast function. 
DP Crash With The BFG 
Thanks for your help QMaster. Now I'm testing it on Darkplaces, I get the gun, I fire it, the charging animation goes on, as just 0.1 second after the orb is fired, it crashes:
http://image.noelshack.com/fichiers/2016/04/1453973467-razenkrauft20160128102949-00.jpg

I also noticed it fired from off-center, somehow.

Here are the codes related to the BFG9500:
http://pastebin.com/5FdLg59C 
Another Thing, Related To Item Slots 
The BFG's item slot is stored at the value of 16777216 (Infantry Gun is 128, Gatling Gun is 8388608), but when I pick it up, both shotguns disappear from my inventory and the original nailgun pops in it. Which value shouyld I put it? 16777216 is nowhere else to be found in defs.qc btw. 
 
Sounds like a integer overflow. 
Ok, So How Do I Fix It? 
 
ALLCAPS - Quake Maps In Unity?! 
Dude I can test shit for you! 
Hmm 
Try changing the line in BFGBlast() from this:

bfgblast1();

To this:

newent.think = bfgblast1;
newent.nextthink = time + 0.100;

and also change effects from self to newent: newent.effects = newent.effects | EF_DIMLIGHT; //gives light to the end point

That might fix it, but I doubt it. 
It Didn't Change Anything, Sorry 
One thing I noticed about the BFG firing off-center is that it seems to be arbitrarely firing at a fixed point, as seen here just before crashing:
http://image.noelshack.com/fichiers/2016/04/1453996496-razenkrauft20160128165312-00.jpg
And it's not the collision that crashes it: it seems like 0.05/0.1 second after firing the orb DP just crashes (I just tested firing against a wall: I could see the explosion sprite appearing just before crashing).
Maybe it has something to do with the lightning bolt continuous strikes checking for enemies?

Anyway, I won't be able to reply in here from now until Sunday, but feel freee to help on my case. 
Found It! 
//head = head.chain; // cycle to next head (entity)

You commented out this line in bfgball think. What this does is cycle through the list of returned entities from findradius until the list is empty at which point head becomes null. Since you don't actually cycle the list, head never becomes null and the code is stuck in the while(head) loop forever...until the engine notices it and crashes to console. 
Whats The Most Complex Monster? 
More a question of how far you can take standard quake that is. But what is / was the most complex monster behavior that has been done or attempted using standard quake? I do know that Arcane added some handy hint nodes if I remember correctly but has there been anything else that is of note when it comes to monster behaviors? 
Skiffy 
I think necros did some pretty badass shit in ne_ruins.

A-star pathfinding, some rather complex boss stuff... 
 
Surely bots have the most complex AI 
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.