| 
	
	
	
	 
   
		
            
             
				Getting Allies to man an MG42 and SHOOT - 
            
          
		
		
				
		
				03-09-2003, 04:41 AM
			
			
			
		  
		
	
                
            	
		
		
		Ok, I have an SP map that has allies manning MG42s. The only problem is I spent all day trying to get them to shoot and they wouldn't. NOW I have them shooting, but they shoot at me. Below is my script. I know what the problem is, but don't know how to fix it. I have the mg42 gunner aiming and shooting at $player...which is me. Is there a universal $name for axis ai?? I have axis rushing a hill and allies shooting them from a few mg42s. I need them to shoot the axis, not me (LOL). Anyone know how to fix this? Here's what I have so far:  
 
 
exec global/loadout.scr maps/m1l1_aiPractice.scr  
exec global/ai.scr  
exec global/enable_ai.scr  
exec global/turret.scr  
exec global/auto.scr  
exec global/weather.scr  
exec global/ambient.scr m5l1b  
 
level waitTill prespawn  
 
 
level waitTill spawn  
 
$mg42a thread global/mg42_active.scr::mg42 6000  
$mg42b thread global/mg42b_active.scr::mg42b 6000  
$mg42c thread global/mg42c_active.scr::mg42c 6000  
thread global/ai.scr::spawngroup #1 #1  
 
$player item weapons/colt45.tik  
$player item weapons/m1_garand.tik  
$player item weapons/mp40.tik  
$mg42a_gunner holster  
$mg42a_gunner exec global/disable_ai.scr  
 
 
thread mg_targeting $mg42a  
 
end  
 
 
 
mg_targeting local.machinegun:  
 
waitframe  
local.loopwaittime = 0.5 // prevents loop  
 
while (!($mg42a_gunner cansee $player)) // can't see player  
{  
wait 1  
}  
while ((isalive $mg42a_gunner) && ($mg42a_gunner cansee $player)  
{  
local.machinegun burstFireSettings 0.25 0.5 1 .25  
local.machinegun maxYawOffset 55  
local.machinegun bulletdamage 20  
local.machinegun setaimtarget $player  
local.machinegun startfiring  
wait local.loopwaittime  
}  
 
end  
 
>>>>>>>>>>>>>>>>>>>>>>> END SCRIPT >>>>>>>>>>>>>>>  
 
That line above isn't in the script, it's just so you know that's the end. Anyway, I've only been messing with scripting for a few days now so I'm sure some stuff I have doesn't belong and some stuff I have does. I'm testing for mg42a....the others I have not adjusted yet. That's why there isn't a thread for them. Anyway, any help is highly appreciated! Thanks.  
 
ShadowX 
		
	
		
		
		
		
		
	
	 |