Coding Question: firing thru walls

Feel free to chat about non-Chaos stuff in here.
Post Reply
T-Bone7
Posts: 49
Joined: Tue Jul 15, 2003 4:49 am
Location: Louisiana, USA

Coding Question: firing thru walls

Post by T-Bone7 »

I thought I'd ask the creators of the ERDW this: Is there a way that an instant-fire weapon can fire through walls, and if so, what is it?

If I wanted this for a projectile weapon, I woulda just copied code ;) (asking permission of course)

Anybody know?
Wombats fall from the sky and reality disappears...
neolith
Chaotic Dreams Team
Posts: 1594
Joined: Wed Jan 15, 2003 10:05 am
Location: Düsseldorf, Germany

Post by neolith »

I am not a coder, but wouldn't an easy workaround be to make a really, really fast projectile?
–The biggest trick the devil ever pulled, was convincing the world he didn't exist.–
T-Bone7
Posts: 49
Joined: Tue Jul 15, 2003 4:49 am
Location: Louisiana, USA

Post by T-Bone7 »

Well, I thought about that, but I want instant. I thought I'd try that if I found out there was no easy way to do an instant fire.
Wombats fall from the sky and reality disappears...
jeditobe1
Inactive Chaos Team Member
Posts: 2638
Joined: Mon Mar 10, 2003 11:06 pm
Location: The Dagobah System
Contact:

Post by jeditobe1 »

You would have to make a trace that didnt detect bWorldGeometry (or whatever the setting is for walls/meshes)
I make Darth Vader look like a teenage punk with a lightsaber.
T-Bone7
Posts: 49
Joined: Tue Jul 15, 2003 4:49 am
Location: Louisiana, USA

Post by T-Bone7 »

Trace is a native function....

I'm looking at the instagib rifle code: if it hits a pawn, it inflicts damage and then starts another trace from there. I tried the same thing, if it hits worldgeometry, it traces from there. BUT, it doesn't do anything...

[edit]
Scratch that, it DOES go through walls, but only walls without thickness... ideas?

Code: Select all

function DoTrace(Vector Start, Rotator Dir)
{
	local Vector X;
	
	X = vector(Dir);
	TracePart(Start,Start+X*TraceRange,X,Dir,Instigator);
}

function TracePart(Vector Start, Vector End, Vector X, Rotator Dir, Actor Ignored)
{
	local Vector HitLocation, HitNormal;
	local Actor Other;

	Other = Ignored.Trace(HitLocation, HitNormal, End, Start, true);

	if ( (Other != None) && (Other != Ignored) )
	{
		if ( !Other.bWorldGeometry )
		{
			Other.TakeDamage(DamageMax, Instigator, HitLocation, Momentum*X, DamageType);
			HitNormal = Vect(0,0,0);
			if ( (Pawn(Other) != None) && (HitLocation != Start) && AllowMultiHit() )
				TracePart(HitLocation,End,X,Dir,Pawn(Other));
		}
		else
		{
			Instigator.ClientMessage("You hit WorldGeometry!");
			if ( HitLocation != Start )
				TracePart(HitLocation,End,X,Dir,Other);
		}
	}
	else
	{
		HitLocation = End;
		HitNormal = Vect(0,0,0);
	}
	SpawnBeamEffect(Start, Dir, HitLocation, HitNormal, 0);
}
[/edit]


[edit2]
Nevermind, I don't believe what I want is possible. Thanks for your help anyway... how fast can projectiles go?
[/edit2]
Wombats fall from the sky and reality disappears...
Post Reply