Page 1 of 2
					
				CoD2: firing through walls
				Posted: November 28th, 2010, 6:35 pm
				by IzNoGoD
				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
 
			 
			
					
				Re: CoD2: firing through walls
				Posted: November 28th, 2010, 6:37 pm
				by Rezil
				You are insane in an awesome way sir.
			 
			
					
				Re: CoD2: firing through walls
				Posted: November 28th, 2010, 8:53 pm
				by Drofder2004
				Very nciely done.
			 
			
					
				Re: CoD2: firing through walls
				Posted: November 29th, 2010, 8:15 pm
				by IzNoGoD
				More teaser stuff:
MORE TEASERS!!!!!! 
			 
			
					
				Re: CoD2: firing through walls
				Posted: November 30th, 2010, 2:43 am
				by Pedsdude
				Shame it's a few years too late 

 
			 
			
					
				Re: CoD2: firing through walls
				Posted: November 30th, 2010, 5:42 pm
				by IzNoGoD
				Update:
Firing through multiple walls works now.
Todo:
balance damage and maxwall distances
do some bulletspread 

 
			 
			
					
				Re: CoD2: firing through walls
				Posted: December 1st, 2010, 5:41 pm
				by waywaaaard
				well done - keep up the work 

 
			 
			
					
				Re: CoD2: firing through walls
				Posted: December 1st, 2010, 5:44 pm
				by Levcek
				waywaaaard wrote:well done - keep up the work 

 
agreed 

 
			 
			
					
				Re: CoD2: firing through walls
				Posted: December 2nd, 2010, 1:57 pm
				by IzNoGoD
				IzNoGoD wrote:Update:
Firing through multiple walls works now.
Todo:
balance damage and maxwall distances
do some bulletspread 

 
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.
 
			 
			
					
				Re: CoD2: firing through walls
				Posted: December 3rd, 2010, 4:05 pm
				by Moustache
				Prow 

 
			 
			
					
				Re: CoD2: firing through walls
				Posted: December 15th, 2010, 5:45 pm
				by IzNoGoD
				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.
 
			 
			
					
				Re: CoD2: firing through walls
				Posted: December 15th, 2010, 10:06 pm
				by Drofder2004
				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 

 
			 
			
					
				Re: CoD2: firing through walls
				Posted: December 15th, 2010, 10:17 pm
				by IzNoGoD
				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.
			 
			
					
				Re: CoD2: firing through walls
				Posted: January 11th, 2011, 4:14 am
				by lapd
				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
			 
			
					
				Re: CoD2: firing through walls
				Posted: January 11th, 2011, 10:05 am
				by IzNoGoD
				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