How to stop secret walls and switches from bleeding???

Discuss programming in the QuakeC language.
Post Reply
skite2001
Posts: 17
Joined: Mon Nov 17, 2008 5:40 pm

How to stop secret walls and switches from bleeding???

Post by skite2001 »

Hello,
how can i stop the secret walls/switches from bleeding after i shot them? This really looks a bit unfitting.
Some example:
Image

It seems this is fixed in dpmod, so it can be done via quake c scripting.

regrats and thx
~skitey
Error
InsideQC Staff
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA
Contact:

Post by Error »

sorry, it's been a lil while since I've coded or even posted on here, but let me lend my few cents.

1. just because it's done in dpmod, doesn't mean it's pure qc. every engine out there has new qc builtins.

2. easy. in the trace attack thing where it spawns the blood... you need to check if other (maybe trace_ent)'s classname is the trigger or func name thing.

come to think of it, that probably didn't help.
skite2001
Posts: 17
Joined: Mon Nov 17, 2008 5:40 pm

Post by skite2001 »

Error wrote: 1. just because it's done in dpmod, doesn't mean it's pure qc. every engine out there has new qc builtins.
hmm, sure, but if it DON'T work with the ENGINE and work with a mod, i think its mod releated, or? ^_-
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

Quick stupid fix, for now (but works with players and enemies, PFT as if anyone needs new engine builtins or classname checking):

Add the following before spawnblood in TraceAttack

if (trace_ent.flags)

You can shove that in W_FireAxe too

As for the spikes bleeding, just find spike_touch, shove

if (other.flags)

right above spawn_touchblood( 9); as well as the superspike_touch function below right above spawn_touchblood.

(Most) shootable switches and doors shouldn't bleed now!
skite2001
Posts: 17
Joined: Mon Nov 17, 2008 5:40 pm

Post by skite2001 »

@ leileilol
really nice, even if you say its a "quick stupid fix" ^_-
i think this is better than nothing!
Wazat
Posts: 771
Joined: Fri Oct 15, 2004 9:50 pm
Location: Middle 'o the desert, USA

Post by Wazat »

Typically, SOLID_BSP entities should not bleed. These are walls, platforms, switches, etc, and monsters are not solid_bsp unless your mod is doing some really wacky stuff. So instead of testing that .flags is not 0, you could test if they're not SOLID_BSP. It's less of a hack that way, though my suspicion is that lei's solution will work fine in stock quake (I can't think of any flags that a bsp ent would have, off the top of my head; but I don't like hacks because they can bite you later ;) ).

if(trace_ent.solid != SOLID_BSP) // should it bleed?


One final intuitive solution is .takedamage. Entities with DAMAGE_AIM are typically bleeding things like monsters and players. If something is DAMAGE_YES, it still takes damage, but when a grenade hits it that grenade just bounces off instead of exploding immediately. I think the only entities in the game that are DAMAGE_YES are the ones that should not bleed, i.e. walls and buttons.

if(trace_ent.takedamage == DAAMGE_AIM) // should it bleed?


I hope that helps!
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
skite2001
Posts: 17
Joined: Mon Nov 17, 2008 5:40 pm

Post by skite2001 »

much thx for your reply wazat!
Wazat wrote:Typically, SOLID_BSP entities should not bleed.

if(trace_ent.solid != SOLID_BSP) // should it bleed?
well, whats "typically" in quake? ^_-
using this way, it works "a bit"...always testing at the 1st three triggers at e1m1...
-secret door on the right after start = working
-hidden lift trigger (planet-monitor) to get to the quaddamage = bleeding
-hidden switch above the extendable bridge = working

overall: shooting at secret walls will work, shooting at secret switches will bleed => thats a bit stupid^^

One final intuitive solution is .takedamage. Entities with DAMAGE_AIM are typically bleeding things like monsters and players. [...] I think the only entities in the game that are DAMAGE_YES are the ones that should not bleed, i.e. walls and buttons.

if(trace_ent.takedamage == DAAMGE_AIM) // should it bleed?
hmm...nice...all 3 "test" switches working. no bleeding at all.
I hope this "fix" got no unwanted side effects.
UPDATE
hmm, ok, 1 minor side effect i found^^ used the tutorial for shooting wall zombies at start.bsp...they don't bleed if i shoot them. seems there are 2 different "flags"...1 for walls and 1 for switches/wallzombies...crap
Post Reply