Is there a way that I can use targ, and attacker in PlayerPostThink?
I put them in defs.qc, it compiled albeit with a bunch of warnings.
But didn't work. Any ideas would be appreciated. Thanks!
targ, and attacker?
targ, and attacker?
Welcome to the Overlook Hotel: The-Overlook-Hotel.game-server.cc
I think that's the only way:
declare in defs qc something like this:
And then, remove the parameters between the parenthesis (dunno how it's written) from T_Damage() and T_RadiusDamage() declared in combat.qc, remove from other declarations and calls.
And a damaging function should be like this:
Projectile weapons:
Instant weapons:
Use T_RadiusDamage() if you want an area damage.
If you receive errors or warning try playing around with declarations with the same name, but if you're about to break your keyboard or you don't know what you're doing just ask.
declare in defs qc something like this:
Code: Select all
entity targ, inflictor, attacker;
float damage;
And a damaging function should be like this:
Projectile weapons:
Code: Select all
attacker = self.owner;
inflictor = self;
targ = other;
damage = X; // any number here
T_Damage ();
Code: Select all
attacker = inflictor = self;
targ = trace_ent;
damage = X; // any number here
T_Damage ();
If you receive errors or warning try playing around with declarations with the same name, but if you're about to break your keyboard or you don't know what you're doing just ask.
Charles Babbage was famously asked if you gave a computer the wrong input, would it still give the correct answer? He replied "I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."The same kind of confusion is probably why you haven't received much help on this question today.
The problem is that the idea of a targ and attacker don't make sense outside of a bit of code dealing with an attack from a missile or weapon. By the time you get to PlayerPreThink all attacks from the last frame have already been evaluated. So it's not clear what values you'd expect targ and attacker to take. If you just wanted them to be the last people to attack/be attacked in the last frame, what about the case where two people got damaged by the same rocket explosion. How would your code cope with that case? It would really help if we knew what kind of thing you were trying to do with targ and attacker, as then we could point you more on the right lines.
The problem is that the idea of a targ and attacker don't make sense outside of a bit of code dealing with an attack from a missile or weapon. By the time you get to PlayerPreThink all attacks from the last frame have already been evaluated. So it's not clear what values you'd expect targ and attacker to take. If you just wanted them to be the last people to attack/be attacked in the last frame, what about the case where two people got damaged by the same rocket explosion. How would your code cope with that case? It would really help if we knew what kind of thing you were trying to do with targ and attacker, as then we could point you more on the right lines.