Search found 83 matches

by daemon
Sun Dec 16, 2007 5:29 am
Forum: QuakeC Programming
Topic: duplicating prydoncursor's cursor_trace_endpos in csqc
Replies: 2
Views: 1854

duplicating prydoncursor's cursor_trace_endpos in csqc

How would this be accomplished, and still allow fov and resolution changes while functioning correctly in every configuration?

cursor_trace_endpos works perfectly with prydon cursor, but I'm using a csqc cursor, and the math to get this to work seems beyond my scope. I can hack it to work, but if ...
by daemon
Tue Dec 04, 2007 5:37 am
Forum: QuakeC Programming
Topic: Nukes!
Replies: 21
Views: 7565

void(entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage =
{
local float points;
local entity head;
local vector org;


head = findradius(inflictor.origin, damage+40); //makes head equal to the first entity in a radius based upon damage + 40 quake units around the ...
by daemon
Sat Dec 01, 2007 5:21 pm
Forum: QuakeC Programming
Topic: Nukes!
Replies: 21
Views: 7565

Yea, my guess is that is has something to do with all those T_RadiusDamage()s being called at the same time. T_RadiusDamage has a findradius inside of it, which is a kind of loop, and running that many at the same time would probably cause that kind of error. But that's just my guess.
by daemon
Wed Nov 21, 2007 3:39 am
Forum: General Discussion
Topic: ColdHeat
Replies: 232
Views: 65359

i'm pretty impressed with the newer textures. the pants look REALLY tight though. my balls hurt. :shock:
by daemon
Mon Nov 19, 2007 3:53 am
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

This is what I had in mind, but you can use whatever works for you:

void(entity ent, float amount)Frag =
{
local entity oldleader;
local float tie;
oldleader = leader;
ent.frags = ent.frags + amount;

if(!deathmatch)
return;

head = nextent(world);
while(head)
{
if(head.flags ...
by daemon
Sat Nov 17, 2007 10:00 pm
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

another exercise would be to make it check for ties, and then if so sprint to everyone who is tied for the lead instead of sprinting to leader and oldleader.
by daemon
Sat Nov 17, 2007 2:52 am
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

that would prevent anything being printed to the leader or oldleader if EITHER of them aren't clients, which is almost right for part of it.

The first thing you want to do is prevent leader from being set to anything that isn't a client in the loop above that, BUT the first time the function is ...
by daemon
Fri Nov 16, 2007 9:13 pm
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

yes, or the non-string version:

Code: Select all

if(entity.flags & FL_CLIENT)
but where would you put it?

also remember, using strings in loops can be very slow.
by daemon
Fri Nov 16, 2007 5:45 am
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

look more closely at this part of the function, noting that all entities are being looked at here, not just players.


head = nextent(world);
while(head)
{
if(head.frags > leader.frags)
leader = head;
head = nextent(head);
}


then this part, remembering that sprinting to a non ...
by daemon
Fri Nov 16, 2007 4:45 am
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

oldleader is a local entity created each time the function spawns, defaulting to world, then once set by "oldleader = leader" oldleader will be the current leader. the global entity, leader, defaults to world at the begenning of the game, and when the function is called and leader is world ...
by daemon
Fri Nov 16, 2007 3:30 am
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

correct, but since the if() leads to more than one line, don't forget the brackets.

now on to questions 2 and 3
by daemon
Thu Nov 15, 2007 4:40 pm
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

it wouldn't crash in DP, but you would definatly get an error message. good point. I'll see if anyone else can spot this :)
by daemon
Thu Nov 15, 2007 6:46 am
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

you could also move the first two lines below the deathmatch check to make the code slightly more effecient.

redrum: is there any specific part of that code you'd like explained in more detail?
by daemon
Thu Nov 15, 2007 4:06 am
Forum: QuakeC Programming
Topic: attaching csqc entities to the hud
Replies: 3
Views: 2218

Seems to be working in DP. :D

...but with pespective 0 I can't seem to get entities to draw.
by daemon
Wed Nov 14, 2007 5:34 pm
Forum: QuakeC Programming
Topic: "You've got the lead"
Replies: 32
Views: 10479

Ah, we're using different codebases, but that doesn't matter. Just replace those lines where .frags is added with Frag(ent, amount);

ent being attacker or attacker.owner, and frags being the amount of course.

I also just noticed you lose some frags in ClientKill(), so you might want to change the ...