CoD2: firing through walls

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

CoD2: firing through walls

Post by IzNoGoD » November 28th, 2010, 6:35 pm

Hey guys
Q: Is it possible to make some kinda script to fire through walls?
A: Sure is. Check vid

Vid (click me!)

Well, thats all for today.

Teasers FTW
LMGTFY!

Its not a glitch... Its the future!

User avatar
Rezil
Core Staff
Core Staff
Posts: 2030
Joined: July 24th, 2006, 11:21 am
Location: Cramped in a small cubicle/making another jump map

Re: CoD2: firing through walls

Post by Rezil » November 28th, 2010, 6:37 pm

You are insane in an awesome way sir.
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: CoD2: firing through walls

Post by Drofder2004 » November 28th, 2010, 8:53 pm

Very nciely done.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: CoD2: firing through walls

Post by IzNoGoD » November 29th, 2010, 8:15 pm

More teaser stuff:
MORE TEASERS!!!!!!
LMGTFY!

Its not a glitch... Its the future!

Pedsdude
Site Admin
Site Admin
Posts: 15909
Joined: October 15th, 2004, 7:18 pm
Location: UK

Re: CoD2: firing through walls

Post by Pedsdude » November 30th, 2010, 2:43 am

Shame it's a few years too late :(
Image
Image

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: CoD2: firing through walls

Post by IzNoGoD » November 30th, 2010, 5:42 pm

Update:
Firing through multiple walls works now.
Todo:
balance damage and maxwall distances
do some bulletspread :P
LMGTFY!

Its not a glitch... Its the future!

User avatar
waywaaaard
Core Staff
Core Staff
Posts: 2214
Joined: February 6th, 2006, 3:18 pm
Location: Germany/Bayern

Re: CoD2: firing through walls

Post by waywaaaard » December 1st, 2010, 5:41 pm

well done - keep up the work :)
THAT HANDS WERE NOT TRACED!
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality :roll:

Levcek
CJ Fan
CJ Fan
Posts: 129
Joined: March 7th, 2010, 11:37 am
Location: sLOVEnia, stajerska FTW

Re: CoD2: firing through walls

Post by Levcek » December 1st, 2010, 5:44 pm

waywaaaard wrote:well done - keep up the work :)
agreed :D
__________________________________________________________

Image THE MAPPER
__________________________________________________________

Image

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: CoD2: firing through walls

Post by IzNoGoD » December 2nd, 2010, 1:57 pm

IzNoGoD wrote:Update:
Firing through multiple walls works now.
Todo:
balance damage and maxwall distances
do some bulletspread :P

All done.
1. Wrote my own bulletspread function
2. gave a maxdistance (if you fired a shotgun towards a wall that was really far away, there still were bulletholes there. Now there arent.
LMGTFY!

Its not a glitch... Its the future!

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: CoD2: firing through walls

Post by Moustache » December 3rd, 2010, 4:05 pm

Prow :mrgreen:

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: CoD2: firing through walls

Post by IzNoGoD » December 15th, 2010, 5:45 pm

The lite script is released
http://pastebin.com/ZcynD5pr
For educational purposes only
Or use in a mod with credits to me in menu and in readme file.

Lite version does not support:
Mg42s
Shotguns
Multiple walls
Bulletspread

Those features are only available in the private version, which is not released.
LMGTFY!

Its not a glitch... Its the future!

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: CoD2: firing through walls

Post by Drofder2004 » December 15th, 2010, 10:06 pm

Very, very nice code. If only you had done this during CoD2's prime, this would've been a feature of many top mods, no doubt.

In my honest opinion, no matter how nice this code is to release, I would personally keep it private. That way, you can verify that this code is your own doing and it can be used as part of a portfolio/cv.

My only criticisms would be that it is a little messy in formatting, but that may just be pastebin.
And secondly, I would also add a lot of commentary, explaining each stage and function as the code advances.

Well done :)
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: CoD2: firing through walls

Post by IzNoGoD » December 15th, 2010, 10:17 pm

Part of the release not having comments is security through obscurity.
About portfolios: Im not in the coding business, so its not much of a concern.
Also, i almost have the pro version done, which adds all those features i listed that were not gonna be released.
LMGTFY!

Its not a glitch... Its the future!

lapd
CJ Wannabe
CJ Wannabe
Posts: 3
Joined: January 11th, 2011, 4:06 am

Re: CoD2: firing through walls

Post by lapd » January 11th, 2011, 4:14 am

IzNoGoD, very good mod and perfect work;

The only thing that would be desirable add procedure to analysis of textures which could to be raked through
something like from extreme landmine installing:

allowedSurface(plantPos)
{
startOrigin = plantPos + (0, 0, 100);
endOrigin = plantPos + (0, 0, -2048);

trace = bulletTrace(startOrigin, endOrigin, true, undefined);
if(trace["fraction"] < 1.0) surface = trace["surfacetype"];
else surface = "dirt";

switch(surface)
{
case "beach":
case "dirt":
case "grass":
case "ice":
case "mud":
case "sand":
case "snow": return true;
}

return false;
}

In your case such objects as concrete and iron shouldn't make the way. And such as the haystack or a wooden crates on width exceeding parameters don't make the way.

Sorry for my bad english

IzNoGoD
CJ Worshipper
CJ Worshipper
Posts: 343
Joined: January 6th, 2009, 8:39 pm
Location: Netherlands/Holland

Re: CoD2: firing through walls

Post by IzNoGoD » January 11th, 2011, 10:05 am

As a matter of fact, im already using such code in the pro version of the mod, but not with "allow" or "disallow"

Code: Select all

getsurfacepenetrate(surface)
{
	switch(surface)
	{
	case "bark":
		return 1;
	case "brick":
		return 1.2;
	case "carpet":
		return 1;
	case "cloth":
		return 0.8;
	case "concrete":
		return 1.8;
	case "dirt":
		return 1.1;
	case "flesh":
		return 1;
	case "foliage":
		return 1;
	case "glass":
		return 0.6;
	case "grass":
		return 1;
	case "gravel":
		return 1.3;
	case "ice":
		return 1.3;
	case "metal":
		return 2;
	case "mud":
		return 0.8;
	case "paper":
		return 0.7;
	case "plaster":
		return 1.4;
	case "rock":
		return 2;
	case "sand":
		return 0.8;
	case "snow":
		return 0.9;
	case "water":
		return 0.3;
	case "wood":
		return 1;
	case "asphalt":
		return 1.5;
	default:
		return 1;
	}
}
As you can see, metal is very hard to penetrate (2).
The vars still need a bit of tweaking though
LMGTFY!

Its not a glitch... Its the future!

Post Reply

Who is online

Users browsing this forum: No registered users and 38 guests