| Author | Message | 
        
			| p3lb0x Forum Moderator 
					Joined: Fri Feb 02, 2007 3:53 pm
 Posts: 1896
 Location: in my little gay bunker
   |   Multi Turret CrabSo, I succeeded in making a multi turret crab with the help of Roon3. I have single problem though. With my current code the crabs don't rotate with the crab, this makes it look like ♥♥♥♥ if it's walking down hills or tipping over. Any one know how I can change this?
 edit: Also all you people out there that probably wants this thing. What kinda gun should it have? ATM it has the dummy turrets machine gun
 
 
 | 
		
			| Tue May 26, 2009 2:42 pm | 
					
					   | 
	
	
		|  | 
	
			| Grif REAL AMERICAN HERO 
					Joined: Sat Jan 27, 2007 10:25 pm
 Posts: 5655
   |   Re: Multi Turret CrabGet the parent and then set the child RotAngle with the parent's RotAngle? It'll still look bad because the game won't know to attach them, so when you tilt too much the central body will be inside the others. 
 
 | 
		
			| Tue May 26, 2009 2:54 pm | 
					
					   | 
	
	
		|  | 
	
			| Metal Meltdown Banned 
					Joined: Thu May 14, 2009 9:22 pm
 Posts: 826
 Location: Lookin' forward to mocking people on Jan 1st 2013.
   |   Re: Multi Turret Crabp3lb0x wrote: What kinda gun should it have?Red, evil, death ray. Or some sort of massive, apocalypse-bringing, nuclear crab guns. We're really short on explosive crab cannons.
 
 | 
		
			| Tue May 26, 2009 2:57 pm | 
					
					     | 
	
	
		|  | 
	
			| piipu 
					Joined: Mon Jun 30, 2008 9:13 pm
 Posts: 499
 Location: Finland
   |   Re: Multi Turret CrabQuote: local offsetx = self.gun.Pos.X - self.Pos.Xlocal offsety = self.gun.Pos.Y - self.Pos.Y
 self.gun.RotAngle = math.atan2(offsetx,-offsety)
That should basically work.
 
 | 
		
			| Tue May 26, 2009 3:03 pm | 
					
					   | 
	
	
		|  | 
	
			| 411570N3 
					Joined: Wed Jan 07, 2009 10:26 am
 Posts: 4074
 Location: That quaint little British colony down south
   |   Re: Multi Turret Crabp3lb0x wrote: What kinda gun should it have? ATM it has the dummy turrets machine gunAt least one version including a decent powered slug gun. Otherwise perhaps some decent speed, decent accuracy, semi-automatic rifles.
 
 | 
		
			| Tue May 26, 2009 3:09 pm | 
					
					     | 
	
	
		|  | 
	
			| piipu 
					Joined: Mon Jun 30, 2008 9:13 pm
 Posts: 499
 Location: Finland
   |   Re: Multi Turret CrabYAK-47, revolver cannon and heavy sniper work nice for turrets. 
 
 | 
		
			| Tue May 26, 2009 3:11 pm | 
					
					   | 
	
	
		|  | 
	
			| Daman 
					Joined: Fri Jan 26, 2007 3:22 am
 Posts: 1451
   |   Re: Multi Turret CrabI don't understand? Why would setting the rotangle fix anything. That'd just rotate it and not actually move the orientation position it is attached at. If you're not setting the position via Lua, you should do that and you can set its position based on the parent's rotangle accurately. I'll give you an example of moving the position's orientation using rotangle and some minor trigonometry when I have access to my computer. 
 
 | 
		
			| Tue May 26, 2009 6:04 pm | 
					
					   | 
	
	
		|  | 
	
			| AaronLee 
					Joined: Fri Jun 01, 2007 12:17 am
 Posts: 106
   |   Re: Multi Turret CrabI was having this problem with my turret attempt with the coalition dropship. As Daman says, there's no real easy way atm. I was generating a hardcoded Vector and attempting to use the Vector's RadRotate function to rotate it relative to the parent's RotAngle. But, ther'es some unforseen thing that's loopy with some functiuons, that one included. It doesn't accept RotAngle for an argument and doesn't work atm. That means either bide your time or do it like Daman says and use atan2 and the like to do it "manually" fun fun  
 
 | 
		
			| Wed May 27, 2009 3:14 am | 
					
					     | 
	
	
		|  | 
	
			| Lord Tim 
					Joined: Fri Apr 27, 2007 4:55 pm
 Posts: 1178
 Location: America!
   |   Re: Multi Turret CrabI was messing around with this a bit to put turrets on dropships. Here are the formulas you want I think: 
 
 | 
		
			| Wed May 27, 2009 4:43 am | 
					
					   | 
	
	
		|  | 
	
	
		|  |